x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \le -2.13818177103117769 \cdot 10^{136}:\\
\;\;\;\;\frac{y}{z} \cdot \left(x - t\right) + t\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\
\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 ((z <= -2.1381817710311777e+136)) {
VAR = ((double) (((double) ((y / z) * ((double) (x - t)))) + t));
} else {
VAR = ((double) (x + (((double) (t - x)) / (((double) (a - z)) / ((double) (y - z))))));
}
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 | 10.7 |
if z < -2.13818177103117769e136Initial program 47.5
Taylor expanded around inf 24.2
Simplified15.6
if -2.13818177103117769e136 < z Initial program 20.6
rmApplied add-cube-cbrt21.1
Applied times-frac10.7
rmApplied pow110.7
Applied pow110.7
Applied pow-prod-down10.7
Simplified9.8
Final simplification10.7
herbie shell --seed 2020181
(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))))