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

Commit 9899d00

Browse files
committed
Increase the allowed ULP for tgammaf
Extensive tests report that the precision isn't actually 0: ---- mp_extensive_tgammaf ---- input: (-0.00063536887,) (0xba268ee2,) expected: -1574.4668 0xc4c4cef0 actual: -1574.4667 0xc4c4ceef Caused by: ulp 1 > 0 Update ULP to reflect this. After this change, `tgammaf` extensive tests pass.
1 parent a498d47 commit 9899d00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libm/crates/libm-test/src/precision.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
4444

4545
// Operations that aren't required to be exact, but our implementations are.
4646
Bn::Cbrt if ctx.fn_ident != Id::Cbrt => 0,
47-
Bn::Tgamma if ctx.fn_ident != Id::Tgamma => 0,
4847

4948
// Bessel functions have large inaccuracies.
5049
Bn::J0 | Bn::J1 | Bn::Y0 | Bn::Y1 | Bn::Jn | Bn::Yn => 8_000_000,
@@ -78,6 +77,8 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
7877
Bn::Sinh => 2,
7978
Bn::Tan => 1,
8079
Bn::Tanh => 2,
80+
// tgammaf has higher accuracy than tgamma.
81+
Bn::Tgamma if ctx.fn_ident != Id::Tgamma => 1,
8182
Bn::Tgamma => 20,
8283
};
8384

0 commit comments

Comments
 (0)