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 r278790 = x;
double r278791 = y;
double r278792 = r278790 / r278791;
double r278793 = log(r278792);
double r278794 = r278790 * r278793;
double r278795 = z;
double r278796 = r278794 - r278795;
return r278796;
}
double f(double x, double y, double z) {
double r278797 = y;
double r278798 = -5.43504861321096e-309;
bool r278799 = r278797 <= r278798;
double r278800 = x;
double r278801 = -1.0;
double r278802 = r278801 / r278797;
double r278803 = log(r278802);
double r278804 = r278801 / r278800;
double r278805 = log(r278804);
double r278806 = r278803 - r278805;
double r278807 = r278800 * r278806;
double r278808 = z;
double r278809 = r278807 - r278808;
double r278810 = 2.0;
double r278811 = cbrt(r278800);
double r278812 = cbrt(r278797);
double r278813 = r278811 / r278812;
double r278814 = log(r278813);
double r278815 = r278810 * r278814;
double r278816 = r278800 * r278815;
double r278817 = 0.6666666666666666;
double r278818 = pow(r278800, r278817);
double r278819 = cbrt(r278818);
double r278820 = cbrt(r278811);
double r278821 = r278819 * r278820;
double r278822 = r278821 / r278812;
double r278823 = log(r278822);
double r278824 = r278800 * r278823;
double r278825 = r278816 + r278824;
double r278826 = r278825 - r278808;
double r278827 = r278799 ? r278809 : r278826;
return r278827;
}




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