\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \leq -1.0008921998682885 \cdot 10^{-93} \lor \neg \left(a \leq 3.484466297480128 \cdot 10^{-263}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z - t}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\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 (<= a -1.0008921998682885e-93) (not (<= a 3.484466297480128e-263))) (+ x (* y (- 1.0 (/ (- z t) (- a t))))) (+ x (/ z (/ t y)))))
double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (x + y)) - (((double) (((double) (z - t)) * y)) / ((double) (a - t)))));
}
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a <= -1.0008921998682885e-93) || !(a <= 3.484466297480128e-263))) {
tmp = ((double) (x + ((double) (y * ((double) (1.0 - (((double) (z - t)) / ((double) (a - t)))))))));
} else {
tmp = ((double) (x + (z / (t / y))));
}
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.0 |
|---|---|
| Target | 8.5 |
| Herbie | 7.1 |
if a < -1.0008921998682885e-93 or 3.484466297480128e-263 < a Initial program 15.4
rmApplied associate-/l*_binary6410.2
rmApplied associate--l+_binary648.2
rmApplied associate-/r/_binary646.5
Applied *-un-lft-identity_binary646.5
Applied distribute-rgt-out--_binary646.5
if -1.0008921998682885e-93 < a < 3.484466297480128e-263Initial program 18.6
rmApplied associate-/l*_binary6417.7
Taylor expanded around inf 10.9
Simplified9.6
Final simplification7.1
herbie shell --seed 2020205
(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))))