x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -2.3942487448383101 \cdot 10^{-107} \lor \neg \left(a \le 9.9965607899434403 \cdot 10^{-119}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot \left(t - x\right)\\
\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) (((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 <= -2.39424874483831e-107) || !(a <= 9.99656078994344e-119))) {
VAR = ((double) (x + ((double) (((double) (((double) (y - z)) / ((double) (a - z)))) * ((double) (t - x))))));
} else {
VAR = ((double) (t + ((double) (((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 | 24.7 |
|---|---|
| Target | 11.9 |
| Herbie | 9.1 |
if a < -2.3942487448383101e-107 or 9.9965607899434403e-119 < a Initial program 22.7
Simplified11.0
rmApplied clear-num11.3
rmApplied associate-/r/11.0
Applied associate-*r*8.7
Simplified8.6
if -2.3942487448383101e-107 < a < 9.9965607899434403e-119Initial program 29.5
Simplified24.4
Taylor expanded around inf 15.4
Simplified10.4
Final simplification9.1
herbie shell --seed 2020179
(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))))