\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;t \leq -2.874394328703431 \cdot 10^{+162} \lor \neg \left(t \leq 5.485833698658141 \cdot 10^{+80}\right):\\
\;\;\;\;x + \frac{y}{t} \cdot \left(z - a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(x + \frac{t \cdot y}{a - t}\right)\right) - \frac{y}{\frac{a - t}{z}}\\
\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 -2.874394328703431e+162) (not (<= t 5.485833698658141e+80))) (+ x (* (/ y t) (- z a))) (- (+ y (+ x (/ (* t y) (- a t)))) (/ y (/ (- a t) z)))))
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 <= -2.874394328703431e+162) || !(t <= 5.485833698658141e+80)) {
tmp = x + ((y / t) * (z - a));
} else {
tmp = (y + (x + ((t * y) / (a - t)))) - (y / ((a - t) / z));
}
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.3 |
|---|---|
| Target | 8.4 |
| Herbie | 6.8 |
if t < -2.874394328703431e162 or 5.4858336986581407e80 < t Initial program 31.1
Simplified21.5
Taylor expanded in t around inf 14.9
Simplified7.9
if -2.874394328703431e162 < t < 5.4858336986581407e80Initial program 9.3
Simplified6.7
Taylor expanded in y around 0 8.0
Applied associate-/l*_binary646.3
Final simplification6.8
herbie shell --seed 2022068
(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-7) (- (+ 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))))