\frac{\left(x \cdot y\right) \cdot z}{\sqrt{z \cdot z - t \cdot a}}
\begin{array}{l}
\mathbf{if}\;z \leq -1.8547055447344963 \cdot 10^{+153}:\\
\;\;\;\;-y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \sqrt{z \cdot z - t \cdot a}\\
\mathbf{if}\;z \leq -1.717551219244167 \cdot 10^{-157}:\\
\;\;\;\;\left(y \cdot x\right) \cdot \frac{z}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := y \cdot \left(x \cdot \frac{z}{\mathsf{hypot}\left(\sqrt{a} \cdot \sqrt{-t}, z\right)}\right)\\
\mathbf{if}\;z \leq 2.008610550034131 \cdot 10^{-205}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8.420471240038822 \cdot 10^{+27}:\\
\;\;\;\;\begin{array}{l}
t_3 := \sqrt{t_1}\\
\frac{y \cdot x}{t_3} \cdot \frac{z}{t_3}
\end{array}\\
\mathbf{elif}\;z \leq 7.766070028302245 \cdot 10^{+29}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}\\
\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 -1.8547055447344963e+153)
(- (* y x))
(let* ((t_1 (sqrt (- (* z z) (* t a)))))
(if (<= z -1.717551219244167e-157)
(* (* y x) (/ z t_1))
(let* ((t_2 (* y (* x (/ z (hypot (* (sqrt a) (sqrt (- t))) z))))))
(if (<= z 2.008610550034131e-205)
t_2
(if (<= z 8.420471240038822e+27)
(let* ((t_3 (sqrt t_1))) (* (/ (* y x) t_3) (/ z t_3)))
(if (<= z 7.766070028302245e+29) t_2 (* 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.8547055447344963e+153) {
tmp = -(y * x);
} else {
double t_1 = sqrt((z * z) - (t * a));
double tmp_1;
if (z <= -1.717551219244167e-157) {
tmp_1 = (y * x) * (z / t_1);
} else {
double t_2 = y * (x * (z / hypot((sqrt(a) * sqrt(-t)), z)));
double tmp_2;
if (z <= 2.008610550034131e-205) {
tmp_2 = t_2;
} else if (z <= 8.420471240038822e+27) {
double t_3 = sqrt(t_1);
tmp_2 = ((y * x) / t_3) * (z / t_3);
} else if (z <= 7.766070028302245e+29) {
tmp_2 = t_2;
} else {
tmp_2 = y * x;
}
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.2 |
| Herbie | 5.5 |
if z < -1.8547055447344963e153Initial program 55.1
Taylor expanded in z around -inf 1.1
Simplified1.1
if -1.8547055447344963e153 < z < -1.717551219244167e-157Initial program 8.0
Applied *-un-lft-identity_binary648.0
Applied sqrt-prod_binary648.0
Applied times-frac_binary645.0
if -1.717551219244167e-157 < z < 2.00861055003413093e-205 or 8.4204712400388224e27 < z < 7.7660700283022452e29Initial program 17.1
Applied *-un-lft-identity_binary6417.1
Applied sqrt-prod_binary6417.1
Applied times-frac_binary6418.4
Simplified18.4
Simplified13.9
Applied associate-*l*_binary6413.3
Applied distribute-rgt-neg-in_binary6413.3
Applied sqrt-prod_binary6411.6
if 2.00861055003413093e-205 < z < 8.4204712400388224e27Initial program 8.9
Applied add-sqr-sqrt_binary649.1
Applied times-frac_binary647.9
if 7.7660700283022452e29 < z Initial program 35.6
Taylor expanded in z around inf 3.8
Final simplification5.5
herbie shell --seed 2022088
(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)))))