x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\begin{array}{l}
\mathbf{if}\;a \le -3.30719100249080935 \cdot 10^{-173} \lor \neg \left(a \le 5.5692471279112897 \cdot 10^{-284}\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 <= -3.307191002490809e-173) || !(a <= 5.56924712791129e-284))) {
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.0 |
|---|---|
| Target | 9.0 |
| Herbie | 10.3 |
if a < -3.307191002490809e-173 or 5.56924712791129e-284 < a Initial program 23.2
Simplified12.8
rmApplied fma-udef12.9
rmApplied div-inv12.9
Applied associate-*l*10.3
Simplified10.2
rmApplied fma-def10.2
if -3.307191002490809e-173 < a < 5.56924712791129e-284Initial program 29.7
Simplified26.1
rmApplied fma-udef26.1
rmApplied div-inv26.2
Applied associate-*l*20.4
Simplified20.3
Taylor expanded around inf 11.7
Simplified11.1
Final simplification10.3
herbie shell --seed 2020120 +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))))