[ https://issues.apache.org/jira/browse/MATH-1269?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Otmar Ertl updated MATH-1269: ----------------------------- Attachment: MATH-1269-fix-tempC-infinity.patch One more proposal. The problem is the calculation of (1+z)(tempA+tempB) if tempA is infinite. In this case tempC is also infinite. If z < 0 at the same time we get NaN for tempC*z + tempB + tempA. The proposed patch returns infinity for the case tempC is positive infinite. In all other cases tempC*z cannot be negative infinite and the evaluation of tempC*z + tempB + tempA is not a problem even if tempA or tempB are positive infinite. > FastMath.exp may return NaN for non-NaN arguments > ------------------------------------------------- > > Key: MATH-1269 > URL: https://issues.apache.org/jira/browse/MATH-1269 > Project: Commons Math > Issue Type: Bug > Affects Versions: 4.0 > Reporter: Otmar Ertl > Attachments: MATH-1269-fix-tempC-infinity.patch, MATH-1269.patch, > MATH-1269.patch, MATH-1269_fix_z.patch > > > I have observed that FastMath.exp(709.8125) returns NaN. However, the > exponential function must never return NaN (if the argument is not NaN). The > result must always be non-negative or positive infinity. -- This message was sent by Atlassian JIRA (v6.3.4#6332)