AD in ill-conditioned z/√(s²+z²) without custom rules
Julia Programming Language
AD in ill-conditioned z/√(s²+z²) without custom rules
I would like to implement a z/sqrt(s^2+z^2) that works for when z and s have wildly different magnitudes, but are both finite, also gives the correct result when AD’s via the most common frameworks. I would prefer to avoid writing custom rules if possible. This part makes the exercise tricky. Here is an MWE of failures using Enzyme as a demo because it traps NaNs. I would appreciate suggestions on how to do this. Or maybe someone convincing me that this is not possible without custom rules. ...
0 comments
No comments yet.