x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -1.13367789971176297 \cdot 10^{-127} \lor \neg \left(a \le 4.19833621218422872 \cdot 10^{-156}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\frac{a - z}{y - z}}, t - x, x\right)\\
\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 ((double) (x + ((double) (((double) (((double) (y - z)) * ((double) (t - x)))) / ((double) (a - z))))));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((a <= -1.133677899711763e-127) || !(a <= 4.1983362121842287e-156))) {
VAR = ((double) fma(((double) (1.0 / ((double) (((double) (a - z)) / ((double) (y - z)))))), ((double) (t - x)), x));
} else {
VAR = ((double) fma(y, ((double) (((double) (x / z)) - ((double) (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.8 |
|---|---|
| Target | 12.1 |
| Herbie | 10.1 |
if a < -1.133677899711763e-127 or 4.1983362121842287e-156 < a Initial program 23.2
Simplified9.1
rmApplied clear-num9.2
if -1.133677899711763e-127 < a < 4.1983362121842287e-156Initial program 29.8
Simplified20.3
Taylor expanded around inf 14.3
Simplified12.8
Final simplification10.1
herbie shell --seed 2020123 +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))))