x \cdot \log \left(\frac{x}{y}\right) - z\begin{array}{l}
\mathbf{if}\;y \le -5.435048613210959909118539310961078344525 \cdot 10^{-309}:\\
\;\;\;\;x \cdot \left(\log \left(\frac{-1}{y}\right) - \log \left(\frac{-1}{x}\right)\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{{x}^{\frac{2}{3}}} \cdot \sqrt[3]{\sqrt[3]{x}}}{\sqrt[3]{y}}\right)\right) - z\\
\end{array}double f(double x, double y, double z) {
double r331616 = x;
double r331617 = y;
double r331618 = r331616 / r331617;
double r331619 = log(r331618);
double r331620 = r331616 * r331619;
double r331621 = z;
double r331622 = r331620 - r331621;
return r331622;
}
double f(double x, double y, double z) {
double r331623 = y;
double r331624 = -5.43504861321096e-309;
bool r331625 = r331623 <= r331624;
double r331626 = x;
double r331627 = -1.0;
double r331628 = r331627 / r331623;
double r331629 = log(r331628);
double r331630 = r331627 / r331626;
double r331631 = log(r331630);
double r331632 = r331629 - r331631;
double r331633 = r331626 * r331632;
double r331634 = z;
double r331635 = r331633 - r331634;
double r331636 = 2.0;
double r331637 = cbrt(r331626);
double r331638 = cbrt(r331623);
double r331639 = r331637 / r331638;
double r331640 = log(r331639);
double r331641 = r331636 * r331640;
double r331642 = r331626 * r331641;
double r331643 = 0.6666666666666666;
double r331644 = pow(r331626, r331643);
double r331645 = cbrt(r331644);
double r331646 = cbrt(r331637);
double r331647 = r331645 * r331646;
double r331648 = r331647 / r331638;
double r331649 = log(r331648);
double r331650 = r331626 * r331649;
double r331651 = r331642 + r331650;
double r331652 = r331651 - r331634;
double r331653 = r331625 ? r331635 : r331652;
return r331653;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.8 |
|---|---|
| Target | 8.2 |
| Herbie | 0.3 |
if y < -5.43504861321096e-309Initial program 16.3
Taylor expanded around -inf 0.3
if -5.43504861321096e-309 < y Initial program 15.2
rmApplied add-cube-cbrt15.2
Applied add-cube-cbrt15.2
Applied times-frac15.2
Applied log-prod3.7
Applied distribute-lft-in3.7
Simplified0.2
rmApplied add-cube-cbrt0.2
Applied cbrt-prod0.2
Simplified0.2
Final simplification0.3
herbie shell --seed 2019323 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< y 7.595077799083773e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))