\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\begin{array}{l}
\mathbf{if}\;z \leq -1.3995432802805447 \cdot 10^{+48}:\\
\;\;\;\;\frac{a}{y - b} - \frac{t}{y - b}\\
\mathbf{elif}\;z \leq 2.8616937025230026 \cdot 10^{+33}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot \left(b - y\right)} + \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{y + z \cdot \left(b - y\right)} + \frac{t - a}{b - y}\\
\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 (<= z -1.3995432802805447e+48)
(- (/ a (- y b)) (/ t (- y b)))
(if (<= z 2.8616937025230026e+33)
(+ (* x (/ y (+ y (* z (- b y))))) (/ (* z (- t a)) (+ y (* z (- b y)))))
(+ (/ (* y x) (+ y (* z (- b y)))) (/ (- t a) (- b y))))))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 <= -1.3995432802805447e+48) {
tmp = (a / (y - b)) - (t / (y - b));
} else if (z <= 2.8616937025230026e+33) {
tmp = (x * (y / (y + (z * (b - y))))) + ((z * (t - a)) / (y + (z * (b - y))));
} else {
tmp = ((y * x) / (y + (z * (b - y)))) + ((t - a) / (b - y));
}
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
Results
| Original | 23.1 |
|---|---|
| Target | 17.8 |
| Herbie | 5.7 |
if z < -1.39954328028054468e48Initial program 42.9
Taylor expanded around 0 43.1
Simplified42.9
Taylor expanded around -inf 12.3
if -1.39954328028054468e48 < z < 2.8616937025230026e33Initial program 9.6
Taylor expanded around 0 9.6
Simplified9.6
rmApplied *-un-lft-identity_binary64_219029.6
Applied times-frac_binary64_219081.6
Simplified1.6
if 2.8616937025230026e33 < z Initial program 40.6
Taylor expanded around 0 40.9
Simplified40.6
Taylor expanded around inf 10.7
Final simplification5.7
herbie shell --seed 2020344
(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)))))