x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -6.4366997153948992 \cdot 10^{-217} \lor \neg \left(a \le 1.41067993913888447 \cdot 10^{-238}\right):\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}} - \left(\frac{x}{\frac{a - z}{y - z}} - x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, x - t, 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 <= -6.436699715394899e-217) || !(a <= 1.4106799391388845e-238))) {
VAR = ((t / ((a - z) / (y - z))) - ((x / ((a - z) / (y - z))) - x));
} else {
VAR = fma((y / z), (x - t), 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.8 |
|---|---|
| Target | 11.8 |
| Herbie | 6.8 |
if a < -6.436699715394899e-217 or 1.4106799391388845e-238 < a Initial program 24.0
Simplified10.5
rmApplied clear-num10.6
rmApplied fma-udef10.6
Simplified10.5
rmApplied div-sub10.5
Applied associate-+l-7.0
if -6.436699715394899e-217 < a < 1.4106799391388845e-238Initial program 30.8
Simplified21.9
Taylor expanded around inf 9.2
Simplified5.7
Final simplification6.8
herbie shell --seed 2020078 +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))))