\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -5.6621302881381 \cdot 10^{-188} \lor \neg \left(a \le 6.3541506798732285 \cdot 10^{-69}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \left(t - z\right) \cdot \frac{1}{a - t}, y\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (x + y)) - ((double) (((double) (((double) (z - t)) * y)) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((a <= -5.6621302881381e-188) || !(a <= 6.354150679873228e-69))) {
VAR = ((double) (((double) fma(y, ((double) (((double) (t - z)) * ((double) (1.0 / ((double) (a - t)))))), y)) + x));
} else {
VAR = ((double) fma(((double) (z / t)), y, x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.1 |
|---|---|
| Target | 8.1 |
| Herbie | 7.4 |
if a < -5.6621302881381e-188 or 6.354150679873228e-69 < a Initial program 14.9
Simplified9.1
rmApplied fma-udef9.1
rmApplied div-inv9.1
Applied associate-*l*8.6
Simplified8.5
rmApplied +-commutative8.5
Applied associate-+r+5.9
Simplified5.9
rmApplied div-inv6.3
if -5.6621302881381e-188 < a < 6.354150679873228e-69Initial program 19.3
Simplified18.1
rmApplied fma-udef18.2
rmApplied div-inv18.2
Applied associate-*l*18.3
Simplified18.3
rmApplied +-commutative18.3
Applied associate-+r+10.9
Simplified10.9
Taylor expanded around inf 11.0
Simplified10.3
Final simplification7.4
herbie shell --seed 2020113 +o rules:numerics
(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 (- 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 (- a t))) y))))
(- (+ x y) (/ (* (- z t) y) (- a t))))