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

Alex Herbert commented on RNG-137:
----------------------------------

Looking through the test for the accuracy of tan( x) / x, the test did not use 
a uniform x. It used a geometrically distributed x with increasing density as x 
-> 0. I changed the test to compute the mean and max ULP using a random uniform 
x in (0, pi / 4) which is the range used by the sampler.

Here are the results for the original approximation tan4283 and the extra 
precision tan4288 with a million random samples:
{noformat}
         tan(x)                   tan(x) / x
tan4283  93428.606836    201166 : 68301.385441   128066
tan4288      0.590735         4 :      0.40446        3
{noformat}
So the approximation is not as good as I previously posted. But with a mean ULP 
of <0.6 and a max ULP from Math.tan( x) of 4 this is acceptable for the 
increase in speed provided to the sampler.

> Move class from "Commons Math"
> ------------------------------
>
>                 Key: RNG-137
>                 URL: https://issues.apache.org/jira/browse/RNG-137
>             Project: Commons RNG
>          Issue Type: Task
>          Components: sampling
>            Reporter: Gilles Sadowski
>            Assignee: Alex Herbert
>            Priority: Trivial
>              Labels: commons-math, port
>             Fix For: 1.4
>
>         Attachments: Alpha1Performance.jpg, Beta0Performance.jpg, 
> GeneralPerformance.jpg, alpha0.5.jpg, alpha0.5b.jpg, alpha1.3.jpg, 
> alpha1.3b.jpg, beta0.3.jpg, beta0.3b.jpg
>
>
> Shouldn't CM's class 
> [{{StableRandomGenerator}}|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/main/java/org/apache/commons/math4/random/StableRandomGenerator.java;h=f3a851b9b16c47546cac8371e272dbf59a909c09;hb=HEAD]
>  be moved to the \{{commons-rng-sampling}} module?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to