Increase the tolerance of approx acos and cbrt tests

On engines which pass through these functions to the libc library they can
return slightly different values depending on the OS and archictures.

Showing a few example with Python, which also passes these through to libc on a
few platforms I have access to:

Ubuntu Noble, Python 12, s390x
```
>>> import math

>>> math.cbrt(math.e)
1.3956124250860897

>>> math.acosh(math.cosh(0.2))
0.20000000000000023
```

Ubuntu Noble, Python 12, x86_64
```
>>> import math

>>> math.cbrt(math.e)
1.39561242508609

>>> math.acosh(math.cosh(0.2))
0.20000000000000023
```

MacOS 14, Python 12, x86_64
```
>>> import math

>>> math.cbrt(math.e)
1.3956124250860895

>>> math.acosh(math.cosh(0.2))
0.20000000000000026
```
This commit is contained in:
Nick Vatamaniuc 2025-05-15 22:30:17 -04:00 committed by Ms2ger
parent 2472953ec1
commit c6251c64b1
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -22,6 +22,8 @@ var cbrt_data = [
[ Math.SQRT2, 1.1224620483093728 ]
];
for (var [x, y] of cbrt_data)
assertNear(Math.cbrt(x), y);
var sloppy_tolerance = 3;
for (var [x, y] of cbrt_data)
assertNear(Math.cbrt(x), y, sloppy_tolerance);