[ 
https://issues.apache.org/jira/browse/NUMBERS-209?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alex Herbert resolved NUMBERS-209.
----------------------------------
    Fix Version/s: 1.4
         Assignee: Alex Herbert
       Resolution: Fixed

Fixed in commit:

8ac25c90936d47a90b41126dffd0a0511094acf2

> Infinite loop for Trigamma function on large negative values
> ------------------------------------------------------------
>
>                 Key: NUMBERS-209
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-209
>             Project: Commons Numbers
>          Issue Type: Bug
>          Components: gamma
>    Affects Versions: 1.3
>            Reporter: Alex Herbert
>            Assignee: Alex Herbert
>            Priority: Minor
>             Fix For: 1.4
>
>
> The Trigamma function increments the input argument by 1 until it exceeds the 
> threshold of 49. This is not suitable for large negative values (below -2^53) 
> as the increment does not increment the argument.
> Note that double values above 2^53 in magnitude are integers. For negative 
> arguments any integer is a pole of the trigamma function and has the value 
> +infinity.
> However smaller magnitude arguments may take prohibitively long to compute by 
> incrementing. In this case it is possible to use the reflection formula:
> {noformat}
> trigamma(x) + trigamma(1 - x) = pi^2 / sin^2(pi * x)
> if x < 0:
>     trigamma(x) = pi^2 / sin^2(pi * x) - trigamma(1 - x){noformat}
> Issue identified using a security scan.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to