x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \le -2.08074360009009519 \cdot 10^{182} \lor \neg \left(z \le 1.0190187249698245 \cdot 10^{82}\right):\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t - x}{\frac{a - z}{y - z}} + x\\
\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 (((z <= -2.0807436000900952e+182) || !(z <= 1.0190187249698245e+82))) {
VAR = ((double) fma(y, ((double) (((double) (x / z)) - ((double) (t / z)))), t));
} else {
VAR = ((double) (((double) (((double) (t - x)) / ((double) (((double) (a - z)) / ((double) (y - z)))))) + x));
}
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.3 |
|---|---|
| Target | 11.9 |
| Herbie | 10.2 |
if z < -2.0807436000900952e+182 or 1.0190187249698245e+82 < z Initial program 45.0
Simplified21.4
Taylor expanded around inf 25.8
Simplified17.1
if -2.0807436000900952e+182 < z < 1.0190187249698245e+82Initial program 14.5
Simplified7.1
rmApplied clear-num7.1
rmApplied fma-udef7.1
Simplified7.0
Final simplification10.2
herbie shell --seed 2020113 +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))))