Skip to content

Commit

Permalink
Update allowed precision to account for new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Dec 22, 2024
1 parent a4cfd44 commit 445b19b
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions crates/libm-test/src/precision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
(Musl, Id::Tgamma) => 20,

// Overrides for MPFR
(Mpfr, Id::Acosh) => 4,
(Mpfr, Id::Acoshf) => 4,
(Mpfr, Id::Asinh | Id::Asinhf) => 2,
(Mpfr, Id::Atanh | Id::Atanhf) => 2,
(Mpfr, Id::Exp10 | Id::Exp10f) => 3,
(Mpfr, Id::Exp10 | Id::Exp10f) => 6,
(Mpfr, Id::Lgamma | Id::LgammaR | Id::Lgammaf | Id::LgammafR) => 16,
(Mpfr, Id::Sinh | Id::Sinhf) => 2,
(Mpfr, Id::Tanh | Id::Tanhf) => 2,
Expand Down Expand Up @@ -105,17 +106,15 @@ impl MaybeOverride<(f32,)> for SpecialCase {
_ulp: &mut u32,
ctx: &CheckCtx,
) -> Option<TestResult> {
if ctx.basis == CheckBasis::Musl {
if ctx.fn_name == "expm1f" && input.0 > 80.0 && actual.is_infinite() {
// we return infinity but the number is representable
return XFAIL;
}
if ctx.fn_name == "expm1f" && input.0 > 80.0 && actual.is_infinite() {
// we return infinity but the number is representable
return XFAIL;
}

if ctx.fn_name == "sinhf" && input.0.abs() > 80.0 && actual.is_nan() {
// we return some NaN that should be real values or infinite
// doesn't seem to happen on x86
return XFAIL;
}
if ctx.fn_name == "sinhf" && input.0.abs() > 80.0 && actual.is_nan() {
// we return some NaN that should be real values or infinite
// doesn't seem to happen on x86
return XFAIL;
}

if ctx.fn_name == "acoshf" && input.0 < -1.0 {
Expand Down

0 comments on commit 445b19b

Please sign in to comment.