\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -9.0201884235280197 \cdot 10^{203} \lor \neg \left(t \le 1.5081531538129489 \cdot 10^{118}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a - t}, y, x + y\right) - \frac{z}{\frac{a - t}{y}}\\
\end{array}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 VAR;
if (((t <= -9.02018842352802e+203) || !(t <= 1.508153153812949e+118))) {
VAR = fma((z / t), y, x);
} else {
VAR = (fma((t / (a - t)), y, (x + y)) - (z / ((a - t) / y)));
}
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.4 |
|---|---|
| Target | 8.6 |
| Herbie | 7.5 |
if t < -9.02018842352802e+203 or 1.508153153812949e+118 < t Initial program 31.9
Simplified23.1
rmApplied clear-num23.2
rmApplied fma-udef23.3
Simplified23.2
Taylor expanded around inf 16.5
Simplified11.2
if -9.02018842352802e+203 < t < 1.508153153812949e+118Initial program 11.2
Simplified8.2
rmApplied clear-num8.3
rmApplied fma-udef8.3
Simplified8.1
rmApplied +-commutative8.1
rmApplied div-sub8.1
Applied associate-+r-6.4
Simplified6.2
Final simplification7.5
herbie shell --seed 2020071 +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))))