[jira] Created: (MATH-354) compiler dependency in RandomDataImpl.getPoisson(double mean)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-354) compiler dependency in RandomDataImpl.getPoisson(double mean)

Gary D. Gregory (Jira)
compiler dependency in RandomDataImpl.getPoisson(double mean)
-------------------------------------------------------------

                 Key: MATH-354
                 URL: https://issues.apache.org/jira/browse/MATH-354
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 2.0
         Environment: jre1.5/jre1.6
            Reporter: Michael Sammeth


Hi,

in RandomDataImpl.getPoisson(double mean) I got the following problem in the case mean>= 6.0:

in the branch if (u <= c1):

if (x < -mu)
    w = Double.POSITIVE_INFINITY;

implicits that (int) (mu+ x) < 0

I found that for some compiler/run-time environments the subsequent update of the "accept" value then fails, as by the right hand side of the comparison leads to an Exception in MathUtils.factorialLog((int) (mu + x)). Some compiler/jre combinations, however, skip evaluating the right side as by isInfinity(w).

To ensure stability, I currently worked around by an explicit if(Double.isInfinity(w)) branch, however, I would like to ask whether there is a more elegant way to ensure general functionality of that method.

Thank you, micha.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (MATH-354) compiler dependency in RandomDataImpl.getPoisson(double mean)

Gary D. Gregory (Jira)

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

Phil Steitz resolved MATH-354.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1

The method has been rewritten in version 2.1.  The current version no longer includes the compiler-dependent code referenced in this issue.

> compiler dependency in RandomDataImpl.getPoisson(double mean)
> -------------------------------------------------------------
>
>                 Key: MATH-354
>                 URL: https://issues.apache.org/jira/browse/MATH-354
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: jre1.5/jre1.6
>            Reporter: Michael Sammeth
>             Fix For: 2.1
>
>
> Hi,
> in RandomDataImpl.getPoisson(double mean) I got the following problem in the case mean>= 6.0:
> in the branch if (u <= c1):
> if (x < -mu)
>     w = Double.POSITIVE_INFINITY;
> implicits that (int) (mu+ x) < 0
> I found that for some compiler/run-time environments the subsequent update of the "accept" value then fails, as by the right hand side of the comparison leads to an Exception in MathUtils.factorialLog((int) (mu + x)). Some compiler/jre combinations, however, skip evaluating the right side as by isInfinity(w).
> To ensure stability, I currently worked around by an explicit if(Double.isInfinity(w)) branch, however, I would like to ask whether there is a more elegant way to ensure general functionality of that method.
> Thank you, micha.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (MATH-354) compiler dependency in RandomDataImpl.getPoisson(double mean)

Gary D. Gregory (Jira)
In reply to this post by Gary D. Gregory (Jira)

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

Phil Steitz closed MATH-354.
----------------------------


> compiler dependency in RandomDataImpl.getPoisson(double mean)
> -------------------------------------------------------------
>
>                 Key: MATH-354
>                 URL: https://issues.apache.org/jira/browse/MATH-354
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: jre1.5/jre1.6
>            Reporter: Michael Sammeth
>             Fix For: 2.1
>
>
> Hi,
> in RandomDataImpl.getPoisson(double mean) I got the following problem in the case mean>= 6.0:
> in the branch if (u <= c1):
> if (x < -mu)
>     w = Double.POSITIVE_INFINITY;
> implicits that (int) (mu+ x) < 0
> I found that for some compiler/run-time environments the subsequent update of the "accept" value then fails, as by the right hand side of the comparison leads to an Exception in MathUtils.factorialLog((int) (mu + x)). Some compiler/jre combinations, however, skip evaluating the right side as by isInfinity(w).
> To ensure stability, I currently worked around by an explicit if(Double.isInfinity(w)) branch, however, I would like to ask whether there is a more elegant way to ensure general functionality of that method.
> Thank you, micha.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.