You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Thomas Neidhart (Commented) (JIRA)" <ji...@apache.org> on 2012/04/13 16:34:17 UTC

[jira] [Commented] (MATH-740) Some "FastMath" functions are slow

    [ https://issues.apache.org/jira/browse/MATH-740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253415#comment-13253415 ] 

Thomas Neidhart commented on MATH-740:
--------------------------------------

I am a bit puzzled, does anybody have an idea why Math is faster than StrictMath, although internally, Math.log10 just calls StrictMath.log10?

{noformat}
Name     StrictMath      FastMath          Math Runs=10000000 Java 1.6.0_20 (1.6.0_20-b02) Java HotSpot(TM) Server VM (16.3-b01)
log10     98    1.0    161 1.6377     23 0.2427
{noformat}

>From Math.java:

{noformat}
    public static double log10(double a) {
	return StrictMath.log10(a); // default impl. delegates to StrictMath
    }
{noformat}
                
> Some "FastMath" functions are slow
> ----------------------------------
>
>                 Key: MATH-740
>                 URL: https://issues.apache.org/jira/browse/MATH-740
>             Project: Commons Math
>          Issue Type: Wish
>            Reporter: Gilles
>            Priority: Minor
>             Fix For: 3.1
>
>
> From the two benchmarks we currently have in "FastMathTestPerfomance", we have that the following functions are much slower in "FastMath" than in either "Math" or "StrictMath" (the performance *loss*, for each of the benchmarks, is given in parentheses):
> * log10 (46%, 36%)
> * log1p (68%, 112%)
> * tan (11%, 61%)
> * atan (26%, 125%)
> * atan2 (44%, 40%)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira