[
https://issues.apache.org/jira/browse/NUMBERS-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17351005#comment-17351005
]
Matt Juntunen commented on NUMBERS-156:
---------------------------------------
Adding the {{sqrt2}} method to {{extLinearSinglePass}} and naming the method
{{extLinearSqrt2}} gives the following.
||name||input type||error mean||error std dev||error min||error max||failed||
|direct|high|NaN|-0.00|Infinity|-Infinity|200000|
|enormModExt|high|0.00165|0.375|-1.00|1.00|0|
|extLinear|high|0.000900|0.368|-1.00|1.00|0|
|extLinearMod|high|0.000900|0.368|-1.00|1.00|0|
|extLinearSinglePass|high|0.000900|0.368|-1.00|1.00|0|
|extLinearSqrt2|high|-0.000560|0.225|-1.00|1.00|0|
|direct|high-thresh|0.00340|1.02|-6.00|5.00|0|
|enormModExt|high-thresh|0.00306|0.374|-1.00|1.00|0|
|extLinear|high-thresh|0.00231|0.367|-1.00|1.00|0|
|extLinearMod|high-thresh|0.00231|0.367|-1.00|1.00|0|
|extLinearSinglePass|high-thresh|0.00231|0.367|-1.00|1.00|0|
|extLinearSqrt2|high-thresh|0.000850|0.221|-1.00|1.00|0|
|direct|mid|0.00368|1.02|-6.00|5.00|0|
|enormModExt|mid|0.00334|0.385|-1.00|1.00|0|
|extLinear|mid|0.00259|0.378|-1.00|1.00|0|
|extLinearMod|mid|0.00259|0.378|-1.00|1.00|0|
|extLinearSinglePass|mid|0.00259|0.378|-1.00|1.00|0|
|extLinearSqrt2|mid|0.00113|0.262|-1.00|1.00|0|
|direct|low-thresh|0.00247|1.02|-6.00|5.00|0|
|enormModExt|low-thresh|0.00213|0.375|-1.00|1.00|0|
|extLinear|low-thresh|0.00138|0.367|-1.00|1.00|0|
|extLinearMod|low-thresh|0.00138|0.367|-1.00|1.00|0|
|extLinearSinglePass|low-thresh|0.00138|0.367|-1.00|1.00|0|
|extLinearSqrt2|low-thresh|-8.00e-05|0.222|-1.00|1.00|0|
|direct|low|5.67e+04|1.87e+05|-2.15e+06|4.88e+06|0|
|enormModExt|low|0.00312|1.02|-6.00|5.00|0|
|extLinear|low|0.00203|0.367|-1.00|1.00|0|
|extLinearMod|low|0.00203|0.367|-1.00|1.00|0|
|extLinearSinglePass|low|0.00203|0.367|-1.00|1.00|0|
|extLinearSqrt2|low|0.000570|0.219|-1.00|1.00|0|
|direct|full|-0.0110|0.492|-2.00|2.00|194020|
|enormModExt|full|-0.00195|0.469|-1.00|1.00|0|
|extLinear|full|-0.000150|0.436|-1.00|1.00|0|
|extLinearMod|full|-0.000150|0.436|-1.00|1.00|0|
|extLinearSinglePass|full|-0.000150|0.436|-1.00|1.00|0|
|extLinearSqrt2|full|0.00102|0.385|-1.00|1.00|0|
!performance5-all.png!
!performance5-1-5.png!
The new method definitely improves the accuracy but it is also the slowest
algorithm at small vector lengths. Altogether, I would prefer to use
{{extLinearSinglePass}} due to the increased performance and similar bounds on
min and max ulp error.
> 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,
> performance5-1-5.png, performance5-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)