File tree Expand file tree Collapse file tree 3 files changed +313
-60
lines changed
Expand file tree Collapse file tree 3 files changed +313
-60
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,
@@ -479,7 +478,27 @@ fn frexpf128_cases() -> Vec<TestCase<op::frexpf128::Routine>> {
479478}
480479
481480fn hypot_cases ( ) -> Vec < TestCase < op:: hypot:: Routine > > {
482- vec ! [ ]
481+ let mut v = vec ! [ ] ;
482+ TestCase :: append_inputs (
483+ & mut v,
484+ & [
485+ // Cases that can overflow exponent if wrapping arithmetic is not used
486+ (
487+ hf64 ! ( "-0x1.800f800f80100p+1023" ) ,
488+ hf64 ! ( "0x1.8354835473720p+996" ) ,
489+ ) ,
490+ ( hf64 ! ( "0x1.201b201b201c0p+0" ) , hf64 ! ( "0x1.b028b028b02a0p-1" ) ) ,
491+ (
492+ hf64 ! ( "-0x1.e538e538e564p+980" ) ,
493+ hf64 ! ( "-0x1.c4dfc4dfc508p+983" ) ,
494+ ) ,
495+ (
496+ hf64 ! ( "-0x1.2f22e4f77aa58p+983" ) ,
497+ hf64 ! ( "-0x1.44c9f5524c8ccp+980" ) ,
498+ ) ,
499+ ] ,
500+ ) ;
501+ v
483502}
484503
485504fn hypotf_cases ( ) -> Vec < TestCase < op:: hypotf:: Routine > > {
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
4646
4747 // Operations that aren't required to be exact, but our implementations are.
4848 Bn :: Cbrt => 0 ,
49+ Bn :: Hypot if ctx. fn_ident == Id :: Hypot => 0 ,
4950
5051 // Bessel functions have large inaccuracies.
5152 Bn :: J0 | Bn :: J1 | Bn :: Y0 | Bn :: Y1 | Bn :: Jn | Bn :: Yn => 8_000_000 ,
@@ -112,6 +113,7 @@ pub fn default_ulp(ctx: &CheckCtx) -> u32 {
112113 Id :: Fdim => ulp = 2 ,
113114 Id :: Exp2f => ulp = 1 ,
114115 Id :: Expf => ulp = 1 ,
116+ Id :: Hypot => ulp = 1 ,
115117 Id :: Sincosf => ulp = 500 ,
116118 Id :: Tgamma => ulp = 20 ,
117119 _ => ( ) ,
You can’t perform that action at this time.
0 commit comments