\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}\begin{array}{l}
\mathbf{if}\;z \leq -2.705239368116784 \cdot 10^{+72}:\\
\;\;\;\;-x \cdot y\\
\mathbf{elif}\;z \leq 7.0143619415122286 \cdot 10^{-304}:\\
\;\;\;\;\left(z \cdot \left(x \cdot y\right)\right) \cdot \frac{1}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{elif}\;z \leq 2.8243032036053995 \cdot 10^{+60}:\\
\;\;\;\;x \cdot \left(\left(y \cdot \frac{\sqrt{z}}{\sqrt{\sqrt[3]{z \cdot z - t \cdot a}}}\right) \cdot \frac{\sqrt{z}}{\left|\sqrt[3]{z \cdot z - t \cdot a}\right|}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{z}{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 -2.705239368116784e+72)
(- (* x y))
(if (<= z 7.0143619415122286e-304)
(* (* z (* x y)) (/ 1.0 (sqrt (- (* z z) (* t a)))))
(if (<= z 2.8243032036053995e+60)
(*
x
(*
(* y (/ (sqrt z) (sqrt (cbrt (- (* z z) (* t a))))))
(/ (sqrt z) (fabs (cbrt (- (* z z) (* t a)))))))
(* (* x y) (/ z z))))))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 <= -2.705239368116784e+72) {
tmp = -(x * y);
} else if (z <= 7.0143619415122286e-304) {
tmp = (z * (x * y)) * (1.0 / sqrt((z * z) - (t * a)));
} else if (z <= 2.8243032036053995e+60) {
tmp = x * ((y * (sqrt(z) / sqrt(cbrt((z * z) - (t * a))))) * (sqrt(z) / fabs(cbrt((z * z) - (t * a)))));
} else {
tmp = (x * y) * (z / z);
}
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 | 8.0 |
| Herbie | 7.1 |
if z < -2.705239368116784e72Initial program 40.5
Taylor expanded around -inf 2.8
if -2.705239368116784e72 < z < 7.01436194151222859e-304Initial program 11.5
rmApplied div-inv_binary64_791811.5
if 7.01436194151222859e-304 < z < 2.82430320360539952e60Initial program 11.5
rmApplied *-un-lft-identity_binary64_792111.5
Applied sqrt-prod_binary64_793711.5
Applied times-frac_binary64_792710.6
Simplified10.6
rmApplied add-cube-cbrt_binary64_795611.0
Applied sqrt-prod_binary64_793711.0
Applied add-cube-cbrt_binary64_795611.3
Applied times-frac_binary64_792711.3
Simplified11.3
rmApplied associate-*l*_binary64_786210.3
Simplified10.0
rmApplied add-sqr-sqrt_binary64_794310.0
Applied times-frac_binary64_792710.0
Applied associate-*r*_binary64_78619.7
if 2.82430320360539952e60 < z Initial program 38.5
rmApplied *-un-lft-identity_binary64_792138.5
Applied sqrt-prod_binary64_793738.5
Applied times-frac_binary64_792736.0
Simplified36.0
Taylor expanded around inf 3.5
Final simplification7.1
herbie shell --seed 2021098
(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)))))