\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \leq -4.06012244061433 \cdot 10^{-89}:\\
\;\;\;\;\left(x + y\right) - \frac{z - t}{\frac{1}{\frac{y}{a - t}}}\\
\mathbf{elif}\;a \leq 1.5876893569634118 \cdot 10^{-41}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) - y \cdot \frac{z - t}{a - t}\\
\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 (<= a -4.06012244061433e-89)
(- (+ x y) (/ (- z t) (/ 1.0 (/ y (- a t)))))
(if (<= a 1.5876893569634118e-41)
(+ x (/ z (/ t y)))
(- (+ x y) (* y (/ (- z 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 (a <= -4.06012244061433e-89) {
tmp = (x + y) - ((z - t) / (1.0 / (y / (a - t))));
} else if (a <= 1.5876893569634118e-41) {
tmp = x + (z / (t / y));
} else {
tmp = (x + y) - (y * ((z - 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.4 |
|---|---|
| Target | 8.6 |
| Herbie | 9.4 |
if a < -4.0601224406143298e-89Initial program 15.1
rmApplied associate-/l*_binary648.7
rmApplied clear-num_binary648.8
if -4.0601224406143298e-89 < a < 1.58768935696341176e-41Initial program 19.0
rmApplied associate-/l*_binary6418.5
Taylor expanded around inf 13.4
Simplified12.0
if 1.58768935696341176e-41 < a Initial program 14.8
rmApplied associate-/l*_binary648.2
rmApplied associate-/r/_binary646.9
Final simplification9.4
herbie shell --seed 2020260
(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))))