x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} = -\infty \lor \neg \left(x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t} \le 1.712305327991925 \cdot 10^{306}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(y - x\right) \cdot \frac{1}{a - t}, z - t, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= -inf.0) || !(((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (a - t)))))) <= 1.712305327991925e+306))) {
VAR = ((double) fma(((double) (((double) (y - x)) * ((double) (1.0 / ((double) (a - t)))))), ((double) (z - t)), x));
} else {
VAR = ((double) (x + ((double) (((double) (((double) (y - x)) * ((double) (z - t)))) / ((double) (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 | 24.3 |
|---|---|
| Target | 8.6 |
| Herbie | 10.4 |
if (+ x (/ (* (- y x) (- z t)) (- a t))) < -inf.0 or 1.712305327991925e+306 < (+ x (/ (* (- y x) (- z t)) (- a t))) Initial program 63.9
Simplified14.8
rmApplied div-inv14.9
if -inf.0 < (+ x (/ (* (- y x) (- z t)) (- a t))) < 1.712305327991925e+306Initial program 8.6
Final simplification10.4
herbie shell --seed 2020114 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< a -1.6153062845442575e-142) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t)))) (if (< a 3.774403170083174e-182) (- y (* (/ z t) (- y x))) (+ x (* (/ (- y x) 1) (/ (- z t) (- a t))))))
(+ x (/ (* (- y x) (- z t)) (- a t))))