\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -5.342208561463816 \cdot 10^{+77}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\
\mathbf{elif}\;z \leq 1.860229807699452 \cdot 10^{+118}:\\
\;\;\;\;x \cdot \left(\frac{\sqrt[3]{z}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}} \cdot \left(y \cdot \left(\sqrt[3]{z} \cdot \frac{\sqrt[3]{z}}{\sqrt{\sqrt{z \cdot z - t \cdot a}}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x \cdot \frac{z}{z + \left(t \cdot \frac{a}{z}\right) \cdot -0.5}\right)\\
\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 -5.342208561463816e+77)
(* x (* y (/ z (- (* 0.5 (* t (/ a z))) z))))
(if (<= z 1.860229807699452e+118)
(*
x
(*
(/ (cbrt z) (sqrt (sqrt (- (* z z) (* t a)))))
(* y (* (cbrt z) (/ (cbrt z) (sqrt (sqrt (- (* z z) (* t a)))))))))
(* y (* x (/ z (+ z (* (* t (/ a z)) -0.5))))))))double code(double x, double y, double z, double t, double a) {
return (((double) (((double) (x * y)) * z)) / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.342208561463816e+77)) {
tmp = ((double) (x * ((double) (y * (z / ((double) (((double) (0.5 * ((double) (t * (a / z))))) - z)))))));
} else {
double tmp_1;
if ((z <= 1.860229807699452e+118)) {
tmp_1 = ((double) (x * ((double) ((((double) cbrt(z)) / ((double) sqrt(((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a))))))))) * ((double) (y * ((double) (((double) cbrt(z)) * (((double) cbrt(z)) / ((double) sqrt(((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))))))))));
} else {
tmp_1 = ((double) (y * ((double) (x * (z / ((double) (z + ((double) (((double) (t * (a / z))) * -0.5)))))))));
}
tmp = tmp_1;
}
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.1 |
|---|---|
| Target | 7.6 |
| Herbie | 6.3 |
if z < -5.34220856146381615e77Initial program Error: 40.0 bits
SimplifiedError: 37.7 bits
Taylor expanded around -inf Error: 5.7 bits
SimplifiedError: 2.4 bits
if -5.34220856146381615e77 < z < 1.860229807699452e118Initial program Error: 10.7 bits
SimplifiedError: 9.1 bits
rmApplied add-sqr-sqrtError: 9.1 bits
Applied sqrt-prodError: 9.4 bits
Applied add-cube-cbrtError: 9.9 bits
Applied times-fracError: 9.9 bits
Applied associate-*r*Error: 9.3 bits
SimplifiedError: 9.3 bits
if 1.860229807699452e118 < z Initial program Error: 46.1 bits
SimplifiedError: 44.1 bits
rmApplied pow1Error: 44.1 bits
Applied pow1Error: 44.1 bits
Applied pow-prod-downError: 44.1 bits
Applied pow1Error: 44.1 bits
Applied pow-prod-downError: 44.1 bits
SimplifiedError: 44.1 bits
Taylor expanded around inf Error: 5.8 bits
SimplifiedError: 1.5 bits
Final simplificationError: 6.3 bits
herbie shell --seed 2020204
(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)))))