\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x1 \leq 0.018204597656249998:\\
\;\;\;\;\frac{x0 \cdot \frac{\frac{{\left(\frac{{x0}^{3}}{{\left(1 - x1\right)}^{6}}\right)}^{3} - {\left({x0}^{3}\right)}^{3}}{{x0}^{6} + \frac{{x0}^{6} + \frac{{x0}^{6}}{{\left(1 - x1\right)}^{6}}}{{\left(1 + \sqrt{x1}\right)}^{6} \cdot {\left(1 - \sqrt{x1}\right)}^{6}}}}{x0 \cdot \left(\frac{x0}{{\left(1 - x1\right)}^{4}} + \left(x0 + \frac{x0}{{\left(\sqrt{1 - x1}\right)}^{4}}\right)\right)}}{x0 + \frac{x0}{1 - x1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x0 \cdot \frac{\frac{{x0}^{3}}{{\left(1 + \sqrt{x1}\right)}^{6} \cdot {\left(1 - \sqrt{x1}\right)}^{6}} - {x0}^{3}}{x0 \cdot \left(\frac{x0}{{\left(1 - x1\right)}^{4}} + \left(x0 + \frac{x0}{{\left(\sqrt{1 - x1}\right)}^{4}}\right)\right)}}{x0 + \frac{x0}{1 - x1}}\\
\end{array}(FPCore (x0 x1) :precision binary64 (- (/ x0 (- 1.0 x1)) x0))
(FPCore (x0 x1)
:precision binary64
(if (<= x1 0.018204597656249998)
(/
(*
x0
(/
(/
(-
(pow (/ (pow x0 3.0) (pow (- 1.0 x1) 6.0)) 3.0)
(pow (pow x0 3.0) 3.0))
(+
(pow x0 6.0)
(/
(+ (pow x0 6.0) (/ (pow x0 6.0) (pow (- 1.0 x1) 6.0)))
(* (pow (+ 1.0 (sqrt x1)) 6.0) (pow (- 1.0 (sqrt x1)) 6.0)))))
(*
x0
(+
(/ x0 (pow (- 1.0 x1) 4.0))
(+ x0 (/ x0 (pow (sqrt (- 1.0 x1)) 4.0)))))))
(+ x0 (/ x0 (- 1.0 x1))))
(/
(*
x0
(/
(-
(/
(pow x0 3.0)
(* (pow (+ 1.0 (sqrt x1)) 6.0) (pow (- 1.0 (sqrt x1)) 6.0)))
(pow x0 3.0))
(*
x0
(+
(/ x0 (pow (- 1.0 x1) 4.0))
(+ x0 (/ x0 (pow (sqrt (- 1.0 x1)) 4.0)))))))
(+ x0 (/ x0 (- 1.0 x1))))))double code(double x0, double x1) {
return (x0 / (1.0 - x1)) - x0;
}
double code(double x0, double x1) {
double tmp;
if (x1 <= 0.018204597656249998) {
tmp = (x0 * (((pow((pow(x0, 3.0) / pow((1.0 - x1), 6.0)), 3.0) - pow(pow(x0, 3.0), 3.0)) / (pow(x0, 6.0) + ((pow(x0, 6.0) + (pow(x0, 6.0) / pow((1.0 - x1), 6.0))) / (pow((1.0 + sqrt(x1)), 6.0) * pow((1.0 - sqrt(x1)), 6.0))))) / (x0 * ((x0 / pow((1.0 - x1), 4.0)) + (x0 + (x0 / pow(sqrt(1.0 - x1), 4.0))))))) / (x0 + (x0 / (1.0 - x1)));
} else {
tmp = (x0 * (((pow(x0, 3.0) / (pow((1.0 + sqrt(x1)), 6.0) * pow((1.0 - sqrt(x1)), 6.0))) - pow(x0, 3.0)) / (x0 * ((x0 / pow((1.0 - x1), 4.0)) + (x0 + (x0 / pow(sqrt(1.0 - x1), 4.0))))))) / (x0 + (x0 / (1.0 - x1)));
}
return tmp;
}




Bits error versus x0




Bits error versus x1
Results
| Original | 8.3 |
|---|---|
| Target | 0.5 |
| Herbie | 3.9 |
if x1 < 0.0182045976562499982Initial program 11.3
rmApplied flip--_binary6411.4
Simplified9.1
Simplified9.1
rmApplied flip3--_binary647.8
Simplified7.8
Simplified7.8
rmApplied flip3--_binary646.3
Simplified6.3
rmApplied add-sqr-sqrt_binary646.3
Applied *-un-lft-identity_binary646.3
Applied difference-of-squares_binary646.2
Applied unpow-prod-down_binary646.2
if 0.0182045976562499982 < x1 Initial program 5.5
rmApplied flip--_binary644.0
Simplified4.7
Simplified4.7
rmApplied flip3--_binary644.4
Simplified4.4
Simplified4.4
rmApplied add-sqr-sqrt_binary644.4
Applied *-un-lft-identity_binary644.4
Applied difference-of-squares_binary644.4
Applied unpow-prod-down_binary641.6
Final simplification3.9
herbie shell --seed 2020288
(FPCore (x0 x1)
:name "(- (/ x0 (- 1 x1)) x0)"
:precision binary64
:pre (or (and (== x0 1.855) (== x1 0.000209)) (and (== x0 2.985) (== x1 0.0186)))
:herbie-target
(/ (* x0 x1) (- 1.0 x1))
(- (/ x0 (- 1.0 x1)) x0))