\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}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt[3]{x0} \cdot \sqrt[3]{x0}}{\sqrt{1} + \sqrt{x1}}, \frac{\sqrt[3]{x0}}{\sqrt{1} - \sqrt{x1}}, -x0\right)\\
\end{array}double f(double x0, double x1) {
double r179227 = x0;
double r179228 = 1.0;
double r179229 = x1;
double r179230 = r179228 - r179229;
double r179231 = r179227 / r179230;
double r179232 = r179231 - r179227;
return r179232;
}
double f(double x0, double x1) {
double r179233 = x0;
double r179234 = 1.8749218749999998;
bool r179235 = r179233 <= r179234;
double r179236 = sqrt(r179233);
double r179237 = 1.0;
double r179238 = sqrt(r179237);
double r179239 = x1;
double r179240 = sqrt(r179239);
double r179241 = r179238 + r179240;
double r179242 = r179236 / r179241;
double r179243 = r179238 - r179240;
double r179244 = r179236 / r179243;
double r179245 = -r179233;
double r179246 = fma(r179242, r179244, r179245);
double r179247 = cbrt(r179233);
double r179248 = r179247 * r179247;
double r179249 = r179248 / r179241;
double r179250 = r179247 / r179243;
double r179251 = fma(r179249, r179250, r179245);
double r179252 = r179235 ? r179246 : r179251;
return r179252;
}




Bits error versus x0




Bits error versus x1
| Original | 8.0 |
|---|---|
| Target | 0.2 |
| Herbie | 6.2 |
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 add-sqr-sqrt8.4
Applied add-sqr-sqrt8.4
Applied difference-of-squares8.4
Applied add-cube-cbrt8.4
Applied times-frac8.2
Applied fma-neg7.0
Final simplification6.2
herbie shell --seed 2020043 +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))