commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-951) Patch: Faster implementation of double org.apache.commons.math3.FastMath.copySign(double, double)
Date Wed, 20 Mar 2013 16:55:19 GMT

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

Sebb commented on MATH-951:
---------------------------

Oops, sorry, my bad (it was a long day).

I agree there is no overflow for XOR and it should be fast.
Perhaps not as fast as a comparison with 0 but there will be at least 2 and possibly 3 such
checks required.

Given that the code is not immediately obvious, it would be worth adding a comment along the
lines of your first two sentences above.
                
> Patch: Faster implementation of double org.apache.commons.math3.FastMath.copySign(double,
double)
> -------------------------------------------------------------------------------------------------
>
>                 Key: MATH-951
>                 URL: https://issues.apache.org/jira/browse/MATH-951
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.2
>         Environment: java version "1.6.0_27"
> OpenJDK Runtime Environment (IcedTea6 1.12.3) (6b27-1.12.3-1)
> OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
> Linux debian 3.2.0-4-amd64 #2 SMP Wed Jan 2 01:41:29 PST 2013 x86_64 GNU/Linux
> Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz
>            Reporter: Charles Cooper
>            Priority: Minor
>              Labels: patch, performance
>             Fix For: 3.2
>
>         Attachments: patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> Between 40-50% faster than both current implementation and java.lang.Math.copySign by
my (sloppy) benchmark. Patch attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message