\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x1 \le 2.12089080810546861 \cdot 10^{-4}:\\
\;\;\;\;{e}^{\left(2 \cdot \log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)} \cdot {e}^{\left(\log \left(\sqrt[3]{\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\end{array}double f(double x0, double x1) {
double r317531 = x0;
double r317532 = 1.0;
double r317533 = x1;
double r317534 = r317532 - r317533;
double r317535 = r317531 / r317534;
double r317536 = r317535 - r317531;
return r317536;
}
double f(double x0, double x1) {
double r317537 = x1;
double r317538 = 0.00021208908081054686;
bool r317539 = r317537 <= r317538;
double r317540 = exp(1.0);
double r317541 = 2.0;
double r317542 = x0;
double r317543 = 0.6666666666666666;
double r317544 = pow(r317542, r317543);
double r317545 = cbrt(r317542);
double r317546 = 1.0;
double r317547 = r317546 - r317537;
double r317548 = r317545 / r317547;
double r317549 = -r317542;
double r317550 = fma(r317544, r317548, r317549);
double r317551 = cbrt(r317550);
double r317552 = log(r317551);
double r317553 = r317541 * r317552;
double r317554 = pow(r317540, r317553);
double r317555 = pow(r317540, r317552);
double r317556 = r317554 * r317555;
double r317557 = sqrt(r317542);
double r317558 = sqrt(r317546);
double r317559 = sqrt(r317537);
double r317560 = r317558 + r317559;
double r317561 = r317557 / r317560;
double r317562 = r317558 - r317559;
double r317563 = r317557 / r317562;
double r317564 = fma(r317561, r317563, r317549);
double r317565 = r317539 ? r317556 : r317564;
return r317565;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.3 |
| Herbie | 6.1 |
if x1 < 0.00021208908081054686Initial program 11.2
rmApplied *-un-lft-identity11.2
Applied add-cube-cbrt11.2
Applied times-frac10.9
Applied fma-neg8.9
rmApplied add-exp-log8.9
Simplified8.9
rmApplied pow18.9
Applied log-pow8.9
Applied exp-prod8.9
Simplified8.9
rmApplied add-cube-cbrt8.9
Applied log-prod8.9
Applied unpow-prod-up8.9
Simplified8.9
if 0.00021208908081054686 < x1 Initial program 4.6
rmApplied add-sqr-sqrt4.6
Applied add-sqr-sqrt4.6
Applied difference-of-squares4.6
Applied add-sqr-sqrt4.6
Applied times-frac5.2
Applied fma-neg3.3
Final simplification6.1
herbie shell --seed 2020046 +o rules:numerics
(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 x1))
(- (/ x0 (- 1 x1)) x0))