You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2011/05/18 11:48:24 UTC
svn commit: r1124151 - in /commons/proper/math/trunk/src:
main/java/org/apache/commons/math/util/FastMath.java site/xdoc/changes.xml
Author: luc
Date: Wed May 18 09:48:24 2011
New Revision: 1124151
URL: http://svn.apache.org/viewvc?rev=1124151&view=rev
Log:
improved javadoc for FastMath.
JIRA: MATH-579
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java
commons/proper/math/trunk/src/site/xdoc/changes.xml
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java?rev=1124151&r1=1124150&r2=1124151&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/FastMath.java Wed May 18 09:48:24 2011
@@ -17,7 +17,30 @@
package org.apache.commons.math.util;
/**
- * Faster, more accurate, portable alternative to {@link StrictMath}.
+ * Faster, more accurate, portable alternative to {@link StrictMath}
+ * for large scale computation.
+ * <p>
+ * FastMath speed is achieved by relying heavily on optimizing compilers
+ * to native code present in many JVM todays and use of large tables that
+ * are computed once at class loading (regardless of the number of subsequent
+ * calls to computation methods). This implies that FastMath is targeted
+ * more towards large scale computation (i.e. computation that take at least
+ * a handful of seconds to complete) on desktop or server machines rather
+ * than very small utilities on devices with limited power (i.e. computation
+ * that should return a result almost instantly). Note that FastMath is
+ * extensively used inside Apache Commons Math, so by calling some algorithms,
+ * the one-shot overhead will occur regardless of the end-user calling FastMath
+ * methods directly or not.
+ * <p>
+ * <p>
+ * FastMath accuracy should be mostly independent of the JVM as it relies only
+ * on IEEE-754 basic operations and on embedded tables. Almost all operations
+ * are accurate to about 0.5 ulp throughout the domain range. This statement,
+ * of course is only a rough global observed behavior, it is <em>not</em> a
+ * guarantee for <em>every</em> double numbers input (see William Kahan's <a
+ * href="http://en.wikipedia.org/wiki/Rounding#The_table-maker.27s_dilemma">Table
+ * Maker's Dilemma</a>).
+ * </p>
* <p>
* Additionally implements the following methods not found in StrictMath:
* <ul>
Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=1124151&r1=1124150&r2=1124151&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/changes.xml Wed May 18 09:48:24 2011
@@ -52,6 +52,10 @@ The <action> type attribute can be add,u
If the output is not quite correct, check for invisible trailing spaces!
-->
<release version="3.0" date="TBD" description="TBD">
+ <action dev="luc" type="fix" issue="MATH-579">
+ Improved javadoc for FastMath explaining the overhead at class loading and
+ the targeted use cases.
+ </action>
<action dev="erans" type="fix" issue="MATH-574">
Allow outer product of vectors of different sizes.
</action>
Re: svn commit: r1124151 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/util/FastMath.java
site/xdoc/changes.xml
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 18/05/2011 12:52, Gilles Sadowski a écrit :
> On Wed, May 18, 2011 at 11:18:22AM +0100, sebb wrote:
>> On 18 May 2011 10:48,<lu...@apache.org> wrote:
>>> Author: luc
>>> Date: Wed May 18 09:48:24 2011
>>> New Revision: 1124151
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1124151&view=rev
>>> Log:
>>> improved javadoc for FastMath.
>>
>> +1, very clear and helpful.
>
> I'd add
> ---
> [...] portable alternative to {@link Math} and {@link StrictMath}
> ^^^^^^^^^^^^
> ---
> and a link to the performance test class, as suggested in my last comment
> (which was written while you were updating the docs).
I should be done now, thanks for the suggestions.
Luc
>
>
> Regards,
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1124151 - in /commons/proper/math/trunk/src:
main/java/org/apache/commons/math/util/FastMath.java site/xdoc/changes.xml
Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
On Wed, May 18, 2011 at 11:18:22AM +0100, sebb wrote:
> On 18 May 2011 10:48, <lu...@apache.org> wrote:
> > Author: luc
> > Date: Wed May 18 09:48:24 2011
> > New Revision: 1124151
> >
> > URL: http://svn.apache.org/viewvc?rev=1124151&view=rev
> > Log:
> > improved javadoc for FastMath.
>
> +1, very clear and helpful.
I'd add
---
[...] portable alternative to {@link Math} and {@link StrictMath}
^^^^^^^^^^^^
---
and a link to the performance test class, as suggested in my last comment
(which was written while you were updating the docs).
Regards,
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r1124151 - in /commons/proper/math/trunk/src:
main/java/org/apache/commons/math/util/FastMath.java site/xdoc/changes.xml
Posted by sebb <se...@gmail.com>.
On 18 May 2011 10:48, <lu...@apache.org> wrote:
> Author: luc
> Date: Wed May 18 09:48:24 2011
> New Revision: 1124151
>
> URL: http://svn.apache.org/viewvc?rev=1124151&view=rev
> Log:
> improved javadoc for FastMath.
+1, very clear and helpful.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org