\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 r140281 = x0;
double r140282 = 1.0;
double r140283 = x1;
double r140284 = r140282 - r140283;
double r140285 = r140281 / r140284;
double r140286 = r140285 - r140281;
return r140286;
}
double f(double x0, double x1) {
double r140287 = x0;
double r140288 = 2.9451562499999997;
bool r140289 = r140287 <= r140288;
double r140290 = sqrt(r140287);
double r140291 = 1.0;
double r140292 = sqrt(r140291);
double r140293 = x1;
double r140294 = sqrt(r140293);
double r140295 = r140292 + r140294;
double r140296 = r140290 / r140295;
double r140297 = r140292 - r140294;
double r140298 = r140290 / r140297;
double r140299 = -r140287;
double r140300 = fma(r140296, r140298, r140299);
double r140301 = 0.6666666666666666;
double r140302 = pow(r140287, r140301);
double r140303 = exp(r140302);
double r140304 = cbrt(r140287);
double r140305 = r140291 - r140293;
double r140306 = r140304 / r140305;
double r140307 = pow(r140303, r140306);
double r140308 = exp(r140287);
double r140309 = r140307 / r140308;
double r140310 = log(r140309);
double r140311 = log(r140310);
double r140312 = exp(r140311);
double r140313 = r140289 ? r140300 : r140312;
return r140313;
}




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))