x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -4.4256913699412465 \cdot 10^{-114} \lor \neg \left(a \le 9.14085606067376745 \cdot 10^{-157}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\
\end{array}double code(double x, double y, double z, double t, double a) {
return ((double) (x + (((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 <= -4.4256913699412465e-114) || !(a <= 9.140856060673767e-157))) {
VAR = ((double) (x + ((double) (((double) (y - z)) * (((double) (t - x)) / ((double) (a - z)))))));
} else {
VAR = ((double) (t + ((double) ((y / z) * ((double) (x - 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 | 25.1 |
|---|---|
| Target | 12.7 |
| Herbie | 11.6 |
if a < -4.4256913699412465e-114 or 9.14085606067376745e-157 < a Initial program 23.6
Simplified12.0
if -4.4256913699412465e-114 < a < 9.14085606067376745e-157Initial program 29.8
Simplified24.8
rmApplied add-cube-cbrt25.5
Applied add-cube-cbrt25.6
Applied times-frac25.7
Applied associate-*r*20.0
Simplified20.1
rmApplied associate-*r*19.2
Taylor expanded around inf 15.2
Simplified10.1
Final simplification11.6
herbie shell --seed 2020182
(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))))