\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\begin{array}{l}
\mathbf{if}\;z \leq -4.310313169511819 \cdot 10^{+53} \lor \neg \left(z \leq 2.74295821737516 \cdot 10^{+27}\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 := \left(y + z \cdot b\right) - z \cdot y\\
\left(\frac{z \cdot t}{t_2} + \frac{y \cdot x}{t_2}\right) - \frac{z \cdot a}{t_2}
\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 -4.310313169511819e+53) (not (<= z 2.74295821737516e+27)))
(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 (- (+ y (* z b)) (* z y))))
(- (+ (/ (* z t) t_2) (/ (* y x) t_2)) (/ (* z a) t_2)))))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 <= -4.310313169511819e+53) || !(z <= 2.74295821737516e+27)) {
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 = (y + (z * b)) - (z * y);
tmp = (((z * t) / t_2) + ((y * x) / t_2)) - ((z * a) / t_2);
}
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 | 21.9 |
|---|---|
| Target | 17.3 |
| Herbie | 7.4 |
if z < -4.3103131695118189e53 or 2.74295821737516e27 < z Initial program 39.1
Simplified39.1
Taylor expanded in z around inf 22.3
Simplified5.3
if -4.3103131695118189e53 < z < 2.74295821737516e27Initial program 8.8
Simplified8.8
Taylor expanded in x around 0 9.0
Final simplification7.4
herbie shell --seed 2022088
(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)))))