Skip to content

Commit de45e6a

Browse files
quaternictgross35
authored andcommitted
fix testing at lgammaf overflow threshold
The current implementation of lgammaf evaluates to f32::MAX at the first input that would overflow if correctly rounded. This is still well within allowed error, so special case it.
1 parent 4659690 commit de45e6a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

libm-test/src/precision.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ impl MaybeOverride<(f32,)> for SpecialCase {
222222
return XFAIL_NOCHECK;
223223
}
224224

225+
// the testing infrastructure doesn't account for allowed ulp in the case of overflow
226+
if matches!(ctx.base_name, BaseName::Lgamma | BaseName::LgammaR)
227+
&& input.0 == 4.0850034e36
228+
&& expected.is_infinite()
229+
&& actual == F::MAX
230+
{
231+
return XFAIL_NOCHECK;
232+
}
233+
225234
// FIXME(correctness): lgammaf has high relative inaccuracy near its zeroes
226235
if matches!(ctx.base_name, BaseName::Lgamma | BaseName::LgammaR)
227236
&& input.0 > -13.0625

0 commit comments

Comments
 (0)