x \cdot \log \left(\frac{x}{y}\right) - z\begin{array}{l}
\mathbf{if}\;y \le -5.330202515239102447628611255442331031352 \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 \log \left(\frac{\sqrt{x}}{\sqrt{y}}\right) + x \cdot \log \left(\frac{\sqrt{x}}{\sqrt{y}}\right)\right) - z\\
\end{array}double f(double x, double y, double z) {
double r89794537 = x;
double r89794538 = y;
double r89794539 = r89794537 / r89794538;
double r89794540 = log(r89794539);
double r89794541 = r89794537 * r89794540;
double r89794542 = z;
double r89794543 = r89794541 - r89794542;
return r89794543;
}
double f(double x, double y, double z) {
double r89794544 = y;
double r89794545 = -5.3302025152391e-309;
bool r89794546 = r89794544 <= r89794545;
double r89794547 = x;
double r89794548 = -1.0;
double r89794549 = r89794548 / r89794544;
double r89794550 = log(r89794549);
double r89794551 = r89794548 / r89794547;
double r89794552 = log(r89794551);
double r89794553 = r89794550 - r89794552;
double r89794554 = r89794547 * r89794553;
double r89794555 = z;
double r89794556 = r89794554 - r89794555;
double r89794557 = sqrt(r89794547);
double r89794558 = sqrt(r89794544);
double r89794559 = r89794557 / r89794558;
double r89794560 = log(r89794559);
double r89794561 = r89794547 * r89794560;
double r89794562 = r89794561 + r89794561;
double r89794563 = r89794562 - r89794555;
double r89794564 = r89794546 ? r89794556 : r89794563;
return r89794564;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.1 |
|---|---|
| Target | 7.6 |
| Herbie | 0.2 |
if y < -5.3302025152391e-309Initial program 14.8
Taylor expanded around -inf 0.3
if -5.3302025152391e-309 < y Initial program 15.4
rmApplied add-sqr-sqrt15.4
Applied add-sqr-sqrt15.4
Applied times-frac15.4
Applied log-prod0.1
Applied distribute-lft-in0.1
Final simplification0.2
herbie shell --seed 2019173
(FPCore (x y z)
:name "Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2"
:herbie-target
(if (< y 7.595077799083773e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))