Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73B25705C for ; Sun, 9 Oct 2011 00:33:52 +0000 (UTC) Received: (qmail 9236 invoked by uid 500); 9 Oct 2011 00:33:51 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 9172 invoked by uid 500); 9 Oct 2011 00:33:51 -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 9164 invoked by uid 99); 9 Oct 2011 00:33:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2011 00:33:51 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2011 00:33:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id B51EA2B0729 for ; Sun, 9 Oct 2011 00:33:29 +0000 (UTC) Date: Sun, 9 Oct 2011 00:33:29 +0000 (UTC) From: "Gilles (Updated) (JIRA)" To: issues@commons.apache.org Message-ID: <2040577880.12104.1318120409743.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1393035663.12102.1318119929772.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (MATH-688) "FastMath" contains fractions of constants MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-688?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gilles updated MATH-688: ------------------------ 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... :) was: 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... :) > "FastMath" contains fractions of constants > ------------------------------------------ > > Key: MATH-688 > URL: https://issues.apache.org/jira/browse/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 (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... :) -- 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