Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 31403 invoked from network); 1 Sep 2010 20:48:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 1 Sep 2010 20:48:34 -0000 Received: (qmail 3858 invoked by uid 500); 1 Sep 2010 20:48:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 3802 invoked by uid 500); 1 Sep 2010 20:48:33 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 3794 invoked by uid 99); 1 Sep 2010 20:48:33 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 20:48:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Sep 2010 20:48:15 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o81KlsQc019993 for ; Wed, 1 Sep 2010 20:47:54 GMT Message-ID: <3310783.123521283374074271.JavaMail.jira@thor> Date: Wed, 1 Sep 2010 16:47:54 -0400 (EDT) From: "Jeff Hain (JIRA)" To: issues@commons.apache.org Subject: [jira] Issue Comment Edited: (MATH-375) Elementary functions in JDK are slower than necessary and not as accurate as they could be. In-Reply-To: <25525697.36411276039695053.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-375?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D129052= 10#action_12905210 ]=20 Jeff Hain edited comment on MATH-375 at 9/1/10 4:46 PM: -------------------------------------------------------- Hello. William, I've also contracted the fast-math disease some time ago, which en= ded up into some FastMath class as well (http://sourceforge.net/projects/ja= fama). Though, your form seems more severe, since you felt the need to stay within= about +-0.5 ULP :) Anyway, I did run my "FastMath" tests on your class (with the patch), and f= ound some troubles with special cases, especially +-Infinity, NaN, or huge = values: see "test_fastmath_wr.zip" attachment, which contains test code, and a log = of their run. Also, running your tests, I had this exception: -19.731458173549257=092.696103718050787E-9=092.6961037180507868E-9=091.5340= 29657343928E-16=090.5025524399680612 Exception in thread "main" java.lang.RuntimeException: exp() had errors in = excess of 0.502 ULP =09at FastMathWRTest.testExpAccuracy(FastMathWRTest.java:458) =09at FastMathWRTest.main(FastMathWRTest.java:18) May it help you improve your treatments! Regards, Jeff was (Author: jeff): Hello. William, I've also contracted the fast-math disease some time ago, which en= ded up into some FastMath class as well (http://sourceforge.net/projects/ja= fama). Though, your form seems more severe, since you felt the need to stay within= about +-0.5 ULP :) Anyway, I did run my "FastMath" tests on your class, and found some trouble= s with special cases, especially +-Infinity, NaN, or huge values: see "test_fastmath_wr.zip" attachment, which contains test code, and a log = of their run. Also, running your tests, I had this exception: -19.731458173549257=092.696103718050787E-9=092.6961037180507868E-9=091.5340= 29657343928E-16=090.5025524399680612 Exception in thread "main" java.lang.RuntimeException: exp() had errors in = excess of 0.502 ULP =09at FastMathWRTest.testExpAccuracy(FastMathWRTest.java:458) =09at FastMathWRTest.main(FastMathWRTest.java:18) May it help you improve your treatments! Regards, Jeff =20 > Elementary functions in JDK are slower than necessary and not as accurate= as they could be. > -------------------------------------------------------------------------= ------------------ > > Key: MATH-375 > URL: https://issues.apache.org/jira/browse/MATH-375 > Project: Commons Math > Issue Type: New Feature > Environment: JDK 1.4 - 1.6 > Reporter: William Rossi > Fix For: 2.2 > > Attachments: atanpatch.txt.gz, FastMath.tar.gz, test_fastmath_wr.= zip > > > I would like to contribute improved versions on exp(), log(), pow(), etc.= to the project. Please refer to this discussion thread http://markmail.o= rg/message/zyeoguw6gwtofm62. > I have developed over the past year a set of elementary functions similar= to those in java.lang.Math, but with the following characteristics: > * Higher performance. > * Better accuracy. Results are accurate to slightly more that +/- 0.5 UL= P. > * Pure Java. The standard Math class is impleneted via JNI, and thus tak= es a performance hit. > Note that some functions such as exp are nearly twice as fast in my imple= mentation. =C2=A0 I've seen it 3 times faster on different processors. =C2= =A0 The preformance varies by the relative speed of calculation vs memory l= ookups. > The functions are implemented as tables of values in extra precision (app= rox 70 bits), and then interpolated with a minimax polynomial. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.