x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)\begin{array}{l}
\mathbf{if}\;z \leq -7.990743750263743 \cdot 10^{-268}:\\
\;\;\;\;x \cdot \frac{y}{z} - \left(x \cdot \left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right)\right) \cdot \frac{\sqrt[3]{t}}{1 - z}\\
\mathbf{elif}\;z \leq 1.4490584958334922 \cdot 10^{+107} \lor \neg \left(z \leq 3.4122879858986516 \cdot 10^{+246}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z} - x \cdot \frac{t}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z} - \frac{x}{1 + \sqrt{z}} \cdot \frac{t}{1 - \sqrt{z}}\\
\end{array}(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
(FPCore (x y z t)
:precision binary64
(if (<= z -7.990743750263743e-268)
(- (* x (/ y z)) (* (* x (* (cbrt t) (cbrt t))) (/ (cbrt t) (- 1.0 z))))
(if (or (<= z 1.4490584958334922e+107) (not (<= z 3.4122879858986516e+246)))
(- (* (* x y) (/ 1.0 z)) (* x (/ t (- 1.0 z))))
(- (* x (/ y z)) (* (/ x (+ 1.0 (sqrt z))) (/ t (- 1.0 (sqrt z))))))))double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.990743750263743e-268) {
tmp = (x * (y / z)) - ((x * (cbrt(t) * cbrt(t))) * (cbrt(t) / (1.0 - z)));
} else if ((z <= 1.4490584958334922e+107) || !(z <= 3.4122879858986516e+246)) {
tmp = ((x * y) * (1.0 / z)) - (x * (t / (1.0 - z)));
} else {
tmp = (x * (y / z)) - ((x / (1.0 + sqrt(z))) * (t / (1.0 - sqrt(z))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 4.5 |
|---|---|
| Target | 4.3 |
| Herbie | 5.3 |
if z < -7.9907437502637426e-268Initial program 4.6
rmApplied sub-neg_binary64_148984.6
Applied distribute-rgt-in_binary64_148574.6
Simplified4.6
Simplified4.6
rmApplied *-un-lft-identity_binary64_149054.6
Applied add-cube-cbrt_binary64_149375.1
Applied times-frac_binary64_149115.1
Applied distribute-rgt-neg-in_binary64_148655.1
Applied associate-*r*_binary64_148476.3
Simplified6.3
if -7.9907437502637426e-268 < z < 1.44905849583349222e107 or 3.4122879858986516e246 < z Initial program 5.3
rmApplied sub-neg_binary64_148985.3
Applied distribute-rgt-in_binary64_148575.3
Simplified5.3
Simplified5.3
rmApplied div-inv_binary64_149025.4
Applied associate-*r*_binary64_148475.0
if 1.44905849583349222e107 < z < 3.4122879858986516e246Initial program 1.8
rmApplied sub-neg_binary64_148981.8
Applied distribute-rgt-in_binary64_148571.8
Simplified1.8
Simplified1.8
rmApplied add-sqr-sqrt_binary64_149262.0
Applied *-un-lft-identity_binary64_149052.0
Applied difference-of-squares_binary64_148742.0
Applied *-un-lft-identity_binary64_149052.0
Applied times-frac_binary64_149112.0
Applied distribute-rgt-neg-in_binary64_148652.0
Applied associate-*r*_binary64_148472.8
Simplified2.8
Final simplification5.3
herbie shell --seed 2020281
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< (* x (- (/ y z) (/ t (- 1.0 z)))) -7.623226303312042e-196) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z))))) (if (< (* x (- (/ y z) (/ t (- 1.0 z)))) 1.4133944927702302e-211) (+ (/ (* y x) z) (- (/ (* t x) (- 1.0 z)))) (* x (- (/ y z) (* t (/ 1.0 (- 1.0 z)))))))
(* x (- (/ y z) (/ t (- 1.0 z)))))