\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x1 \le 2.12089080810546861 \cdot 10^{-4}:\\
\;\;\;\;{\left({e}^{\left(\sqrt[3]{\log \left(\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{fma}\left({x0}^{\frac{2}{3}}, \frac{\sqrt[3]{x0}}{1 - x1}, -x0\right)\right)}\right)}\right)}^{\left(\sqrt[3]{\log \left(\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 r258844 = x0;
double r258845 = 1.0;
double r258846 = x1;
double r258847 = r258845 - r258846;
double r258848 = r258844 / r258847;
double r258849 = r258848 - r258844;
return r258849;
}
double f(double x0, double x1) {
double r258850 = x1;
double r258851 = 0.00021208908081054686;
bool r258852 = r258850 <= r258851;
double r258853 = exp(1.0);
double r258854 = x0;
double r258855 = 0.6666666666666666;
double r258856 = pow(r258854, r258855);
double r258857 = cbrt(r258854);
double r258858 = 1.0;
double r258859 = r258858 - r258850;
double r258860 = r258857 / r258859;
double r258861 = -r258854;
double r258862 = fma(r258856, r258860, r258861);
double r258863 = log(r258862);
double r258864 = cbrt(r258863);
double r258865 = r258864 * r258864;
double r258866 = pow(r258853, r258865);
double r258867 = pow(r258866, r258864);
double r258868 = sqrt(r258854);
double r258869 = sqrt(r258858);
double r258870 = sqrt(r258850);
double r258871 = r258869 + r258870;
double r258872 = r258868 / r258871;
double r258873 = r258869 - r258870;
double r258874 = r258868 / r258873;
double r258875 = fma(r258872, r258874, r258861);
double r258876 = r258852 ? r258867 : r258875;
return r258876;
}




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 pow-unpow8.9
if 0.00021208908081054686 < x1 Initial program 4.5
rmApplied add-sqr-sqrt4.5
Applied add-sqr-sqrt4.5
Applied difference-of-squares4.5
Applied add-sqr-sqrt4.5
Applied times-frac5.2
Applied fma-neg3.2
Final simplification6.1
herbie shell --seed 2020047 +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))