x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \le -1.79842785462427394 \cdot 10^{199} \lor \neg \left(z \le 4.7025437297321358 \cdot 10^{228}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\
\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 <= -1.798427854624274e+199) || !(z <= 4.702543729732136e+228))) {
VAR = fma(y, ((x / z) - (t / z)), t);
} else {
VAR = (((t - x) / ((a - z) / (y - z))) + 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.6 |
|---|---|
| Target | 11.9 |
| Herbie | 9.5 |
if z < -1.798427854624274e+199 or 4.702543729732136e+228 < z Initial program 50.5
Simplified25.8
Taylor expanded around inf 22.8
Simplified13.2
if -1.798427854624274e+199 < z < 4.702543729732136e+228Initial program 19.4
Simplified8.8
rmApplied clear-num8.8
rmApplied fma-udef8.8
Simplified8.7
Final simplification9.5
herbie shell --seed 2020103 +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))))