x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -1.1419396522048079 \cdot 10^{-110} \lor \neg \left(a \le 9.01266496219420966 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{y - z}{a - z} \cdot \left(t - x\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return (x + (((y - z) * (t - x)) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((a <= -1.1419396522048079e-110) || !(a <= 9.01266496219421e-152))) {
VAR = ((((y - z) / (a - z)) * (t - x)) + x);
} else {
VAR = fma(y, ((x / z) - (t / z)), 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 | 12.2 |
| Herbie | 10.1 |
if a < -1.1419396522048079e-110 or 9.01266496219421e-152 < a Initial program 22.4
Simplified9.3
rmApplied fma-udef9.3
if -1.1419396522048079e-110 < a < 9.01266496219421e-152Initial program 30.1
Simplified20.4
Taylor expanded around inf 15.1
Simplified12.4
Final simplification10.1
herbie shell --seed 2020105 +o rules:numerics
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:invLinMap from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< z -1.2536131056095036e+188) (- t (* (/ y z) (- t x))) (if (< z 4.446702369113811e+64) (+ x (/ (- y z) (/ (- a z) (- t x)))) (- t (* (/ y z) (- t x)))))
(+ x (/ (* (- y z) (- t x)) (- a z))))