\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \leq -1.686508813163046 \cdot 10^{+200} \lor \neg \left(t \leq 4.669954669182884 \cdot 10^{+177}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z - a}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(\left(\frac{t}{a - t} + 1\right) - \frac{z}{a - t}\right)\\
\end{array}(FPCore (x y z t a) :precision binary64 (- (+ x y) (/ (* (- z t) y) (- a t))))
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.686508813163046e+200) (not (<= t 4.669954669182884e+177))) (+ x (/ y (/ t (- z a)))) (+ x (* y (- (+ (/ t (- a t)) 1.0) (/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
return (x + y) - (((z - t) * y) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.686508813163046e+200) || !(t <= 4.669954669182884e+177)) {
tmp = x + (y / (t / (z - a)));
} else {
tmp = x + (y * (((t / (a - t)) + 1.0) - (z / (a - t))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.7 |
|---|---|
| Target | 8.9 |
| Herbie | 3.8 |
if t < -1.6865088131630461e200 or 4.66995466918288402e177 < t Initial program 34.4
rmApplied associate-/l*_binary64_1502725.7
Taylor expanded around 0 28.8
Simplified7.7
Taylor expanded around inf 14.3
Simplified4.0
if -1.6865088131630461e200 < t < 4.66995466918288402e177Initial program 11.7
rmApplied associate-/l*_binary64_150278.8
Taylor expanded around 0 8.7
Simplified3.7
Final simplification3.8
herbie shell --seed 2021093
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))