\frac{x0}{1 - x1} - x0\begin{array}{l}
\mathbf{if}\;x0 \le 1.874921874999999849009668650978710502386:\\
\;\;\;\;\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 r163513 = x0;
double r163514 = 1.0;
double r163515 = x1;
double r163516 = r163514 - r163515;
double r163517 = r163513 / r163516;
double r163518 = r163517 - r163513;
return r163518;
}
double f(double x0, double x1) {
double r163519 = x0;
double r163520 = 1.8749218749999998;
bool r163521 = r163519 <= r163520;
double r163522 = sqrt(r163519);
double r163523 = 1.0;
double r163524 = sqrt(r163523);
double r163525 = x1;
double r163526 = sqrt(r163525);
double r163527 = r163524 + r163526;
double r163528 = r163522 / r163527;
double r163529 = r163524 - r163526;
double r163530 = r163522 / r163529;
double r163531 = -r163519;
double r163532 = fma(r163528, r163530, r163531);
double r163533 = 1.0;
double r163534 = exp(r163519);
double r163535 = sqrt(r163534);
double r163536 = r163533 / r163535;
double r163537 = log(r163536);
double r163538 = 3.0;
double r163539 = pow(r163537, r163538);
double r163540 = cbrt(r163519);
double r163541 = r163523 - r163525;
double r163542 = r163540 / r163541;
double r163543 = 0.6666666666666666;
double r163544 = pow(r163519, r163543);
double r163545 = fma(r163542, r163544, r163537);
double r163546 = pow(r163545, r163538);
double r163547 = r163539 + r163546;
double r163548 = r163542 * r163544;
double r163549 = r163545 * r163548;
double r163550 = log(r163535);
double r163551 = r163550 * r163550;
double r163552 = r163549 + r163551;
double r163553 = r163547 / r163552;
double r163554 = r163521 ? r163532 : r163553;
return r163554;
}




Bits error versus x0




Bits error versus x1
| Original | 7.8 |
|---|---|
| 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.4
if 1.8749218749999998 < x0 Initial program 8.2
rmApplied *-un-lft-identity8.2
Applied add-cube-cbrt8.2
Applied times-frac8.2
Applied fma-neg7.0
rmApplied add-log-exp7.5
Simplified5.7
rmApplied add-sqr-sqrt6.4
Applied *-un-lft-identity6.4
Applied unpow-prod-down6.4
Applied times-frac5.7
Applied log-prod5.7
Simplified5.7
Simplified5.7
rmApplied flip3-+3.5
Simplified3.5
Final simplification4.4
herbie shell --seed 2020001 +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))