Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit ff15e46

Browse files
committed
Increase the precision for jn and jnf
New random seeds seem to indicate that this test does have some more failures, this is a recent failure on i586: ---- musl_random_jnf stdout ---- Random Musl jnf arg 1/2: 100 iterations (10000 total) using `LIBM_SEED=nLfzQ3U1OBVvqWaMBcto84UTMsC5FIaC` Random Musl jnf arg 2/2: 100 iterations (10000 total) using `LIBM_SEED=nLfzQ3U1OBVvqWaMBcto84UTMsC5FIaC` thread 'musl_random_jnf' panicked at crates/libm-test/tests/compare_built_musl.rs:43:51: called `Result::unwrap()` on an `Err` value: input: (205, 5497.891) (0x000000cd, 0x45abcf21) expected: 7.3291517e-6 0x36f5ecef actual: 7.331668e-6 0x36f6028c Caused by: ulp 5533 > 4000 It seems unlikely that `jn` would somehow have better precision than `j0`/`j1`, so just use the same precision.
1 parent e690971 commit ff15e46

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/libm-test/src/precision.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
4747
Bn::Tgamma if ctx.fn_ident != Id::Tgamma => 0,
4848

4949
// Bessel functions have large inaccuracies.
50-
Bn::J0 | Bn::J1 | Bn::Y0 | Bn::Y1 => 8_000_000,
51-
Bn::Jn | Bn::Yn => 1_000,
50+
Bn::J0 | Bn::J1 | Bn::Y0 | Bn::Y1 | Bn::Jn | Bn::Yn => 8_000_000,
5251

5352
// For all other operations, specify our implementation's worst case precision.
5453
Bn::Acos => 1,
@@ -96,7 +95,6 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
9695
match ctx.fn_ident {
9796
// FIXME(#401): musl has an incorrect result here.
9897
Id::Fdim => ulp = 2,
99-
Id::Jnf | Id::Ynf => ulp = 4000,
10098
Id::Sincosf => ulp = 500,
10199
Id::Tgamma => ulp = 20,
102100
_ => (),

0 commit comments

Comments
 (0)