\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -1.0298295872319982 \cdot 10^{+88}:\\
\;\;\;\;-x \cdot y\\
\mathbf{elif}\;z \leq 8.356197534345669 \cdot 10^{+147}:\\
\;\;\;\;\frac{x \cdot 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 -1.0298295872319982e+88)
(- (* x y))
(if (<= z 8.356197534345669e+147)
(/ (* 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 <= -1.0298295872319982e+88) {
tmp = -(x * y);
} else if (z <= 8.356197534345669e+147) {
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.7 |
|---|---|
| Target | 7.9 |
| Herbie | 6.5 |
if z < -1.0298295872319982e88Initial program 42.6
Taylor expanded around -inf 2.8
Simplified2.8
if -1.0298295872319982e88 < z < 8.3561975343456687e147Initial program 10.8
rmApplied associate-/l*_binary64_102539.2
if 8.3561975343456687e147 < z Initial program 52.2
Taylor expanded around inf 1.6
Final simplification6.5
herbie shell --seed 2020355
(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)))))