js/src/tests/ecma_6/Math/log1p-approx.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 assertNear(Math.log1p(1e-300), 1e-300);
michael@0 2 assertNear(Math.log1p(1e-15), 9.999999999999995e-16);
michael@0 3 assertNear(Math.log1p(1e-6), 9.999995000003334e-7);
michael@0 4
michael@0 5 var log1p_data = [
michael@0 6 [ 1.875817529344e-70, 1.875817529344e-70 ],
michael@0 7 [ 6.261923313140869e-30, 6.261923313140869e-30 ],
michael@0 8 [ 7.09962844069878e-15, 7.099628440698755e-15 ],
michael@0 9 [ 1.3671879628418538e-12, 1.3671879628409192e-12 ],
michael@0 10 [ 2.114990849122478e-10, 2.1149908488988187e-10 ],
michael@0 11 [ 1.6900931765206906e-8, 1.690093162238616e-8 ],
michael@0 12 [ 0.0000709962844069878, 0.00007099376429006658 ],
michael@0 13 [ 0.0016793412882520897, 0.00167793277137076 ],
michael@0 14 [ 0.011404608812881634, 0.011340066517988035 ],
michael@0 15 ];
michael@0 16
michael@0 17 for (var [x, y] of log1p_data)
michael@0 18 assertNear(Math.log1p(x), y);
michael@0 19
michael@0 20 reportCompare(0, 0, "ok");

mercurial