\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 1.87492187499999985:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)}^{3} + {\left(\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right)\right)}^{3}}{\mathsf{fma}\left(\frac{\sqrt[3]{x0}}{1 - x1}, {x0}^{\frac{2}{3}}, \log \left(\frac{1}{\sqrt{e^{x0}}}\right)\right) \cdot \left(\frac{\sqrt[3]{x0}}{1 - x1} \cdot {x0}^{\frac{2}{3}}\right) + \log \left(\sqrt{e^{x0}}\right) \cdot \log \left(\sqrt{e^{x0}}\right)}\\
\end{array}double f(double x0, double x1) {
double r164064 = x0;
double r164065 = 1.0;
double r164066 = x1;
double r164067 = r164065 - r164066;
double r164068 = r164064 / r164067;
double r164069 = r164068 - r164064;
return r164069;
}
double f(double x0, double x1) {
double r164070 = x0;
double r164071 = 1.8749218749999998;
bool r164072 = r164070 <= r164071;
double r164073 = sqrt(r164070);
double r164074 = 1.0;
double r164075 = sqrt(r164074);
double r164076 = x1;
double r164077 = sqrt(r164076);
double r164078 = r164075 + r164077;
double r164079 = r164073 / r164078;
double r164080 = r164075 - r164077;
double r164081 = r164073 / r164080;
double r164082 = -r164070;
double r164083 = fma(r164079, r164081, r164082);
double r164084 = 1.0;
double r164085 = exp(r164070);
double r164086 = sqrt(r164085);
double r164087 = r164084 / r164086;
double r164088 = log(r164087);
double r164089 = 3.0;
double r164090 = pow(r164088, r164089);
double r164091 = cbrt(r164070);
double r164092 = r164074 - r164076;
double r164093 = r164091 / r164092;
double r164094 = 0.6666666666666666;
double r164095 = pow(r164070, r164094);
double r164096 = fma(r164093, r164095, r164088);
double r164097 = pow(r164096, r164089);
double r164098 = r164090 + r164097;
double r164099 = r164093 * r164095;
double r164100 = r164096 * r164099;
double r164101 = log(r164086);
double r164102 = r164101 * r164101;
double r164103 = r164100 + r164102;
double r164104 = r164098 / r164103;
double r164105 = r164072 ? r164083 : r164104;
return r164105;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 4.5 |
if x0 < 1.8749218749999998Initial 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 1.8749218749999998 < x0 Initial program 8.4
rmApplied *-un-lft-identity8.4
Applied add-cube-cbrt8.4
Applied times-frac8.4
Applied fma-neg7.2
rmApplied add-log-exp7.6
Simplified5.9
rmApplied add-sqr-sqrt6.7
Applied *-un-lft-identity6.7
Applied unpow-prod-down6.7
Applied times-frac5.9
Applied log-prod5.8
Simplified5.8
Simplified5.8
rmApplied flip3-+3.6
Simplified3.5
Final simplification4.5
herbie shell --seed 2020035 +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))