File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -235,9 +235,9 @@ def _(expr, lang):
235235
236236@_lower_macro_math .register (SafeInv )
237237def _ (expr , lang ):
238- eps = np .finfo (np . float32 ).resolution ** 2
238+ eps = 2 * np .finfo (expr . base . dtype ).resolution ** 2
239239 return (('SAFEINV(a, b)' ,
240- f'(((a) < { eps } || ( b) < { eps } ) ? (0.0F) : (1.0F / (a)))' ),), {}
240+ f'(((a + b) < { eps } F ) ? (0.0F) : (( 1.0F) / (a)))' ),), {}
241241
242242
243243@iet_pass
Original file line number Diff line number Diff line change 1313limits_mapper = {
1414 np .int32 : Bunch (min = ValueLimit ('INT_MIN' ), max = ValueLimit ('INT_MAX' )),
1515 np .int64 : Bunch (min = ValueLimit ('LONG_MIN' ), max = ValueLimit ('LONG_MAX' )),
16- np .float32 : Bunch (min = - ValueLimit ('FLT_MAX ' ), max = ValueLimit ('FLT_MAX' )),
17- np .float64 : Bunch (min = - ValueLimit ('DBL_MAX ' ), max = ValueLimit ('DBL_MAX' )),
16+ np .float32 : Bunch (min = - ValueLimit ('FLT_MIN ' ), max = ValueLimit ('FLT_MAX' )),
17+ np .float64 : Bunch (min = - ValueLimit ('DBL_MIN ' ), max = ValueLimit ('DBL_MAX' )),
1818}
1919
2020
You can’t perform that action at this time.
0 commit comments