commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (Created) (JIRA)" <>
Subject [jira] [Created] (MATH-688) "FastMath" contains fractions of constants
Date Sun, 09 Oct 2011 00:25:29 GMT
"FastMath" contains fractions of constants

                 Key: MATH-688
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Gilles
            Assignee: Gilles
            Priority: Trivial
             Fix For: 3.0

Fractions such as 1.0 / 3.0, 1.0 / 5.0, ... could be replaced with static final constants.
In "asinh", for example, the change can sometimes result in more than halving the computation
time (when the argument is in the range of values where the constants are used).

In absolute times, the gain is not huge, amounting to something like 5 ms for 10 million computations.

And, of course, the downside will be that these values will be computed at the loading of
"FastMath", leading to an additional penalty of about 16 divisions at initialization... :)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message