\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -3.308504810282927 \cdot 10^{+151}:\\
\;\;\;\;-x \cdot y\\
\mathbf{elif}\;z \leq 1.7098713886106964 \cdot 10^{+148}:\\
\;\;\;\;x \cdot \frac{y}{\frac{\sqrt{z \cdot z - t \cdot a}}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}(FPCore (x y z t a) :precision binary64 (/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.308504810282927e+151)
(- (* x y))
(if (<= z 1.7098713886106964e+148)
(* x (/ y (/ (sqrt (- (* z z) (* t a))) z)))
(* x y))))double code(double x, double y, double z, double t, double a) {
return ((x * y) * z) / sqrt((z * z) - (t * a));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.308504810282927e+151) {
tmp = -(x * y);
} else if (z <= 1.7098713886106964e+148) {
tmp = x * (y / (sqrt((z * z) - (t * a)) / z));
} else {
tmp = x * y;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.4 |
|---|---|
| Target | 7.4 |
| Herbie | 6.1 |
if z < -3.3085048102829273e151Initial program 52.2
Taylor expanded around -inf 1.5
Simplified1.5
if -3.3085048102829273e151 < z < 1.70987138861069639e148Initial program 11.2
rmApplied associate-/l*_binary64_105948.5
rmApplied *-un-lft-identity_binary64_106498.5
Applied *-un-lft-identity_binary64_106498.5
Applied sqrt-prod_binary64_106658.5
Applied times-frac_binary64_106558.5
Applied times-frac_binary64_106558.3
Simplified8.3
if 1.70987138861069639e148 < z Initial program 51.8
Taylor expanded around inf 1.2
Final simplification6.1
herbie shell --seed 2021045
(FPCore (x y z t a)
:name "Statistics.Math.RootFinding:ridders from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z -3.1921305903852764e+46) (- (* y x)) (if (< z 5.976268120920894e+90) (/ (* x z) (/ (sqrt (- (* z z) (* a t))) y)) (* y x)))
(/ (* (* x y) z) (sqrt (- (* z z) (* t a)))))