Backed out changeset 3e5a91d06168 (bug 933257)

This commit is contained in:
Tooru Fujisawa 2016-03-15 08:15:08 +09:00
Родитель b5c103f167
Коммит 0ae35aa9f0
8 изменённых файлов: 36 добавлений и 24 удалений

Просмотреть файл

@ -262,7 +262,7 @@ var cosh_data = [
[1875817529344, 28.953212876533797]
];
var sloppy_tolerance = 8; // FIXME
var sloppy_tolerance = 1000; // FIXME
for (var [x, y] of cosh_data)
assertNear(Math.acosh(x), y, sloppy_tolerance);

Просмотреть файл

@ -282,22 +282,24 @@ var sinh_data = [
[1581915832320, 28.78280496108106]
];
for (var [x, y] of sinh_data)
assertNear(Math.asinh(x), y);
var sloppy_tolerance = 1000; // FIXME
assertNear(Math.asinh(1e300), 691.4686750787737);
assertNear(Math.asinh(1e-300), 1e-300);
assertNear(Math.asinh(1e-5), 0.000009999999999833334);
assertNear(Math.asinh(0.3), 0.29567304756342244);
assertNear(Math.asinh(1), 0.881373587019543);
for (var [x, y] of sinh_data)
assertNear(Math.asinh(x), y, sloppy_tolerance);
assertNear(Math.asinh(1e300), 691.4686750787737, sloppy_tolerance);
assertNear(Math.asinh(1e-300), 1e-300, sloppy_tolerance);
assertNear(Math.asinh(1e-5), 0.000009999999999833334, sloppy_tolerance);
assertNear(Math.asinh(0.3), 0.29567304756342244, sloppy_tolerance);
assertNear(Math.asinh(1), 0.881373587019543, sloppy_tolerance);
for (var i = 0; i <= 80; i++) {
var x = (i - 40) / 4;
assertNear(Math.asinh(Math.sinh(x)), x);
assertNear(Math.asinh(Math.sinh(x)), x, sloppy_tolerance);
}
for (var i = -20; i < 20; i++)
assertNear(Math.asinh(Math.sinh(i)), i);
assertNear(Math.asinh(Math.sinh(i)), i, sloppy_tolerance);
reportCompare(0, 0, "ok");

Просмотреть файл

@ -266,7 +266,7 @@ var tanh_data = [
[1e-10, 1e-10],
];
var sloppy_tolerance = 2; // FIXME
var sloppy_tolerance = 10; // FIXME
for (var [x, y] of tanh_data)
assertNear(Math.atanh(x), y, sloppy_tolerance);

Просмотреть файл

@ -1,8 +1,10 @@
assertEq(Math.cbrt(1), 1);
assertEq(Math.cbrt(-1), -1);
assertNear(Math.cbrt(1e-300), 1e-100);
assertNear(Math.cbrt(-1e-300), -1e-100);
var sloppy_tolerance = 200; // FIXME
assertNear(Math.cbrt(1e-300), 1e-100, sloppy_tolerance);
assertNear(Math.cbrt(-1e-300), -1e-100, sloppy_tolerance);
var cbrt_data = [
[ Math.E, 1.3956124250860895 ],
@ -12,6 +14,6 @@ var cbrt_data = [
];
for (var [x, y] of cbrt_data)
assertNear(Math.cbrt(x), y);
assertNear(Math.cbrt(x), y, sloppy_tolerance);
reportCompare(0, 0, "ok");

Просмотреть файл

@ -1,7 +1,9 @@
var sloppy_tolerance = 100;
assertEq(Math.cosh(1000), Infinity);
assertEq(Math.cosh(Number.MAX_VALUE), Infinity);
assertNear(Math.cosh(1e-30), 1);
assertNear(Math.cosh(1e-10), 1);
assertNear(Math.cosh(1e-30), 1, sloppy_tolerance);
assertNear(Math.cosh(1e-10), 1, sloppy_tolerance);
var cosh_data = [
[0.0016914556651292944, 1.0000014305114746],
@ -268,9 +270,9 @@ var cosh_data = [
];
for (var [x, y] of cosh_data)
assertNear(Math.cosh(x), y);
assertNear(Math.cosh(x), y, sloppy_tolerance);
for (var i = -20; i < 20; i++)
assertNear(Math.cosh(i), (Math.exp(i) + Math.exp(-i)) / 2);
assertNear(Math.cosh(i), (Math.exp(i) + Math.exp(-i)) / 2, sloppy_tolerance);
reportCompare(0, 0, "ok");

Просмотреть файл

@ -2,8 +2,13 @@ assertNear(Math.log10(2), 0.3010299956639812);
assertNear(Math.log10(7), 0.8450980400142568);
assertNear(Math.log10(Math.E), Math.LOG10E);
// FIXME
// On Mac OS X 10.7 32bit build, Math.log10(0.01) returns bfffffff fffffffe.
// See bug 1225024.
var sloppy_tolerance = 2;
for (var i = -10; i < 10; i++)
assertNear(Math.log10(Math.pow(10, i)), i);
assertNear(Math.log10(Math.pow(10, i)), i, sloppy_tolerance);
reportCompare(0, 0, 'ok');

Просмотреть файл

@ -1,10 +1,11 @@
var sloppy_tolerance = 100;
for (var i = -20; i < 20; i++)
assertNear(Math.sinh(i), (Math.exp(i) - Math.exp(-i)) / 2);
assertNear(Math.sinh(i), (Math.exp(i) - Math.exp(-i)) / 2, sloppy_tolerance);
assertEq(Math.sinh(1000), Infinity);
assertEq(Math.sinh(Number.MAX_VALUE), Infinity);
assertNear(Math.sinh(1e-30), 1e-30);
assertNear(Math.sinh(1e-10), 1e-10);
assertNear(Math.sinh(1e-30), 1e-30, sloppy_tolerance);
assertNear(Math.sinh(1e-10), 1e-10, sloppy_tolerance);
var sinh_data = [
[-6.902103625349695, -497.1816406250001],
@ -291,7 +292,7 @@ var sinh_data = [
];
for (var [x, y] of sinh_data)
assertNear(Math.sinh(x), y);
assertNear(Math.sinh(x), y, sloppy_tolerance);
reportCompare(0, 0, "ok");

Просмотреть файл

@ -1,4 +1,4 @@
var sloppy_tolerance = 2;
var sloppy_tolerance = 4;
for (var i = -20; i < 20; i++) {
assertNear(Math.tanh(i),