Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions libm-test/src/precision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,27 +218,6 @@ impl MaybeOverride<(f16,)> for SpecialCase {}

impl MaybeOverride<(f32,)> for SpecialCase {
fn check_float<F: Float>(input: (f32,), actual: F, expected: F, ctx: &CheckCtx) -> CheckAction {
if ctx.base_name == BaseName::Expm1
&& !input.0.is_infinite()
&& input.0 > 80.0
&& actual.is_infinite()
&& !expected.is_infinite()
{
// we return infinity but the number is representable
if ctx.basis == CheckBasis::Musl {
return XFAIL_NOCHECK;
}
return XFAIL("expm1 representable numbers");
}

if ctx.base_name == BaseName::Sinh && input.0.abs() > 80.0 && actual.is_nan() {
// we return some NaN that should be real values or infinite
if ctx.basis == CheckBasis::Musl {
return XFAIL_NOCHECK;
}
return XFAIL("sinh unexpected NaN");
}

if (ctx.base_name == BaseName::Lgamma || ctx.base_name == BaseName::LgammaR)
&& input.0 > 4e36
&& expected.is_infinite()
Expand Down
4 changes: 2 additions & 2 deletions libm/src/math/expm1f.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* ====================================================
*/

const O_THRESHOLD: f32 = 8.8721679688e+01; /* 0x42b17180 */
const LN2_HI: f32 = 6.9313812256e-01; /* 0x3f317180 */
const LN2_LO: f32 = 9.0580006145e-06; /* 0x3717f7d1 */
const INV_LN2: f32 = 1.4426950216e+00; /* 0x3fb8aa3b */
Expand Down Expand Up @@ -50,7 +49,8 @@ pub fn expm1f(mut x: f32) -> f32 {
if sign {
return -1.;
}
if x > O_THRESHOLD {
if hx > 0x42b17217 {
/* x > log(FLT_MAX) */
x *= x1p127;
return x;
}
Expand Down
Loading