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

Commit bcbe269

Browse files
committed
Update precision based on failures from extensive tests
1 parent 8d03248 commit bcbe269

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

crates/libm-test/src/precision.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
2626
// Overrides that apply to either basis
2727
(_, Id::J0 | Id::J0f | Id::J1 | Id::J1f) => {
2828
// Results seem very target-dependent
29-
if cfg!(target_arch = "x86_64") { 4000 } else { 800_000 }
29+
if cfg!(target_arch = "x86_64") { 40_000 } else { 800_000 }
3030
}
3131
(_, Id::Jn | Id::Jnf) => 1000,
3232

@@ -45,6 +45,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
4545
(Mpfr, Id::Acoshf) => 4,
4646
(Mpfr, Id::Asinh | Id::Asinhf) => 2,
4747
(Mpfr, Id::Atanh | Id::Atanhf) => 2,
48+
(Mpfr, Id::Atan2) => 2,
4849
(Mpfr, Id::Exp10 | Id::Exp10f) => 6,
4950
(Mpfr, Id::Lgamma | Id::LgammaR | Id::Lgammaf | Id::LgammafR) => 16,
5051
(Mpfr, Id::Sinh | Id::Sinhf) => 2,
@@ -128,6 +129,16 @@ impl MaybeOverride<(f32,)> for SpecialCase {
128129
return XFAIL;
129130
}
130131

132+
if ctx.fn_name == "lgammaf"
133+
|| ctx.fn_name == "lgammaf_r"
134+
&& input.0 > 4e36
135+
&& expected.is_infinite()
136+
&& !actual.is_infinite()
137+
{
138+
// This result should saturate but we return a finite value.
139+
return XFAIL;
140+
}
141+
131142
maybe_check_nan_bits(actual, expected, ctx)
132143
}
133144

@@ -305,6 +316,7 @@ impl MaybeOverride<(i32, f32)> for SpecialCase {
305316
}
306317
}
307318
}
319+
308320
impl MaybeOverride<(i32, f64)> for SpecialCase {
309321
fn check_float<F: Float>(
310322
input: (i32, f64),

0 commit comments

Comments
 (0)