\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -1.2154716544061854 \cdot 10^{-37}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z \leq 1.1954013876901866 \cdot 10^{-257}:\\
\;\;\;\;\frac{x}{\frac{1}{\sqrt[3]{z} \cdot \sqrt[3]{z}}} \cdot \frac{y}{\frac{\mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}{\sqrt[3]{z}}}\\
\mathbf{elif}\;z \leq 1.2271992071220414 \cdot 10^{-173}:\\
\;\;\;\;\frac{1}{\frac{\frac{1}{\sqrt{z}}}{\sqrt[3]{y} \cdot \sqrt[3]{y}}} \cdot \frac{x}{\frac{\frac{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}{\sqrt{z}}}{\sqrt[3]{y}}}\\
\mathbf{elif}\;z \leq 1.2689282843189357 \cdot 10^{+142}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - a \cdot t}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\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.2154716544061854e-37)
(- (* y x))
(if (<= z 1.1954013876901866e-257)
(*
(/ x (/ 1.0 (* (cbrt z) (cbrt z))))
(/ y (/ (hypot (sqrt (- (* a t))) z) (cbrt z))))
(if (<= z 1.2271992071220414e-173)
(*
(/ 1.0 (/ (/ 1.0 (sqrt z)) (* (cbrt y) (cbrt y))))
(/ x (/ (/ (hypot (* (sqrt a) (sqrt (- t))) z) (sqrt z)) (cbrt y))))
(if (<= z 1.2689282843189357e+142)
(* (* y x) (/ z (sqrt (- (* z z) (* a t)))))
(* y x))))))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.2154716544061854e-37) {
tmp = -(y * x);
} else if (z <= 1.1954013876901866e-257) {
tmp = (x / (1.0 / (cbrt(z) * cbrt(z)))) * (y / (hypot(sqrt(-(a * t)), z) / cbrt(z)));
} else if (z <= 1.2271992071220414e-173) {
tmp = (1.0 / ((1.0 / sqrt(z)) / (cbrt(y) * cbrt(y)))) * (x / ((hypot((sqrt(a) * sqrt(-t)), z) / sqrt(z)) / cbrt(y)));
} else if (z <= 1.2689282843189357e+142) {
tmp = (y * x) * (z / sqrt((z * z) - (a * t)));
} else {
tmp = y * x;
}
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.3 |
|---|---|
| Target | 7.7 |
| Herbie | 6.7 |
if z < -1.2154716544061854e-37Initial program 31.0
Taylor expanded in z around -inf 6.9
Simplified6.9
if -1.2154716544061854e-37 < z < 1.1954013876901866e-257Initial program 13.5
Applied associate-/l*_binary6414.0
Simplified14.5
Applied add-cube-cbrt_binary6415.0
Applied *-un-lft-identity_binary6415.0
Applied times-frac_binary6415.0
Applied times-frac_binary6412.9
if 1.1954013876901866e-257 < z < 1.2271992071220414e-173Initial program 18.4
Applied associate-/l*_binary6419.7
Simplified14.2
Applied associate-/l*_binary6415.1
Applied distribute-rgt-neg-in_binary6415.1
Applied sqrt-prod_binary6413.1
Applied add-cube-cbrt_binary6413.5
Applied add-sqr-sqrt_binary6413.5
Applied *-un-lft-identity_binary6413.5
Applied times-frac_binary6413.4
Applied times-frac_binary649.7
Applied *-un-lft-identity_binary649.7
Applied times-frac_binary645.4
if 1.2271992071220414e-173 < z < 1.26892828431893575e142Initial program 8.3
Applied *-un-lft-identity_binary648.3
Applied times-frac_binary645.0
if 1.26892828431893575e142 < z Initial program 51.4
Taylor expanded in z around inf 1.6
Final simplification6.7
herbie shell --seed 2022068
(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)))))