\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;z \leq -3.3265456538885105 \cdot 10^{+22} \lor \neg \left(z \leq 2.0874613586551125 \cdot 10^{+36}\right):\\
\;\;\;\;\begin{array}{l}
t_1 := {\left(b - y\right)}^{2}\\
\mathsf{fma}\left(\frac{y}{b - y}, \frac{x}{z}, \mathsf{fma}\left(\frac{a}{t_1}, \frac{y}{z}, \frac{t}{b - y}\right)\right) - \mathsf{fma}\left(\frac{y}{t_1}, \frac{t}{z}, \frac{a}{b - y}\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_2 := \sqrt[3]{y + z \cdot \left(b - y\right)}\\
t_3 := \left(y + z \cdot b\right) - z \cdot y\\
\left(\frac{t}{\left(b + \frac{y}{z}\right) - y} + \frac{x \cdot \frac{y}{t_2 \cdot t_2}}{\sqrt[3]{t_3}}\right) - \frac{z \cdot a}{t_3}
\end{array}\\
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -3.3265456538885105e+22) (not (<= z 2.0874613586551125e+36)))
(let* ((t_1 (pow (- b y) 2.0)))
(-
(fma (/ y (- b y)) (/ x z) (fma (/ a t_1) (/ y z) (/ t (- b y))))
(fma (/ y t_1) (/ t z) (/ a (- b y)))))
(let* ((t_2 (cbrt (+ y (* z (- b y))))) (t_3 (- (+ y (* z b)) (* z y))))
(-
(+ (/ t (- (+ b (/ y z)) y)) (/ (* x (/ y (* t_2 t_2))) (cbrt t_3)))
(/ (* z a) t_3)))))double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.3265456538885105e+22) || !(z <= 2.0874613586551125e+36)) {
double t_1_1 = pow((b - y), 2.0);
tmp = fma((y / (b - y)), (x / z), fma((a / t_1_1), (y / z), (t / (b - y)))) - fma((y / t_1_1), (t / z), (a / (b - y)));
} else {
double t_2 = cbrt(y + (z * (b - y)));
double t_3 = (y + (z * b)) - (z * y);
tmp = ((t / ((b + (y / z)) - y)) + ((x * (y / (t_2 * t_2))) / cbrt(t_3))) - ((z * a) / t_3);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
| Original | 23.5 |
|---|---|
| Target | 18.2 |
| Herbie | 4.0 |
if z < -3.3265456538885105e22 or 2.0874613586551125e36 < z Initial program 41.0
Taylor expanded in z around inf 21.7
Simplified3.2
if -3.3265456538885105e22 < z < 2.0874613586551125e36Initial program 9.1
Taylor expanded in x around 0 9.1
Applied associate-/l*_binary649.8
Simplified9.8
Taylor expanded in y around 0 9.7
Applied add-cube-cbrt_binary6410.2
Applied associate-/r*_binary6410.2
Simplified4.7
Final simplification4.0
herbie shell --seed 2022068
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))