\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -5.6186452759089954 \cdot 10^{+135}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\
\mathbf{elif}\;z \leq -2.5938209576510873 \cdot 10^{-191}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{elif}\;z \leq -8.151714677345732 \cdot 10^{-243}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{z}{0.5 \cdot \left(t \cdot \frac{a}{z}\right) - z}\right)\\
\mathbf{elif}\;z \leq 2.8288936700686717 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \left(z \cdot \frac{x}{\sqrt{z \cdot z - t \cdot a}}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x}{\frac{z + \left(t \cdot \frac{a}{z}\right) \cdot -0.5}{z}}\\
\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.6186452759089954e+135)
(* x (* y (/ z (- (* 0.5 (* t (/ a z))) z))))
(if (<= z -2.5938209576510873e-191)
(* x (* y (/ z (sqrt (- (* z z) (* t a))))))
(if (<= z -8.151714677345732e-243)
(* x (* y (/ z (- (* 0.5 (* t (/ a z))) z))))
(if (<= z 2.8288936700686717e+75)
(* y (* z (/ x (sqrt (- (* z z) (* t a))))))
(* y (/ x (/ (+ z (* (* t (/ a z)) -0.5)) z))))))))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.6186452759089954e+135)) {
tmp = ((double) (x * ((double) (y * (z / ((double) (((double) (0.5 * ((double) (t * (a / z))))) - z)))))));
} else {
double tmp_1;
if ((z <= -2.5938209576510873e-191)) {
tmp_1 = ((double) (x * ((double) (y * (z / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))));
} else {
double tmp_2;
if ((z <= -8.151714677345732e-243)) {
tmp_2 = ((double) (x * ((double) (y * (z / ((double) (((double) (0.5 * ((double) (t * (a / z))))) - z)))))));
} else {
double tmp_3;
if ((z <= 2.8288936700686717e+75)) {
tmp_3 = ((double) (y * ((double) (z * (x / ((double) sqrt(((double) (((double) (z * z)) - ((double) (t * a)))))))))));
} else {
tmp_3 = ((double) (y * (x / (((double) (z + ((double) (((double) (t * (a / z))) * -0.5)))) / z))));
}
tmp_2 = tmp_3;
}
tmp_1 = tmp_2;
}
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.7 |
|---|---|
| Target | 7.7 |
| Herbie | 7.0 |
if z < -5.61864527590899535e135 or -2.5938209576510873e-191 < z < -8.1517146773457319e-243Initial program Error: 44.6 bits
SimplifiedError: 43.6 bits
Taylor expanded around -inf Error: 10.0 bits
SimplifiedError: 6.2 bits
if -5.61864527590899535e135 < z < -2.5938209576510873e-191Initial program Error: 9.7 bits
SimplifiedError: 5.8 bits
if -8.1517146773457319e-243 < z < 2.8288936700686717e75Initial program Error: 11.2 bits
SimplifiedError: 10.4 bits
rmApplied add-cube-cbrtError: 11.0 bits
Applied associate-*l*Error: 11.0 bits
SimplifiedError: 10.5 bits
rmApplied pow1Error: 10.5 bits
Applied pow1Error: 10.5 bits
Applied pow-prod-downError: 10.5 bits
Applied pow1Error: 10.5 bits
Applied pow-prod-downError: 10.5 bits
Applied pow1Error: 10.5 bits
Applied pow1Error: 10.5 bits
Applied pow-prod-downError: 10.5 bits
Applied pow-prod-downError: 10.5 bits
SimplifiedError: 10.6 bits
rmApplied associate-/r/Error: 11.9 bits
if 2.8288936700686717e75 < z Initial program Error: 40.6 bits
SimplifiedError: 37.9 bits
rmApplied add-cube-cbrtError: 38.2 bits
Applied associate-*l*Error: 38.2 bits
SimplifiedError: 38.2 bits
rmApplied pow1Error: 38.2 bits
Applied pow1Error: 38.2 bits
Applied pow-prod-downError: 38.2 bits
Applied pow1Error: 38.2 bits
Applied pow-prod-downError: 38.2 bits
Applied pow1Error: 38.2 bits
Applied pow1Error: 38.2 bits
Applied pow-prod-downError: 38.2 bits
Applied pow-prod-downError: 38.2 bits
SimplifiedError: 37.9 bits
Taylor expanded around inf Error: 5.6 bits
SimplifiedError: 2.7 bits
Final simplificationError: 7.0 bits
herbie shell --seed 2020203
(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)))))