x + \frac{\left(y - z\right) \cdot \left(t - x\right)}{a - z}\begin{array}{l}
\mathbf{if}\;z \leq -1.0460208328950513 \cdot 10^{+194} \lor \neg \left(z \leq 6.37987987931022 \cdot 10^{+72} \lor \neg \left(z \leq 1.0088239616805826 \cdot 10^{+149}\right) \land z \leq 3.558503535078779 \cdot 10^{+212}\right):\\
\;\;\;\;t + y \cdot \left(\frac{x}{z} - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y - z\right) \cdot \frac{\sqrt[3]{t - x} \cdot \sqrt[3]{t - x}}{\sqrt[3]{a - z} \cdot \sqrt[3]{a - z}}\right) \cdot \frac{\sqrt[3]{t - x}}{\sqrt[3]{a - z}}\\
\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 -1.0460208328950513e+194)
(not
(or (<= z 6.37987987931022e+72)
(and (not (<= z 1.0088239616805826e+149))
(<= z 3.558503535078779e+212)))))
(+ t (* y (- (/ x z) (/ t z))))
(+
x
(*
(*
(- y z)
(/ (* (cbrt (- t x)) (cbrt (- t x))) (* (cbrt (- a z)) (cbrt (- a z)))))
(/ (cbrt (- t x)) (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 <= -1.0460208328950513e+194) || !((z <= 6.37987987931022e+72) || (!(z <= 1.0088239616805826e+149) && (z <= 3.558503535078779e+212)))) {
tmp = t + (y * ((x / z) - (t / z)));
} else {
tmp = x + (((y - z) * ((cbrt(t - x) * cbrt(t - x)) / (cbrt(a - z) * cbrt(a - z)))) * (cbrt(t - x) / 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.3 |
|---|---|
| Target | 11.7 |
| Herbie | 10.2 |
if z < -1.0460208328950513e194 or 6.3798798793102201e72 < z < 1.00882396168058256e149 or 3.55850353507877901e212 < z Initial program 45.9
Taylor expanded around inf 24.5
Simplified15.6
if -1.0460208328950513e194 < z < 6.3798798793102201e72 or 1.00882396168058256e149 < z < 3.55850353507877901e212Initial program 16.9
rmApplied *-un-lft-identity_binary64_1928616.9
Applied times-frac_binary64_1929210.9
Simplified10.9
rmApplied add-cube-cbrt_binary64_1931811.4
Applied add-cube-cbrt_binary64_1931811.6
Applied times-frac_binary64_1929211.6
Applied associate-*r*_binary64_192288.4
Final simplification10.2
herbie shell --seed 2020281
(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))))