File tree Expand file tree Collapse file tree 4 files changed +310
-61
lines changed Expand file tree Collapse file tree 4 files changed +310
-61
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ pub struct TestCase<Op: MathOp> {
1818}
1919
2020impl < Op : MathOp > TestCase < Op > {
21- #[ expect( dead_code) ]
2221 fn append_inputs ( v : & mut Vec < Self > , l : & [ Op :: RustArgs ] ) {
2322 v. extend ( l. iter ( ) . copied ( ) . map ( |input| Self {
2423 input,
@@ -458,7 +457,18 @@ fn frexpf_cases() -> Vec<TestCase<op::frexpf::Routine>> {
458457}
459458
460459fn hypot_cases ( ) -> Vec < TestCase < op:: hypot:: Routine > > {
461- vec ! [ ]
460+ let mut v = vec ! [ ] ;
461+ TestCase :: append_inputs (
462+ & mut v,
463+ & [
464+ // Cases that can overflow exponent if wrapping arithmetic is not used
465+ ( hf64 ! ( "-0x1.800f800f80100p+1023" ) , hf64 ! ( "0x1.8354835473720p+996" ) ) ,
466+ ( hf64 ! ( "0x1.201b201b201c0p+0" ) , hf64 ! ( "0x1.b028b028b02a0p-1" ) ) ,
467+ ( hf64 ! ( "-0x1.e538e538e564p+980" ) , hf64 ! ( "-0x1.c4dfc4dfc508p+983" ) ) ,
468+ ( hf64 ! ( "-0x1.2f22e4f77aa58p+983" ) , hf64 ! ( "-0x1.44c9f5524c8ccp+980" ) ) ,
469+ ] ,
470+ ) ;
471+ v
462472}
463473
464474fn hypotf_cases ( ) -> Vec < TestCase < op:: hypotf:: Routine > > {
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
4848
4949 // Operations that aren't required to be exact, but our implementations are.
5050 Bn :: Cbrt => 0 ,
51+ Bn :: Hypot if ctx. fn_ident == Id :: Hypot => 0 ,
5152
5253 // Bessel functions have large inaccuracies.
5354 Bn :: J0 | Bn :: J1 | Bn :: Y0 | Bn :: Y1 | Bn :: Jn | Bn :: Yn => 8_000_000 ,
@@ -100,6 +101,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
100101 Id :: Cbrt => ulp = 2 ,
101102 // FIXME(#401): musl has an incorrect result here.
102103 Id :: Fdim => ulp = 2 ,
104+ Id :: Hypot => ulp = 1 ,
103105 Id :: Sincosf => ulp = 500 ,
104106 Id :: Tgamma => ulp = 20 ,
105107 _ => ( ) ,
Original file line number Diff line number Diff line change 88) ]
99#![ cfg_attr( f128_enabled, feature( f128) ) ]
1010#![ cfg_attr( f16_enabled, feature( f16) ) ]
11+ #![ allow( internal_features) ]
1112#![ allow( clippy:: assign_op_pattern) ]
1213#![ allow( clippy:: deprecated_cfg_attr) ]
1314#![ allow( clippy:: eq_op) ]
You can’t perform that action at this time.
0 commit comments