\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 r194030 = x0;
double r194031 = 1.0;
double r194032 = x1;
double r194033 = r194031 - r194032;
double r194034 = r194030 / r194033;
double r194035 = r194034 - r194030;
return r194035;
}
double f(double x0, double x1) {
double r194036 = x0;
double r194037 = 1.8749218749999998;
bool r194038 = r194036 <= r194037;
double r194039 = sqrt(r194036);
double r194040 = 1.0;
double r194041 = sqrt(r194040);
double r194042 = x1;
double r194043 = sqrt(r194042);
double r194044 = r194041 + r194043;
double r194045 = r194039 / r194044;
double r194046 = r194041 - r194043;
double r194047 = r194039 / r194046;
double r194048 = -r194036;
double r194049 = fma(r194045, r194047, r194048);
double r194050 = 1.0;
double r194051 = exp(r194036);
double r194052 = sqrt(r194051);
double r194053 = r194050 / r194052;
double r194054 = log(r194053);
double r194055 = 3.0;
double r194056 = pow(r194054, r194055);
double r194057 = cbrt(r194036);
double r194058 = r194040 - r194042;
double r194059 = r194057 / r194058;
double r194060 = 0.6666666666666666;
double r194061 = pow(r194036, r194060);
double r194062 = fma(r194059, r194061, r194054);
double r194063 = pow(r194062, r194055);
double r194064 = r194056 + r194063;
double r194065 = r194059 * r194061;
double r194066 = r194062 * r194065;
double r194067 = log(r194052);
double r194068 = r194067 * r194067;
double r194069 = r194066 + r194068;
double r194070 = r194064 / r194069;
double r194071 = r194038 ? r194049 : r194070;
return r194071;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.3 |
| Herbie | 4.4 |
if x0 < 1.8749218749999998Initial program 7.4
rmApplied add-sqr-sqrt7.4
Applied add-sqr-sqrt7.4
Applied difference-of-squares7.4
Applied add-sqr-sqrt7.4
Applied times-frac7.4
Applied fma-neg5.3
if 1.8749218749999998 < x0 Initial program 8.3
rmApplied *-un-lft-identity8.3
Applied add-cube-cbrt8.3
Applied times-frac8.3
Applied fma-neg7.1
rmApplied add-log-exp7.5
Simplified5.8
rmApplied add-sqr-sqrt6.6
Applied *-un-lft-identity6.6
Applied unpow-prod-down6.6
Applied times-frac5.8
Applied log-prod5.7
Simplified5.7
Simplified5.7
rmApplied flip3-+3.6
Simplified3.5
Final simplification4.4
herbie shell --seed 2020083 +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))