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 r287483 = x;
double r287484 = y;
double r287485 = r287483 / r287484;
double r287486 = log(r287485);
double r287487 = r287483 * r287486;
double r287488 = z;
double r287489 = r287487 - r287488;
return r287489;
}
double f(double x, double y, double z) {
double r287490 = y;
double r287491 = -5.43504861321096e-309;
bool r287492 = r287490 <= r287491;
double r287493 = x;
double r287494 = -1.0;
double r287495 = r287494 / r287490;
double r287496 = log(r287495);
double r287497 = r287494 / r287493;
double r287498 = log(r287497);
double r287499 = r287496 - r287498;
double r287500 = r287493 * r287499;
double r287501 = z;
double r287502 = r287500 - r287501;
double r287503 = 2.0;
double r287504 = cbrt(r287493);
double r287505 = cbrt(r287490);
double r287506 = r287504 / r287505;
double r287507 = log(r287506);
double r287508 = r287503 * r287507;
double r287509 = r287493 * r287508;
double r287510 = 0.6666666666666666;
double r287511 = pow(r287493, r287510);
double r287512 = cbrt(r287511);
double r287513 = cbrt(r287504);
double r287514 = r287512 * r287513;
double r287515 = r287514 / r287505;
double r287516 = log(r287515);
double r287517 = r287493 * r287516;
double r287518 = r287509 + r287517;
double r287519 = r287518 - r287501;
double r287520 = r287492 ? r287502 : r287519;
return r287520;
}




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