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

Commit f2397e5

Browse files
committed
Update precision based on failures from extensive tests
1 parent 6362d4e commit f2397e5

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

crates/libm-test/src/precision.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
5555
Bn::Asin => 1,
5656
Bn::Asinh => 2,
5757
Bn::Atan => 1,
58-
Bn::Atan2 => 1,
58+
Bn::Atan2 => 2,
5959
Bn::Atanh => 2,
6060
Bn::Cbrt => 1,
6161
Bn::Cos => 1,
@@ -187,6 +187,20 @@ impl MaybeOverride<(f32,)> for SpecialCase {
187187
return XFAIL;
188188
}
189189

190+
if (ctx.base_name == BaseName::Lgamma || ctx.base_name == BaseName::LgammaR)
191+
&& input.0 > 4e36
192+
&& expected.is_infinite()
193+
&& !actual.is_infinite()
194+
{
195+
// This result should saturate but we return a finite value.
196+
return XFAIL;
197+
}
198+
199+
if ctx.base_name == BaseName::J0 && input.0 < -1e34 {
200+
// Errors get huge close to -inf
201+
return XFAIL;
202+
}
203+
190204
maybe_check_nan_bits(actual, expected, ctx)
191205
}
192206

@@ -248,6 +262,11 @@ impl MaybeOverride<(f64,)> for SpecialCase {
248262
return XFAIL;
249263
}
250264

265+
if ctx.base_name == BaseName::J0 && input.0 < -1e300 {
266+
// Errors get huge close to -inf
267+
return XFAIL;
268+
}
269+
251270
maybe_check_nan_bits(actual, expected, ctx)
252271
}
253272

@@ -364,6 +383,7 @@ impl MaybeOverride<(i32, f32)> for SpecialCase {
364383
}
365384
}
366385
}
386+
367387
impl MaybeOverride<(i32, f64)> for SpecialCase {
368388
fn check_float<F: Float>(
369389
input: (i32, f64),

0 commit comments

Comments
 (0)