\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 r134448 = x0;
double r134449 = 1.0;
double r134450 = x1;
double r134451 = r134449 - r134450;
double r134452 = r134448 / r134451;
double r134453 = r134452 - r134448;
return r134453;
}
double f(double x0, double x1) {
double r134454 = x0;
double r134455 = 2.9451562499999997;
bool r134456 = r134454 <= r134455;
double r134457 = sqrt(r134454);
double r134458 = 1.0;
double r134459 = sqrt(r134458);
double r134460 = x1;
double r134461 = sqrt(r134460);
double r134462 = r134459 + r134461;
double r134463 = r134457 / r134462;
double r134464 = r134459 - r134461;
double r134465 = r134457 / r134464;
double r134466 = -r134454;
double r134467 = fma(r134463, r134465, r134466);
double r134468 = 0.6666666666666666;
double r134469 = pow(r134454, r134468);
double r134470 = exp(r134469);
double r134471 = cbrt(r134454);
double r134472 = r134458 - r134460;
double r134473 = r134471 / r134472;
double r134474 = pow(r134470, r134473);
double r134475 = exp(r134454);
double r134476 = r134474 / r134475;
double r134477 = log(r134476);
double r134478 = log(r134477);
double r134479 = exp(r134478);
double r134480 = r134456 ? r134467 : r134479;
return r134480;
}




Bits error versus x0




Bits error versus x1
| Original | 7.9 |
|---|---|
| Target | 0.2 |
| Herbie | 5.5 |
if x0 < 2.9451562499999997Initial 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 2.9451562499999997 < 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-exp-log7.2
rmApplied add-log-exp7.6
Simplified5.6
Final simplification5.5
herbie shell --seed 2020060 +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))