x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \le -5.2475651165603348 \cdot 10^{147} \lor \neg \left(z \le 3.0255949176829831 \cdot 10^{152}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y - z\right) \cdot \frac{1}{a - z}, t - x, x\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 (((z <= -5.247565116560335e+147) || !(z <= 3.025594917682983e+152))) {
VAR = fma(y, ((x / z) - (t / z)), t);
} else {
VAR = fma(((y - z) * (1.0 / (a - z))), (t - x), x);
}
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.5 |
|---|---|
| Target | 11.9 |
| Herbie | 9.6 |
if z < -5.247565116560335e+147 or 3.025594917682983e+152 < z Initial program 47.1
Simplified23.2
Taylor expanded around inf 24.6
Simplified15.8
if -5.247565116560335e+147 < z < 3.025594917682983e+152Initial program 15.2
Simplified6.9
rmApplied div-inv7.0
Final simplification9.6
herbie shell --seed 2020092 +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))))