x + \frac{y \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \le -1.1933061297129669 \cdot 10^{275}:\\
\;\;\;\;\frac{z - t}{\frac{a - t}{y}} + x\\
\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \le 5.07564913742574227 \cdot 10^{-57}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + ((y * (z - t)) / (a - t)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((((y * (z - t)) / (a - t)) <= -1.1933061297129669e+275)) {
VAR = (((z - t) / ((a - t) / y)) + x);
} else {
double VAR_1;
if ((((y * (z - t)) / (a - t)) <= 5.075649137425742e-57)) {
VAR_1 = (x + ((y * (z - t)) / (a - t)));
} else {
VAR_1 = fma((y / (a - t)), (z - t), x);
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 10.9 |
|---|---|
| Target | 1.3 |
| Herbie | 1.0 |
if (/ (* y (- z t)) (- a t)) < -1.1933061297129669e+275Initial program 58.9
Simplified1.8
rmApplied clear-num1.9
rmApplied fma-udef1.9
Simplified1.6
if -1.1933061297129669e+275 < (/ (* y (- z t)) (- a t)) < 5.075649137425742e-57Initial program 0.3
if 5.075649137425742e-57 < (/ (* y (- z t)) (- a t)) Initial program 20.1
Simplified2.5
rmApplied clear-num2.7
rmApplied clear-num2.7
Applied remove-double-div2.5
Final simplification1.0
herbie shell --seed 2020078 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))