\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 2.9451562499999997:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\log \left(\frac{{\left(e^{{x0}^{\frac{2}{3}}}\right)}^{\left(\frac{\sqrt[3]{x0}}{1 - x1}\right)}}{e^{x0}}\right)\right)}\\
\end{array}double f(double x0, double x1) {
double r224843 = x0;
double r224844 = 1.0;
double r224845 = x1;
double r224846 = r224844 - r224845;
double r224847 = r224843 / r224846;
double r224848 = r224847 - r224843;
return r224848;
}
double f(double x0, double x1) {
double r224849 = x0;
double r224850 = 2.9451562499999997;
bool r224851 = r224849 <= r224850;
double r224852 = sqrt(r224849);
double r224853 = 1.0;
double r224854 = sqrt(r224853);
double r224855 = x1;
double r224856 = sqrt(r224855);
double r224857 = r224854 + r224856;
double r224858 = r224852 / r224857;
double r224859 = r224854 - r224856;
double r224860 = r224852 / r224859;
double r224861 = -r224849;
double r224862 = fma(r224858, r224860, r224861);
double r224863 = 0.6666666666666666;
double r224864 = pow(r224849, r224863);
double r224865 = exp(r224864);
double r224866 = cbrt(r224849);
double r224867 = r224853 - r224855;
double r224868 = r224866 / r224867;
double r224869 = pow(r224865, r224868);
double r224870 = exp(r224849);
double r224871 = r224869 / r224870;
double r224872 = log(r224871);
double r224873 = log(r224872);
double r224874 = exp(r224873);
double r224875 = r224851 ? r224862 : r224874;
return r224875;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 5.5 |
if x0 < 2.9451562499999997Initial program 7.5
rmApplied add-sqr-sqrt7.5
Applied add-sqr-sqrt7.5
Applied difference-of-squares7.5
Applied add-sqr-sqrt7.5
Applied times-frac7.5
Applied fma-neg5.4
if 2.9451562499999997 < x0 Initial program 8.4
rmApplied *-un-lft-identity8.4
Applied add-cube-cbrt8.4
Applied times-frac8.4
Applied fma-neg7.1
rmApplied add-exp-log7.2
rmApplied add-log-exp7.6
Simplified5.6
Final simplification5.5
herbie shell --seed 2020039 +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))