\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 2.14828124999999925393012745189480483532:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right) + \left(\left(-x0\right) + x0\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\mathsf{fma}\left(\frac{{x0}^{\frac{2}{3}}}{\sqrt{1} + \sqrt{x1}}, \sqrt[3]{\sqrt{x0}} \cdot \frac{\sqrt[3]{\sqrt{x0}}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\right)}^{3}} + \left(\left(-x0\right) + x0\right)\\
\end{array}double f(double x0, double x1) {
double r175027 = x0;
double r175028 = 1.0;
double r175029 = x1;
double r175030 = r175028 - r175029;
double r175031 = r175027 / r175030;
double r175032 = r175031 - r175027;
return r175032;
}
double f(double x0, double x1) {
double r175033 = x0;
double r175034 = 2.1482812499999993;
bool r175035 = r175033 <= r175034;
double r175036 = sqrt(r175033);
double r175037 = 1.0;
double r175038 = sqrt(r175037);
double r175039 = x1;
double r175040 = sqrt(r175039);
double r175041 = r175038 + r175040;
double r175042 = r175036 / r175041;
double r175043 = r175038 - r175040;
double r175044 = r175036 / r175043;
double r175045 = -r175033;
double r175046 = fma(r175042, r175044, r175045);
double r175047 = r175045 + r175033;
double r175048 = r175046 + r175047;
double r175049 = 0.6666666666666666;
double r175050 = pow(r175033, r175049);
double r175051 = r175050 / r175041;
double r175052 = cbrt(r175036);
double r175053 = r175052 / r175043;
double r175054 = r175052 * r175053;
double r175055 = fma(r175051, r175054, r175045);
double r175056 = 3.0;
double r175057 = pow(r175055, r175056);
double r175058 = cbrt(r175057);
double r175059 = r175058 + r175047;
double r175060 = r175035 ? r175048 : r175059;
return r175060;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 5.6 |
if x0 < 2.1482812499999993Initial program 7.4
rmApplied add-sqr-sqrt7.4
Applied add-sqr-sqrt7.4
Applied add-sqr-sqrt7.4
Applied difference-of-squares7.4
Applied add-sqr-sqrt7.4
Applied times-frac7.4
Applied prod-diff7.6
Simplified7.6
Simplified5.3
if 2.1482812499999993 < x0 Initial program 8.4
rmApplied add-sqr-sqrt8.4
Applied add-sqr-sqrt8.4
Applied add-sqr-sqrt8.4
Applied difference-of-squares8.4
Applied add-cube-cbrt8.4
Applied times-frac8.2
Applied prod-diff7.3
Simplified7.3
Simplified7.0
rmApplied add-cbrt-cube7.0
Simplified7.0
rmApplied *-un-lft-identity7.0
Applied add-sqr-sqrt7.0
Applied cbrt-prod7.0
Applied times-frac5.8
Simplified5.8
Final simplification5.6
herbie shell --seed 2019235 +o rules:numerics
(FPCore (x0 x1)
:name "(- (/ x0 (- 1 x1)) x0)"
:precision binary64
:pre (or (and (== x0 1.855) (== x1 2.09000000000000012e-4)) (and (== x0 2.98499999999999988) (== x1 0.018599999999999998)))
:herbie-target
(/ (* x0 x1) (- 1 x1))
(- (/ x0 (- 1 x1)) x0))