\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -4.988987613997654 \cdot 10^{+154}:\\
\;\;\;\;-y \cdot x\\
\mathbf{elif}\;z \leq -5.653067374710907 \cdot 10^{-203}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{\sqrt{z \cdot z - t \cdot a}}\\
\mathbf{elif}\;z \leq 3.916159283675478 \cdot 10^{-139}:\\
\;\;\;\;\left(\left(y \cdot x\right) \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right) \cdot \frac{\sqrt[3]{z}}{\mathsf{hypot}\left(\sqrt{-t \cdot a}, z\right)}\\
\mathbf{elif}\;z \leq 1.216315346182611 \cdot 10^{+31}:\\
\;\;\;\;\left(y \cdot \left(z \cdot x\right)\right) \cdot \sqrt{\frac{1}{{z}^{2} - t \cdot a}}\\
\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 -4.988987613997654e+154)
(- (* y x))
(if (<= z -5.653067374710907e-203)
(* (* y x) (/ z (sqrt (- (* z z) (* t a)))))
(if (<= z 3.916159283675478e-139)
(*
(* (* y x) (* (cbrt z) (cbrt z)))
(/ (cbrt z) (hypot (sqrt (- (* t a))) z)))
(if (<= z 1.216315346182611e+31)
(* (* y (* z x)) (sqrt (/ 1.0 (- (pow z 2.0) (* t a)))))
(* 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 <= -4.988987613997654e+154) {
tmp = -(y * x);
} else if (z <= -5.653067374710907e-203) {
tmp = (y * x) * (z / sqrt(((z * z) - (t * a))));
} else if (z <= 3.916159283675478e-139) {
tmp = ((y * x) * (cbrt(z) * cbrt(z))) * (cbrt(z) / hypot(sqrt(-(t * a)), z));
} else if (z <= 1.216315346182611e+31) {
tmp = (y * (z * x)) * sqrt((1.0 / (pow(z, 2.0) - (t * a))));
} 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.7 |
|---|---|
| Target | 7.9 |
| Herbie | 6.3 |
if z < -4.988987613997654e154Initial program 54.4
Taylor expanded in z around -inf 1.4
Simplified1.4
if -4.988987613997654e154 < z < -5.6530673747109071e-203Initial program 9.4
Applied *-un-lft-identity_binary649.4
Applied sqrt-prod_binary649.4
Applied times-frac_binary646.0
if -5.6530673747109071e-203 < z < 3.91615928367547766e-139Initial program 17.2
Applied *-un-lft-identity_binary6417.2
Applied sqrt-prod_binary6417.2
Applied times-frac_binary6418.4
Simplified18.4
Simplified14.8
Applied *-un-lft-identity_binary6414.8
Applied add-cube-cbrt_binary6415.2
Applied times-frac_binary6415.2
Applied associate-*r*_binary6412.6
Simplified12.6
if 3.91615928367547766e-139 < z < 1.21631534618261101e31Initial program 8.5
Taylor expanded in x around 0 9.4
if 1.21631534618261101e31 < z Initial program 35.7
Taylor expanded in z around inf 4.2
Final simplification6.3
herbie shell --seed 2022125
(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)))))