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 -2.98575735952740302 \cdot 10^{225} \lor \neg \left(\frac{y \cdot \left(z - t\right)}{a - t} \le 3.5239238908574738 \cdot 10^{258}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\
\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)) <= -2.985757359527403e+225) || !(((y * (z - t)) / (a - t)) <= 3.523923890857474e+258))) {
VAR = fma((y / (a - t)), (z - t), x);
} else {
VAR = (x + ((y * (z - t)) / (a - t)));
}
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.4 |
|---|---|
| Target | 1.3 |
| Herbie | 0.7 |
if (/ (* y (- z t)) (- a t)) < -2.985757359527403e+225 or 3.523923890857474e+258 < (/ (* y (- z t)) (- a t)) Initial program 53.1
Simplified2.7
if -2.985757359527403e+225 < (/ (* y (- z t)) (- a t)) < 3.523923890857474e+258Initial program 0.2
Final simplification0.7
herbie shell --seed 2020092 +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))))