x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -2.09938613345198371 \cdot 10^{-224} \lor \neg \left(a \le 1.7180529759557746 \cdot 10^{-147}\right):\\
\;\;\;\;\left(y - x\right) \cdot \frac{z - t}{a - t} + x\\
\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 <= -2.0993861334519837e-224) || !(a <= 1.7180529759557746e-147))) {
VAR = ((double) (((double) (((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.6 |
|---|---|
| Target | 9.5 |
| Herbie | 10.7 |
if a < -2.0993861334519837e-224 or 1.7180529759557746e-147 < a Initial program 23.5
Simplified12.4
rmApplied fma-udef12.5
rmApplied div-inv12.6
Applied associate-*l*10.2
Simplified10.1
if -2.0993861334519837e-224 < a < 1.7180529759557746e-147Initial program 30.3
Simplified24.9
rmApplied fma-udef24.9
rmApplied div-inv25.0
Applied associate-*l*19.9
Simplified19.8
Taylor expanded around inf 13.9
Simplified13.4
Final simplification10.7
herbie shell --seed 2020122 +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))))