x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \leq -2.2761584503191938 \cdot 10^{+195} \lor \neg \left(z \leq 3.336535496648698 \cdot 10^{+182}\right):\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}{\sqrt[3]{a - z}} \cdot \left(\frac{t - x}{\sqrt[3]{a - z}} \cdot \frac{\sqrt[3]{y - z}}{\sqrt[3]{a - z}}\right)\\
\end{array}(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) (- t x)) (- a z))))
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -2.2761584503191938e+195) (not (<= z 3.336535496648698e+182)))
(+ t (* y (- (/ x z) (/ t z))))
(+
x
(*
(/ (* (cbrt (- y z)) (cbrt (- y z))) (cbrt (- a z)))
(* (/ (- t x) (cbrt (- a z))) (/ (cbrt (- y z)) (cbrt (- a z))))))))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 tmp;
if ((z <= -2.2761584503191938e+195) || !(z <= 3.336535496648698e+182)) {
tmp = t + (y * ((x / z) - (t / z)));
} else {
tmp = x + (((cbrt(y - z) * cbrt(y - z)) / cbrt(a - z)) * (((t - x) / cbrt(a - z)) * (cbrt(y - z) / cbrt(a - z))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 24.2 |
|---|---|
| Target | 11.6 |
| Herbie | 9.6 |
if z < -2.2761584503191938e195 or 3.336535496648698e182 < z Initial program 48.8
Taylor expanded around inf 23.7
Simplified14.1
if -2.2761584503191938e195 < z < 3.336535496648698e182Initial program 17.1
rmApplied add-cube-cbrt_binary6417.7
Applied times-frac_binary648.7
rmApplied add-cube-cbrt_binary648.7
Applied times-frac_binary648.7
Applied associate-*l*_binary648.4
Simplified8.4
Final simplification9.6
herbie shell --seed 2020270
(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))))