Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
None
-
None
-
None
Description
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 (on my machine) to something like 370 ms for 10 million computations.
And, of course, the downside will be that these constants will be computed at the loading of "FastMath", leading to an additional penalty of about 16 divisions at initialization...