x \cdot \log \left(\frac{x}{y}\right) - z\begin{array}{l}
\mathbf{if}\;x \le -1.0411648480087909 \cdot 10^{-94}:\\
\;\;\;\;\left(\left(\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) \cdot 1\right) \cdot x + x \cdot \log \left(\frac{{\left(-1 \cdot x\right)}^{\frac{1}{3}} \cdot \sqrt[3]{-1}}{\sqrt[3]{y}}\right)\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) \cdot 1\right) \cdot x + x \cdot \log \left(\frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{x}\right)\right)}{\sqrt[3]{y}}\right)\right) - z\\
\end{array}double f(double x, double y, double z) {
double r535516 = x;
double r535517 = y;
double r535518 = r535516 / r535517;
double r535519 = log(r535518);
double r535520 = r535516 * r535519;
double r535521 = z;
double r535522 = r535520 - r535521;
return r535522;
}
double f(double x, double y, double z) {
double r535523 = x;
double r535524 = -1.0411648480087909e-94;
bool r535525 = r535523 <= r535524;
double r535526 = 2.0;
double r535527 = cbrt(r535523);
double r535528 = y;
double r535529 = cbrt(r535528);
double r535530 = r535527 / r535529;
double r535531 = log(r535530);
double r535532 = r535526 * r535531;
double r535533 = 1.0;
double r535534 = r535532 * r535533;
double r535535 = r535534 * r535523;
double r535536 = -1.0;
double r535537 = r535536 * r535523;
double r535538 = 0.3333333333333333;
double r535539 = pow(r535537, r535538);
double r535540 = cbrt(r535536);
double r535541 = r535539 * r535540;
double r535542 = r535541 / r535529;
double r535543 = log(r535542);
double r535544 = r535523 * r535543;
double r535545 = r535535 + r535544;
double r535546 = z;
double r535547 = r535545 - r535546;
double r535548 = log1p(r535527);
double r535549 = expm1(r535548);
double r535550 = r535549 / r535529;
double r535551 = log(r535550);
double r535552 = r535523 * r535551;
double r535553 = r535535 + r535552;
double r535554 = r535553 - r535546;
double r535555 = r535525 ? r535547 : r535554;
return r535555;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.2 |
|---|---|
| Target | 7.9 |
| Herbie | 0.2 |
if x < -1.0411648480087909e-94Initial program 13.1
rmApplied add-cube-cbrt13.1
Applied add-cube-cbrt13.1
Applied times-frac13.1
Applied log-prod2.9
Applied distribute-lft-in2.9
Simplified0.3
Taylor expanded around -inf 0.3
if -1.0411648480087909e-94 < x Initial program 16.2
rmApplied add-cube-cbrt16.2
Applied add-cube-cbrt16.2
Applied times-frac16.2
Applied log-prod3.9
Applied distribute-lft-in3.9
Simplified0.2
rmApplied expm1-log1p-u0.2
Final simplification0.2
herbie shell --seed 2020024 +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))