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

Gilles commented on NUMBERS-38:
-------------------------------

Thanks a lot for the clear description.

{quote}
Gamma gammaFun = new Gamma(); gammaFun.value( x );
...
{quote}

>From an OO programming POV, your idea is appealing; however I'm afraid that 
>from a usage POV, it would be a problem in the sense that it seems that one 
>would have to use different instances to order to achieve the same precision 
>for different input domains.
At least, that's how I understood the different branches in the current code.

In short, IMO we should provide an implementation that is a good compromise 
between accuracy (knowing that we deal with double precision) and speed 
(assuming modern CPUs).

On a practical level, I first thought that {{LanczosApproximation}} (as 
currently defined) was only an internal part of the {{Gamma}} computation, and 
I had made it package-private.  But, as I mentioned in the previous comment, 
the functionality is called from the {{GammaDistribution}} class in "Commons 
Math"; if you change the value that is computed, that code won't work anymore 
(perhaps it can be recoded in terms of the new value, but that must be assessed 
if we don't want to duplicate code).

> No unit tests for "LanczosApproximation" class
> ----------------------------------------------
>
>                 Key: NUMBERS-38
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-38
>             Project: Commons Numbers
>          Issue Type: Test
>            Reporter: Gilles
>              Labels: unit-test
>             Fix For: 1.0
>
>         Attachments: NUMBERS-38.patch
>
>
> The computation of the {{LanczosApproximation}} (package 
> {{o.a.c.numbers.gamma}} in module {{commons-numbers-gamma}}) function is not 
> checked by unit tests.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to