x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;a \le -9.56944376288991126 \cdot 10^{-141} \lor \neg \left(a \le 8.7838325036490706 \cdot 10^{-87}\right):\\
\;\;\;\;\left(\sqrt[3]{\frac{y - z}{a - z} \cdot \left(t - x\right)} \cdot \sqrt[3]{\frac{y - z}{a - z} \cdot \left(t - x\right)}\right) \cdot \left(\sqrt[3]{\frac{y - z}{a - z}} \cdot \sqrt[3]{t - x}\right) + x\\
\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 <= -9.569443762889911e-141) || !(a <= 8.78383250364907e-87))) {
VAR = ((double) (((double) (((double) (((double) cbrt(((double) (((double) (((double) (y - z)) / ((double) (a - z)))) * ((double) (t - x)))))) * ((double) cbrt(((double) (((double) (((double) (y - z)) / ((double) (a - z)))) * ((double) (t - x)))))))) * ((double) (((double) cbrt(((double) (((double) (y - z)) / ((double) (a - z)))))) * ((double) cbrt(((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.4 |
|---|---|
| Target | 12.3 |
| Herbie | 10.3 |
if a < -9.569443762889911e-141 or 8.78383250364907e-87 < a Initial program 22.5
Simplified8.5
rmApplied fma-udef8.5
rmApplied add-cube-cbrt9.0
rmApplied cbrt-prod9.0
if -9.569443762889911e-141 < a < 8.78383250364907e-87Initial program 29.4
Simplified19.8
Taylor expanded around inf 16.2
Simplified13.8
Final simplification10.3
herbie shell --seed 2020122 +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))))