\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -3.347552958513927 \cdot 10^{+122}:\\
\;\;\;\;\frac{x \cdot y}{\mathsf{fma}\left(0.5, \frac{a \cdot t}{z \cdot z}, -1\right)}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{\sqrt{z \cdot z - a \cdot t}}{z}\\
\mathbf{if}\;z \leq -1.0802216888912775 \cdot 10^{-139}:\\
\;\;\;\;x \cdot \left(y \cdot \frac{1}{t_1}\right)\\
\mathbf{elif}\;z \leq 6.049021251734141 \cdot 10^{-173}:\\
\;\;\;\;\left(z \cdot \left(x \cdot y\right)\right) \cdot \frac{1}{\mathsf{hypot}\left(\sqrt{-a \cdot t}, z\right)}\\
\mathbf{elif}\;z \leq 5.015223024558922 \cdot 10^{+82}:\\
\;\;\;\;\left(x \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) \cdot \frac{\sqrt[3]{y}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}\\
\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 -3.347552958513927e+122)
(/ (* x y) (fma 0.5 (/ (* a t) (* z z)) -1.0))
(let* ((t_1 (/ (sqrt (- (* z z) (* a t))) z)))
(if (<= z -1.0802216888912775e-139)
(* x (* y (/ 1.0 t_1)))
(if (<= z 6.049021251734141e-173)
(* (* z (* x y)) (/ 1.0 (hypot (sqrt (- (* a t))) z)))
(if (<= z 5.015223024558922e+82)
(* (* x (* (cbrt y) (cbrt y))) (/ (cbrt y) t_1))
(* 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 <= -3.347552958513927e+122) {
tmp = (x * y) / fma(0.5, ((a * t) / (z * z)), -1.0);
} else {
double t_1 = sqrt((z * z) - (a * t)) / z;
double tmp_1;
if (z <= -1.0802216888912775e-139) {
tmp_1 = x * (y * (1.0 / t_1));
} else if (z <= 6.049021251734141e-173) {
tmp_1 = (z * (x * y)) * (1.0 / hypot(sqrt(-(a * t)), z));
} else if (z <= 5.015223024558922e+82) {
tmp_1 = (x * (cbrt(y) * cbrt(y))) * (cbrt(y) / t_1);
} else {
tmp_1 = x * y;
}
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
| Original | 24.4 |
|---|---|
| Target | 7.7 |
| Herbie | 6.3 |
if z < -3.34755295851392692e122Initial program 47.1
Applied associate-/l*_binary6445.2
Applied div-inv_binary6445.2
Taylor expanded in z around -inf 6.2
Simplified6.2
if -3.34755295851392692e122 < z < -1.0802216888912775e-139Initial program 7.2
Applied associate-/l*_binary644.4
Applied *-un-lft-identity_binary644.4
Applied times-frac_binary644.3
Applied div-inv_binary644.3
if -1.0802216888912775e-139 < z < 6.04902125173414102e-173Initial program 16.8
Applied div-inv_binary6416.8
Simplified13.0
if 6.04902125173414102e-173 < z < 5.0152230245589217e82Initial program 7.9
Applied associate-/l*_binary645.7
Applied *-un-lft-identity_binary645.7
Applied times-frac_binary646.1
Applied *-un-lft-identity_binary646.1
Applied *-un-lft-identity_binary646.1
Applied sqrt-prod_binary646.1
Applied times-frac_binary646.1
Applied add-cube-cbrt_binary646.9
Applied times-frac_binary646.9
Applied associate-*r*_binary645.9
Simplified5.9
if 5.0152230245589217e82 < z Initial program 40.0
Taylor expanded in z around inf 3.1
Final simplification6.3
herbie shell --seed 2022081
(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)))))