[ 
https://issues.apache.org/jira/browse/NUMBERS-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17348321#comment-17348321
 ] 

Matt Juntunen commented on NUMBERS-156:
---------------------------------------

{quote}I would be inclined to use an extended precision computation.
{quote}
That's probably a good idea.

Here are the results with the extended-precision enorm method 
({{enormModExt}}). It has similar characteristics to {{enormModKahan}} but with 
a narrower min and max error in the "full" input type. It also performs better 
than {{extLinear}} at small vector lengths. Overall, this seems like a good 
choice.

 
||name||input type||error mean||error std dev||error min||error max||failed||
|direct|high|NaN|-0.00|Infinity|-Infinity|200000|
|enorm|high|0.00528|1.11|-6.00|6.00|0|
|enormMod|high|-0.00327|1.02|-6.00|5.00|0|
|enormModKahan|high|-6.50e-05|0.385|-1.00|1.00|0|
|enormModExt|high|-0.000340|0.383|-1.00|1.00|0|
|extLinear|high|0.000190|0.368|-1.00|1.00|0|
|direct|high-thresh|-0.00361|1.02|-6.00|6.00|0|
|enorm|high-thresh|0.00494|1.11|-6.00|6.00|0|
|enormMod|high-thresh|-0.00205|0.798|-4.00|4.00|0|
|enormModKahan|high-thresh|0.000145|0.383|-1.00|1.00|0|
|enormModExt|high-thresh|8.50e-05|0.381|-1.00|1.00|0|
|extLinear|high-thresh|-0.000150|0.367|-1.00|1.00|0|
|direct|mid|-0.00485|1.03|-6.00|6.00|0|
|enorm|mid|-0.00485|1.03|-6.00|6.00|0|
|enormMod|mid|-0.00485|1.03|-6.00|6.00|0|
|enormModKahan|mid|-0.00165|0.392|-1.00|1.00|0|
|enormModExt|mid|-0.00192|0.390|-1.00|1.00|0|
|extLinear|mid|-0.00139|0.377|-1.00|1.00|0|
|direct|low-thresh|-0.00359|1.02|-6.00|6.00|0|
|enorm|low-thresh|0.00496|1.11|-6.00|6.00|0|
|enormMod|low-thresh|-0.00203|0.798|-4.00|4.00|0|
|enormModKahan|low-thresh|0.000165|0.383|-1.00|1.00|0|
|enormModExt|low-thresh|0.000105|0.382|-1.00|1.00|0|
|extLinear|low-thresh|-0.000130|0.367|-1.00|1.00|0|
|direct|low|5.78e+04|1.89e+05|-2.39e+06|6.79e+06|0|
|enorm|low|0.00503|1.11|-6.00|6.00|0|
|enormMod|low|-0.00352|1.02|-6.00|6.00|0|
|enormModKahan|low|-0.000315|0.383|-1.00|1.00|0|
|enormModExt|low|-0.000590|0.381|-1.00|1.00|0|
|extLinear|low|-6.00e-05|0.367|-1.00|1.00|0|
|direct|full|0.00306|0.499|-2.00|2.00|194126|
|enorm|full|0.0912|0.678|-3.00|3.00|0|
|enormMod|full|0.00820|0.494|-2.00|2.00|0|
|enormModKahan|full|-0.000900|0.477|-2.00|2.00|0|
|enormModExt|full|-0.00327|0.467|-1.00|1.00|0|
|extLinear|full|0.00193|0.435|-1.00|1.00|1895|


 !performance2-all.png! 
 !performance2-1-5.png! 

> 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
>
>
> 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)

Reply via email to