\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \leq -3.0630271737675854 \cdot 10^{-72}:\\
\;\;\;\;x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)\\
\mathbf{elif}\;t \leq 4.093149350033633 \cdot 10^{-213}:\\
\;\;\;\;x + \left(y - \frac{z}{\frac{a - t}{y}}\right)\\
\mathbf{elif}\;t \leq 1.5506905253087662 \cdot 10^{+106} \lor \neg \left(t \leq 6.614496158483137 \cdot 10^{+165}\right):\\
\;\;\;\;x + y \cdot \left(\left(1 + \frac{t}{a - t}\right) - \frac{z}{a - t}\right)\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \left(\frac{z}{a - t} + \frac{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 (<= t -3.0630271737675854e-72)
(+ x (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t)))))
(if (<= t 4.093149350033633e-213)
(+ x (- y (/ z (/ (- a t) y))))
(if (or (<= t 1.5506905253087662e+106)
(not (<= t 6.614496158483137e+165)))
(+ x (* y (- (+ 1.0 (/ t (- a t))) (/ z (- a t)))))
(- x (* y (+ (/ z (- a t)) (/ 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 <= -3.0630271737675854e-72) {
tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))));
} else if (t <= 4.093149350033633e-213) {
tmp = x + (y - (z / ((a - t) / y)));
} else if ((t <= 1.5506905253087662e+106) || !(t <= 6.614496158483137e+165)) {
tmp = x + (y * ((1.0 + (t / (a - t))) - (z / (a - t))));
} else {
tmp = x - (y * ((z / (a - t)) + (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.8 |
|---|---|
| Target | 8.6 |
| Herbie | 4.7 |
if t < -3.0630271737675854e-72 or 4.0931493500336329e-213 < t < 1.5506905253087662e106 or 6.6144961584831372e165 < t Initial program 20.4
Taylor expanded around 0 16.0
Simplified7.2
rmApplied associate-/r/_binary64_177567.3
Applied associate-/r/_binary64_177564.6
Applied distribute-rgt1-in_binary64_177664.6
Applied distribute-rgt-out--_binary64_177644.6
Simplified4.6
if -3.0630271737675854e-72 < t < 4.0931493500336329e-213Initial program 4.6
Taylor expanded around 0 4.1
Simplified3.1
Taylor expanded around 0 3.6
if 1.5506905253087662e106 < t < 6.6144961584831372e165Initial program 26.0
Taylor expanded around 0 19.6
Simplified9.6
rmApplied associate-/r/_binary64_177569.0
Applied associate-/r/_binary64_177566.2
Applied distribute-rgt1-in_binary64_177666.2
Applied distribute-rgt-out--_binary64_177646.2
Simplified6.2
Taylor expanded around 0 11.3
Simplified11.3
Final simplification4.7
herbie shell --seed 2020344
(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))))