https://codereview.chromium.org/465353002/diff/1/test/mjsunit/es6/math-expm1.js
File test/mjsunit/es6/math-expm1.js (right):

https://codereview.chromium.org/465353002/diff/1/test/mjsunit/es6/math-expm1.js#newcode24
test/mjsunit/es6/math-expm1.js:24: }
On 2014/08/20 14:18:24, Yang wrote:
On 2014/08/13 16:25:17, Raymond Toy wrote:
> For an additional sanity check, why not use the mathematical
property that
> expm1(n*log(2)) = exp(n*log(2)) - 1 = 2^n - 1? For simplicity, just
use
integer
> n. For bonus points allow n = m/2 for integer m.  This only requires
computing
> sqrt(2). Or perhaps Math.pow is accurate to < 1 ulp?
>
> The above sanity check would fail if exp(x) is wrong, and we know
that exp(x)
is
> (now) less accurate than expm1.

I like the suggestion. However, n*Math.LN2 is less precise than it
should be, so
I would have to use an assertEqualsDelta with expected*1E-14 as delta,
which
makes this rather pointless.

It has the great advantage that the test is independent of the
implementation of Math.exp and has analytically correct results.  Yes,
n*Math.LN2 is not quite the same as n*log(2), but that's life with
floating-point.

https://codereview.chromium.org/465353002/diff/1/third_party/fdlibm/fdlibm.js
File third_party/fdlibm/fdlibm.js (right):

https://codereview.chromium.org/465353002/diff/1/third_party/fdlibm/fdlibm.js#newcode513
third_party/fdlibm/fdlibm.js:513: (KLOG1P(4) + z * (KLOG1P(5) + z *
KLOG1P(6)))))));
On 2014/08/20 14:18:24, Yang wrote:
On 2014/08/13 16:25:17, Raymond Toy wrote:
> This seems unrelated to expm1. And I can't see what actually changed
here..

it used to be KLOGP1. I realized that it should be KLOG1P instead. I
thought I
could piggyback this small change here.

Sounds good. Sorry I missed that in the review of the log1p function.

https://codereview.chromium.org/465353002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to