\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\begin{array}{l}
\mathbf{if}\;t \le -4.74606125404172808 \cdot 10^{-145} \lor \neg \left(t \le 2.82207153459146274 \cdot 10^{-113}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, t - z, x + y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t - z\right) \cdot y}{a - t} + \left(x + y\right)\\
\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 temp;
if (((t <= -4.746061254041728e-145) || !(t <= 2.822071534591463e-113))) {
temp = fma((y / (a - t)), (t - z), (x + y));
} else {
temp = ((((t - z) * y) / (a - t)) + (x + y));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 16.5 |
|---|---|
| Target | 8.1 |
| Herbie | 11.9 |
if t < -4.746061254041728e-145 or 2.822071534591463e-113 < t Initial program 20.8
Simplified14.5
if -4.746061254041728e-145 < t < 2.822071534591463e-113Initial program 4.7
Simplified3.8
rmApplied add-cube-cbrt4.1
Applied associate-/l*4.1
rmApplied fma-udef4.1
Simplified4.7
Final simplification11.9
herbie shell --seed 2020056 +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))))