x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \le -6.06420332548427723 \cdot 10^{171}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \le -1.70088398145157717 \cdot 10^{84}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t - x}{a - z}, y - z, x\right)\\
\mathbf{elif}\;z \le -4.4075266371189889 \cdot 10^{48}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x}{z} - \frac{t}{z}, t\right)\\
\mathbf{elif}\;z \le 2.1885508948319571 \cdot 10^{182}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\frac{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}{1}}, \frac{\sqrt[3]{t - x}}{\frac{\sqrt[3]{a - z}}{y - z}}, x\right)\\
\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 (x + (((y - z) * (t - x)) / (a - z)));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if ((z <= -6.064203325484277e+171)) {
VAR = fma(y, ((x / z) - (t / z)), t);
} else {
double VAR_1;
if ((z <= -1.7008839814515772e+84)) {
VAR_1 = fma(((t - x) / (a - z)), (y - z), x);
} else {
double VAR_2;
if ((z <= -4.407526637118989e+48)) {
VAR_2 = fma(y, ((x / z) - (t / z)), t);
} else {
double VAR_3;
if ((z <= 2.188550894831957e+182)) {
VAR_3 = fma(((cbrt((t - x)) * cbrt((t - x))) / ((cbrt((a - z)) * cbrt((a - z))) / 1.0)), (cbrt((t - x)) / (cbrt((a - z)) / (y - z))), x);
} else {
VAR_3 = fma(y, ((x / z) - (t / z)), t);
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
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.3 |
if z < -6.064203325484277e+171 or -1.7008839814515772e+84 < z < -4.407526637118989e+48 or 2.188550894831957e+182 < z Initial program 46.0
Simplified21.5
Taylor expanded around inf 23.9
Simplified15.5
if -6.064203325484277e+171 < z < -1.7008839814515772e+84Initial program 34.0
Simplified16.1
rmApplied clear-num16.1
rmApplied fma-udef16.2
Simplified16.1
rmApplied associate-/r/17.4
Applied fma-def17.3
if -4.407526637118989e+48 < z < 2.188550894831957e+182Initial program 13.8
Simplified7.2
rmApplied clear-num7.3
rmApplied fma-udef7.3
Simplified7.2
rmApplied *-un-lft-identity7.2
Applied add-cube-cbrt7.8
Applied times-frac7.8
Applied add-cube-cbrt7.9
Applied times-frac7.3
Applied fma-def7.2
Final simplification10.3
herbie shell --seed 2020079 +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))))