Skip to content

Commit ac3ff8c

Browse files
committed
Update precision based on new test results
1 parent addbb18 commit ac3ff8c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

crates/libm-test/src/precision.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,24 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
9090
Bn::Exp10 if usize::BITS < 64 => ulp = 4,
9191
Bn::Lgamma | Bn::LgammaR => ulp = 400,
9292
Bn::Tanh => ulp = 4,
93-
_ if ctx.fn_ident == Id::Sincosf => ulp = 500,
94-
_ if ctx.fn_ident == Id::Tgamma => ulp = 20,
93+
_ => (),
94+
}
95+
96+
match ctx.fn_ident {
97+
// FIXME(#401): musl has an incorrect result here.
98+
Id::Fdim => ulp = 2,
99+
Id::Jnf | Id::Ynf => ulp = 4000,
100+
Id::Sincosf => ulp = 500,
101+
Id::Tgamma => ulp = 20,
95102
_ => (),
96103
}
97104
}
98105

99106
// In some cases, our implementation is less accurate than musl on i586.
100107
if cfg!(x86_no_sse) {
101108
match ctx.fn_ident {
109+
Id::Asinh => ulp = 3,
110+
Id::Asinhf => ulp = 3,
102111
Id::Log1p | Id::Log1pf => ulp = 2,
103112
Id::Round => ulp = 1,
104113
Id::Tan => ulp = 2,

0 commit comments

Comments
 (0)