\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.9399606018418395 \cdot 10^{+22} \lor \neg \left(z \leq 1.8313071631021404 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{a}{y - b} - \mathsf{fma}\left(\frac{y}{z}, \frac{x}{y - b}, \mathsf{fma}\left(\frac{y}{z}, \frac{t}{{\left(y - b\right)}^{2}}, \frac{t}{y - b}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \left(y + z \cdot b\right) - z \cdot y\\
\left(\frac{z \cdot t}{t_1} + \frac{y \cdot x}{t_1}\right) - \frac{z \cdot a}{t_1}
\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.9399606018418395e+22) (not (<= z 1.8313071631021404e+48)))
(-
(/ a (- y b))
(fma
(/ y z)
(/ x (- y b))
(fma (/ y z) (/ t (pow (- y b) 2.0)) (/ t (- y b)))))
(let* ((t_1 (- (+ y (* z b)) (* z y))))
(- (+ (/ (* z t) t_1) (/ (* y x) t_1)) (/ (* z a) t_1)))))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.9399606018418395e+22) || !(z <= 1.8313071631021404e+48)) {
tmp = (a / (y - b)) - fma((y / z), (x / (y - b)), fma((y / z), (t / pow((y - b), 2.0)), (t / (y - b))));
} else {
double t_1 = (y + (z * b)) - (z * y);
tmp = (((z * t) / t_1) + ((y * x) / t_1)) - ((z * a) / t_1);
}
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 | 22.0 |
|---|---|
| Target | 16.9 |
| Herbie | 7.9 |
if z < -3.9399606018418395e22 or 1.83130716310214038e48 < z Initial program 38.7
Taylor expanded in z around -inf 21.9
Simplified8.5
Taylor expanded in z around inf 7.0
if -3.9399606018418395e22 < z < 1.83130716310214038e48Initial program 8.6
Taylor expanded in x around 0 8.6
Final simplification7.9
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)))))