x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -7.2209685036108669 \cdot 10^{-82} \lor \neg \left(a \le -1.7455414240065636 \cdot 10^{-103} \lor \neg \left(a \le -1.39601062168651405 \cdot 10^{-163} \lor \neg \left(a \le 2.8613130912406488 \cdot 10^{-186}\right)\right)\right):\\
\;\;\;\;\mathsf{fma}\left(y - x, \frac{z - t}{a - t}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{t}, z, y - \frac{z \cdot y}{t}\right)\\
\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 (((a <= -7.220968503610867e-82) || !((a <= -1.7455414240065636e-103) || !((a <= -1.396010621686514e-163) || !(a <= 2.8613130912406488e-186))))) {
VAR = ((double) fma(((double) (y - x)), ((double) (((double) (z - t)) / ((double) (a - t)))), x));
} else {
VAR = ((double) fma(((double) (x / t)), z, ((double) (y - ((double) (((double) (z * y)) / 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 | 9.3 |
| Herbie | 10.5 |
if a < -7.220968503610867e-82 or -1.7455414240065636e-103 < a < -1.396010621686514e-163 or 2.8613130912406488e-186 < a Initial program 23.2
Simplified12.0
rmApplied fma-udef12.0
rmApplied div-inv12.1
Applied associate-*l*9.6
Simplified9.6
rmApplied fma-def9.6
if -7.220968503610867e-82 < a < -1.7455414240065636e-103 or -1.396010621686514e-163 < a < 2.8613130912406488e-186Initial program 28.6
Simplified25.0
rmApplied fma-udef25.0
rmApplied div-inv25.1
Applied associate-*l*19.6
Simplified19.6
Taylor expanded around inf 13.5
Simplified13.8
Final simplification10.5
herbie shell --seed 2020121 +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))))