[
https://issues.apache.org/jira/browse/NUMBERS-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17350398#comment-17350398
]
Matt Juntunen edited comment on NUMBERS-156 at 5/24/21, 9:45 PM:
-----------------------------------------------------------------
Thanks for the fix, Alex. I'm made the updates and run the tests again. I've
also added another version using the linear combination code that only makes a
single pass through the input array, following the same procedure as {{enorm}}.
The new method is called {{extLinearSinglePass}}. (Note that I've left the
standard precision methods out of the tests with the exception of {{direct}}).
||name||input type||error mean||error std dev||error min||error max||failed||
|direct|high|NaN|-0.00|Infinity|-Infinity|200000|
|enormModExt|high|-0.00121|0.375|-1.00|1.00|0|
|extLinear|high|-0.00129|0.367|-1.00|1.00|0|
|extLinearMod|high|-0.00129|0.367|-1.00|1.00|0|
|extLinearSinglePass|high|-0.00129|0.367|-1.00|1.00|0|
|direct|high-thresh|-0.00208|1.02|-5.00|6.00|0|
|enormModExt|high-thresh|-0.000570|0.374|-1.00|1.00|0|
|extLinear|high-thresh|-0.000650|0.367|-1.00|1.00|0|
|extLinearMod|high-thresh|-0.000650|0.367|-1.00|1.00|0|
|extLinearSinglePass|high-thresh|-0.000650|0.367|-1.00|1.00|0|
|direct|mid|-0.00237|1.02|-6.00|6.00|0|
|enormModExt|mid|-0.000860|0.385|-1.00|1.00|0|
|extLinear|mid|-0.000940|0.378|-1.00|1.00|0|
|extLinearMod|mid|-0.000940|0.378|-1.00|1.00|0|
|extLinearSinglePass|mid|-0.000940|0.378|-1.00|1.00|0|
|exact|low-thresh|0.00|0.00|0.00|0.00|0|
|direct|low-thresh|-0.00206|1.02|-5.00|6.00|0|
|enormModExt|low-thresh|-0.000550|0.374|-1.00|1.00|0|
|extLinear|low-thresh|-0.000630|0.366|-1.00|1.00|0|
|extLinearMod|low-thresh|-0.000630|0.366|-1.00|1.00|0|
|extLinearSinglePass|low-thresh|-0.000630|0.366|-1.00|1.00|0|
|direct|low|5.76e+04|1.87e+05|-2.52e+06|2.57e+06|0|
|enormModExt|low|-0.00292|1.02|-5.00|6.00|0|
|extLinear|low|-0.00149|0.367|-1.00|1.00|0|
|extLinearMod|low|-0.00149|0.367|-1.00|1.00|0|
|extLinearSinglePass|low|-0.00149|0.367|-1.00|1.00|0|
|direct|full|0.00253|0.497|-2.00|1.00|194074|
|enormModExt|full|-0.000810|0.469|-2.00|1.00|0|
|extLinear|full|0.00149|0.438|-1.00|1.00|0|
|extLinearMod|full|0.00149|0.438|-1.00|1.00|0|
|extLinearSinglePass|full|0.00149|0.438|-1.00|1.00|0|
!performance4-all.png!
!performance4-1-5.png!
It seems like {{extLinearSinglePass}} may be the way to go here since it is
showing the same accuracy as the other {{extLinear}} methods but with improved
performance. The code for this can be found
[here|https://github.com/darkma773r/commons-numbers/blob/vector-methods/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/EuclideanNormAlgorithms.java#L483].
was (Author: mattjuntunen):
Thanks for the fix, Alex. I'm made the updates and run the tests again. I've
also added another version using the linear combination code that only makes a
single pass through the input array, following the same procedure as {{enorm}}.
The new method is called {{extLinearSinglePass}}. (Note that I've left the
standard precision methods out of the tests with the exception of {{direct}}).
||name||input type||error mean||error std dev||error min||error max||failed||
|direct|high|NaN|-0.00|Infinity|-Infinity|200000|
|enormModExt|high|-0.00121|0.375|-1.00|1.00|0|
|extLinear|high|-0.00129|0.367|-1.00|1.00|0|
|extLinearMod|high|-0.00129|0.367|-1.00|1.00|0|
|extLinearSinglePass|high|-0.00129|0.367|-1.00|1.00|0|
|direct|high-thresh|-0.00208|1.02|-5.00|6.00|0|
|enormModExt|high-thresh|-0.000570|0.374|-1.00|1.00|0|
|extLinear|high-thresh|-0.000650|0.367|-1.00|1.00|0|
|extLinearMod|high-thresh|-0.000650|0.367|-1.00|1.00|0|
|extLinearSinglePass|high-thresh|-0.000650|0.367|-1.00|1.00|0|
|direct|mid|-0.00237|1.02|-6.00|6.00|0|
|enormModExt|mid|-0.000860|0.385|-1.00|1.00|0|
|extLinear|mid|-0.000940|0.378|-1.00|1.00|0|
|extLinearMod|mid|-0.000940|0.378|-1.00|1.00|0|
|extLinearSinglePass|mid|-0.000940|0.378|-1.00|1.00|0|
|exact|low-thresh|0.00|0.00|0.00|0.00|0|
|direct|low-thresh|-0.00206|1.02|-5.00|6.00|0|
|enormModExt|low-thresh|-0.000550|0.374|-1.00|1.00|0|
|extLinear|low-thresh|-0.000630|0.366|-1.00|1.00|0|
|extLinearMod|low-thresh|-0.000630|0.366|-1.00|1.00|0|
|extLinearSinglePass|low-thresh|-0.000630|0.366|-1.00|1.00|0|
|direct|low|5.76e+04|1.87e+05|-2.52e+06|2.57e+06|0|
|enormModExt|low|-0.00292|1.02|-5.00|6.00|0|
|extLinear|low|-0.00149|0.367|-1.00|1.00|0|
|extLinearMod|low|-0.00149|0.367|-1.00|1.00|0|
|extLinearSinglePass|low|-0.00149|0.367|-1.00|1.00|0|
|direct|full|0.00253|0.497|-2.00|1.00|194074|
|enormModExt|full|-0.000810|0.469|-2.00|1.00|0|
|extLinear|full|0.00149|0.438|-1.00|1.00|0|
|extLinearMod|full|0.00149|0.438|-1.00|1.00|0|
|extLinearSinglePass|full|0.00149|0.438|-1.00|1.00|0|
!performance4-all.png!
!performance3-1-5.png!
It seems like {{extLinearSinglePass}} may be the way to go here since it is
showing the same accuracy as the other {{extLinear}} methods but with improved
performance. The code for this can be found
[here|https://github.com/darkma773r/commons-numbers/blob/vector-methods/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/arrays/EuclideanNormAlgorithms.java#L483].
> SafeNorm 3D overload
> --------------------
>
> Key: NUMBERS-156
> URL: https://issues.apache.org/jira/browse/NUMBERS-156
> Project: Commons Numbers
> Issue Type: Improvement
> Reporter: Matt Juntunen
> Priority: Major
> Attachments: performance-all.png, performance-len-1-5.png,
> performance2-1-5.png, performance2-all.png, performance3-1-5.png,
> performance3-all.png, performance4-1-5.png, performance4-all.png
>
>
> We should create an overload of {{SafeNorm.value}} that accepts 3 arguments
> to potentially improve performance for 3D vectors.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)