Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2

Percentage Accurate: 77.2% → 99.7%
Time: 8.0s
Alternatives: 5
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ x \cdot \log \left(\frac{x}{y}\right) - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
double code(double x, double y, double z) {
	return (x * log((x / y))) - z;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * log((x / y))) - z
end function
public static double code(double x, double y, double z) {
	return (x * Math.log((x / y))) - z;
}
def code(x, y, z):
	return (x * math.log((x / y))) - z
function code(x, y, z)
	return Float64(Float64(x * log(Float64(x / y))) - z)
end
function tmp = code(x, y, z)
	tmp = (x * log((x / y))) - z;
end
code[x_, y_, z_] := N[(N[(x * N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \log \left(\frac{x}{y}\right) - z
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 5 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 77.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \log \left(\frac{x}{y}\right) - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
double code(double x, double y, double z) {
	return (x * log((x / y))) - z;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * log((x / y))) - z
end function
public static double code(double x, double y, double z) {
	return (x * Math.log((x / y))) - z;
}
def code(x, y, z):
	return (x * math.log((x / y))) - z
function code(x, y, z)
	return Float64(Float64(x * log(Float64(x / y))) - z)
end
function tmp = code(x, y, z)
	tmp = (x * log((x / y))) - z;
end
code[x_, y_, z_] := N[(N[(x * N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \log \left(\frac{x}{y}\right) - z
\end{array}

Alternative 1: 99.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot 3\right) - z \end{array} \]
(FPCore (x y z)
 :precision binary64
 (- (* x (* (log (/ (cbrt x) (cbrt y))) 3.0)) z))
double code(double x, double y, double z) {
	return (x * (log((cbrt(x) / cbrt(y))) * 3.0)) - z;
}
public static double code(double x, double y, double z) {
	return (x * (Math.log((Math.cbrt(x) / Math.cbrt(y))) * 3.0)) - z;
}
function code(x, y, z)
	return Float64(Float64(x * Float64(log(Float64(cbrt(x) / cbrt(y))) * 3.0)) - z)
end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[N[(N[Power[x, 1/3], $MachinePrecision] / N[Power[y, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot 3\right) - z
\end{array}
Derivation
  1. Initial program 76.9%

    \[x \cdot \log \left(\frac{x}{y}\right) - z \]
  2. Step-by-step derivation
    1. add-cube-cbrt76.9%

      \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
    2. log-prod76.8%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
    3. pow276.8%

      \[\leadsto x \cdot \left(\log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
  3. Applied egg-rr76.8%

    \[\leadsto x \cdot \color{blue}{\left(\log \left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
  4. Step-by-step derivation
    1. log-pow76.8%

      \[\leadsto x \cdot \left(\color{blue}{2 \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
    2. distribute-lft1-in76.8%

      \[\leadsto x \cdot \color{blue}{\left(\left(2 + 1\right) \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
    3. metadata-eval76.8%

      \[\leadsto x \cdot \left(\color{blue}{3} \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
    4. *-commutative76.8%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
  5. Simplified76.8%

    \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
  6. Step-by-step derivation
    1. cbrt-div99.7%

      \[\leadsto x \cdot \left(\log \color{blue}{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)} \cdot 3\right) - z \]
    2. div-inv99.7%

      \[\leadsto x \cdot \left(\log \color{blue}{\left(\sqrt[3]{x} \cdot \frac{1}{\sqrt[3]{y}}\right)} \cdot 3\right) - z \]
  7. Applied egg-rr99.7%

    \[\leadsto x \cdot \left(\log \color{blue}{\left(\sqrt[3]{x} \cdot \frac{1}{\sqrt[3]{y}}\right)} \cdot 3\right) - z \]
  8. Step-by-step derivation
    1. associate-*r/99.7%

      \[\leadsto x \cdot \left(\log \color{blue}{\left(\frac{\sqrt[3]{x} \cdot 1}{\sqrt[3]{y}}\right)} \cdot 3\right) - z \]
    2. *-rgt-identity99.7%

      \[\leadsto x \cdot \left(\log \left(\frac{\color{blue}{\sqrt[3]{x}}}{\sqrt[3]{y}}\right) \cdot 3\right) - z \]
  9. Simplified99.7%

    \[\leadsto x \cdot \left(\log \color{blue}{\left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)} \cdot 3\right) - z \]
  10. Final simplification99.7%

    \[\leadsto x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot 3\right) - z \]

Alternative 2: 86.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \log \left(\frac{x}{y}\right)\\ \mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{+292}\right):\\ \;\;\;\;x \cdot 0 - z\\ \mathbf{else}:\\ \;\;\;\;t_0 - z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* x (log (/ x y)))))
   (if (or (<= t_0 (- INFINITY)) (not (<= t_0 1e+292)))
     (- (* x 0.0) z)
     (- t_0 z))))
double code(double x, double y, double z) {
	double t_0 = x * log((x / y));
	double tmp;
	if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 1e+292)) {
		tmp = (x * 0.0) - z;
	} else {
		tmp = t_0 - z;
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = x * Math.log((x / y));
	double tmp;
	if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 1e+292)) {
		tmp = (x * 0.0) - z;
	} else {
		tmp = t_0 - z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x * math.log((x / y))
	tmp = 0
	if (t_0 <= -math.inf) or not (t_0 <= 1e+292):
		tmp = (x * 0.0) - z
	else:
		tmp = t_0 - z
	return tmp
function code(x, y, z)
	t_0 = Float64(x * log(Float64(x / y)))
	tmp = 0.0
	if ((t_0 <= Float64(-Inf)) || !(t_0 <= 1e+292))
		tmp = Float64(Float64(x * 0.0) - z);
	else
		tmp = Float64(t_0 - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x * log((x / y));
	tmp = 0.0;
	if ((t_0 <= -Inf) || ~((t_0 <= 1e+292)))
		tmp = (x * 0.0) - z;
	else
		tmp = t_0 - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 1e+292]], $MachinePrecision]], N[(N[(x * 0.0), $MachinePrecision] - z), $MachinePrecision], N[(t$95$0 - z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \log \left(\frac{x}{y}\right)\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 10^{+292}\right):\\
\;\;\;\;x \cdot 0 - z\\

\mathbf{else}:\\
\;\;\;\;t_0 - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x (log.f64 (/.f64 x y))) < -inf.0 or 1e292 < (*.f64 x (log.f64 (/.f64 x y)))

    1. Initial program 6.2%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
    2. Step-by-step derivation
      1. add-cube-cbrt6.2%

        \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
      2. log-prod6.2%

        \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
      3. pow26.2%

        \[\leadsto x \cdot \left(\log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
    3. Applied egg-rr6.2%

      \[\leadsto x \cdot \color{blue}{\left(\log \left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
    4. Step-by-step derivation
      1. log-pow6.2%

        \[\leadsto x \cdot \left(\color{blue}{2 \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
      2. distribute-lft1-in6.2%

        \[\leadsto x \cdot \color{blue}{\left(\left(2 + 1\right) \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
      3. metadata-eval6.2%

        \[\leadsto x \cdot \left(\color{blue}{3} \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
      4. *-commutative6.2%

        \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
    5. Simplified6.2%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
    6. Step-by-step derivation
      1. add-log-exp6.2%

        \[\leadsto x \cdot \color{blue}{\log \left(e^{\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3}\right)} - z \]
      2. exp-to-pow6.2%

        \[\leadsto x \cdot \log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{3}\right)} - z \]
      3. pow36.2%

        \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
      4. add-cube-cbrt6.2%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{x}{y}\right)} - z \]
      5. add-sqr-sqrt5.0%

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\log \left(\frac{x}{y}\right)} \cdot \sqrt{\log \left(\frac{x}{y}\right)}\right)} - z \]
      6. sqrt-unprod5.7%

        \[\leadsto x \cdot \color{blue}{\sqrt{\log \left(\frac{x}{y}\right) \cdot \log \left(\frac{x}{y}\right)}} - z \]
      7. clear-num5.7%

        \[\leadsto x \cdot \sqrt{\log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)} \cdot \log \left(\frac{x}{y}\right)} - z \]
      8. neg-log5.7%

        \[\leadsto x \cdot \sqrt{\color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)} \cdot \log \left(\frac{x}{y}\right)} - z \]
      9. clear-num5.7%

        \[\leadsto x \cdot \sqrt{\left(-\log \left(\frac{y}{x}\right)\right) \cdot \log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)}} - z \]
      10. neg-log10.4%

        \[\leadsto x \cdot \sqrt{\left(-\log \left(\frac{y}{x}\right)\right) \cdot \color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)}} - z \]
      11. sqr-neg10.4%

        \[\leadsto x \cdot \sqrt{\color{blue}{\log \left(\frac{y}{x}\right) \cdot \log \left(\frac{y}{x}\right)}} - z \]
      12. sqrt-unprod0.8%

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\log \left(\frac{y}{x}\right)} \cdot \sqrt{\log \left(\frac{y}{x}\right)}\right)} - z \]
      13. add-sqr-sqrt2.9%

        \[\leadsto x \cdot \color{blue}{\log \left(\frac{y}{x}\right)} - z \]
      14. clear-num1.4%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{1}{\frac{x}{y}}\right)} - z \]
      15. add-sqr-sqrt1.4%

        \[\leadsto x \cdot \log \left(\frac{1}{\color{blue}{\sqrt{\frac{x}{y}} \cdot \sqrt{\frac{x}{y}}}}\right) - z \]
      16. associate-/r*1.4%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{\frac{1}{\sqrt{\frac{x}{y}}}}{\sqrt{\frac{x}{y}}}\right)} - z \]
      17. metadata-eval1.4%

        \[\leadsto x \cdot \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{x}{y}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
      18. sqrt-div1.4%

        \[\leadsto x \cdot \log \left(\frac{\color{blue}{\sqrt{\frac{1}{\frac{x}{y}}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
      19. clear-num1.4%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\color{blue}{\frac{y}{x}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
      20. add-exp-log1.4%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{\color{blue}{e^{\log \left(\frac{x}{y}\right)}}}}\right) - z \]
      21. add-sqr-sqrt0.6%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{e^{\color{blue}{\sqrt{\log \left(\frac{x}{y}\right)} \cdot \sqrt{\log \left(\frac{x}{y}\right)}}}}}\right) - z \]
      22. sqrt-unprod0.6%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{e^{\color{blue}{\sqrt{\log \left(\frac{x}{y}\right) \cdot \log \left(\frac{x}{y}\right)}}}}}\right) - z \]
    7. Applied egg-rr0.0%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt{\frac{x}{y}}\right) - \log \left(\sqrt{\frac{x}{y}}\right)\right)} - z \]
    8. Step-by-step derivation
      1. +-inverses46.6%

        \[\leadsto x \cdot \color{blue}{0} - z \]
    9. Simplified46.6%

      \[\leadsto x \cdot \color{blue}{0} - z \]

    if -inf.0 < (*.f64 x (log.f64 (/.f64 x y))) < 1e292

    1. Initial program 99.5%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot \log \left(\frac{x}{y}\right) \leq -\infty \lor \neg \left(x \cdot \log \left(\frac{x}{y}\right) \leq 10^{+292}\right):\\ \;\;\;\;x \cdot 0 - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \end{array} \]

Alternative 3: 90.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-212}:\\ \;\;\;\;x \cdot \left(-\log \left(\frac{y}{x}\right)\right) - z\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-307}:\\ \;\;\;\;x \cdot 0 - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -2.25e-212)
   (- (* x (- (log (/ y x)))) z)
   (if (<= x -2e-307) (- (* x 0.0) z) (- (* x (- (log x) (log y))) z))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.25e-212) {
		tmp = (x * -log((y / x))) - z;
	} else if (x <= -2e-307) {
		tmp = (x * 0.0) - z;
	} else {
		tmp = (x * (log(x) - log(y))) - z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-2.25d-212)) then
        tmp = (x * -log((y / x))) - z
    else if (x <= (-2d-307)) then
        tmp = (x * 0.0d0) - z
    else
        tmp = (x * (log(x) - log(y))) - z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -2.25e-212) {
		tmp = (x * -Math.log((y / x))) - z;
	} else if (x <= -2e-307) {
		tmp = (x * 0.0) - z;
	} else {
		tmp = (x * (Math.log(x) - Math.log(y))) - z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -2.25e-212:
		tmp = (x * -math.log((y / x))) - z
	elif x <= -2e-307:
		tmp = (x * 0.0) - z
	else:
		tmp = (x * (math.log(x) - math.log(y))) - z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -2.25e-212)
		tmp = Float64(Float64(x * Float64(-log(Float64(y / x)))) - z);
	elseif (x <= -2e-307)
		tmp = Float64(Float64(x * 0.0) - z);
	else
		tmp = Float64(Float64(x * Float64(log(x) - log(y))) - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -2.25e-212)
		tmp = (x * -log((y / x))) - z;
	elseif (x <= -2e-307)
		tmp = (x * 0.0) - z;
	else
		tmp = (x * (log(x) - log(y))) - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -2.25e-212], N[(N[(x * (-N[Log[N[(y / x), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, -2e-307], N[(N[(x * 0.0), $MachinePrecision] - z), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-212}:\\
\;\;\;\;x \cdot \left(-\log \left(\frac{y}{x}\right)\right) - z\\

\mathbf{elif}\;x \leq -2 \cdot 10^{-307}:\\
\;\;\;\;x \cdot 0 - z\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x - \log y\right) - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.2499999999999999e-212

    1. Initial program 83.7%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
    2. Step-by-step derivation
      1. clear-num82.8%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)} - z \]
      2. log-rec83.9%

        \[\leadsto x \cdot \color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)} - z \]
    3. Applied egg-rr83.9%

      \[\leadsto x \cdot \color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)} - z \]

    if -2.2499999999999999e-212 < x < -1.99999999999999982e-307

    1. Initial program 53.7%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
    2. Step-by-step derivation
      1. add-cube-cbrt53.7%

        \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
      2. log-prod53.7%

        \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
      3. pow253.7%

        \[\leadsto x \cdot \left(\log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
    3. Applied egg-rr53.7%

      \[\leadsto x \cdot \color{blue}{\left(\log \left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
    4. Step-by-step derivation
      1. log-pow53.7%

        \[\leadsto x \cdot \left(\color{blue}{2 \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
      2. distribute-lft1-in53.7%

        \[\leadsto x \cdot \color{blue}{\left(\left(2 + 1\right) \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
      3. metadata-eval53.7%

        \[\leadsto x \cdot \left(\color{blue}{3} \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
      4. *-commutative53.7%

        \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
    5. Simplified53.7%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
    6. Step-by-step derivation
      1. add-log-exp53.7%

        \[\leadsto x \cdot \color{blue}{\log \left(e^{\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3}\right)} - z \]
      2. exp-to-pow53.7%

        \[\leadsto x \cdot \log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{3}\right)} - z \]
      3. pow353.7%

        \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
      4. add-cube-cbrt53.7%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{x}{y}\right)} - z \]
      5. add-sqr-sqrt11.1%

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\log \left(\frac{x}{y}\right)} \cdot \sqrt{\log \left(\frac{x}{y}\right)}\right)} - z \]
      6. sqrt-unprod47.3%

        \[\leadsto x \cdot \color{blue}{\sqrt{\log \left(\frac{x}{y}\right) \cdot \log \left(\frac{x}{y}\right)}} - z \]
      7. clear-num47.1%

        \[\leadsto x \cdot \sqrt{\log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)} \cdot \log \left(\frac{x}{y}\right)} - z \]
      8. neg-log47.1%

        \[\leadsto x \cdot \sqrt{\color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)} \cdot \log \left(\frac{x}{y}\right)} - z \]
      9. clear-num47.1%

        \[\leadsto x \cdot \sqrt{\left(-\log \left(\frac{y}{x}\right)\right) \cdot \log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)}} - z \]
      10. neg-log47.1%

        \[\leadsto x \cdot \sqrt{\left(-\log \left(\frac{y}{x}\right)\right) \cdot \color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)}} - z \]
      11. sqr-neg47.1%

        \[\leadsto x \cdot \sqrt{\color{blue}{\log \left(\frac{y}{x}\right) \cdot \log \left(\frac{y}{x}\right)}} - z \]
      12. sqrt-unprod36.0%

        \[\leadsto x \cdot \color{blue}{\left(\sqrt{\log \left(\frac{y}{x}\right)} \cdot \sqrt{\log \left(\frac{y}{x}\right)}\right)} - z \]
      13. add-sqr-sqrt47.1%

        \[\leadsto x \cdot \color{blue}{\log \left(\frac{y}{x}\right)} - z \]
      14. clear-num47.1%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{1}{\frac{x}{y}}\right)} - z \]
      15. add-sqr-sqrt47.1%

        \[\leadsto x \cdot \log \left(\frac{1}{\color{blue}{\sqrt{\frac{x}{y}} \cdot \sqrt{\frac{x}{y}}}}\right) - z \]
      16. associate-/r*47.1%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{\frac{1}{\sqrt{\frac{x}{y}}}}{\sqrt{\frac{x}{y}}}\right)} - z \]
      17. metadata-eval47.1%

        \[\leadsto x \cdot \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{x}{y}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
      18. sqrt-div47.1%

        \[\leadsto x \cdot \log \left(\frac{\color{blue}{\sqrt{\frac{1}{\frac{x}{y}}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
      19. clear-num47.1%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\color{blue}{\frac{y}{x}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
      20. add-exp-log47.1%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{\color{blue}{e^{\log \left(\frac{x}{y}\right)}}}}\right) - z \]
      21. add-sqr-sqrt11.1%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{e^{\color{blue}{\sqrt{\log \left(\frac{x}{y}\right)} \cdot \sqrt{\log \left(\frac{x}{y}\right)}}}}}\right) - z \]
      22. sqrt-unprod46.2%

        \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{e^{\color{blue}{\sqrt{\log \left(\frac{x}{y}\right) \cdot \log \left(\frac{x}{y}\right)}}}}}\right) - z \]
    7. Applied egg-rr46.5%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt{\frac{x}{y}}\right) - \log \left(\sqrt{\frac{x}{y}}\right)\right)} - z \]
    8. Step-by-step derivation
      1. +-inverses85.8%

        \[\leadsto x \cdot \color{blue}{0} - z \]
    9. Simplified85.8%

      \[\leadsto x \cdot \color{blue}{0} - z \]

    if -1.99999999999999982e-307 < x

    1. Initial program 74.7%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
    2. Step-by-step derivation
      1. log-div99.5%

        \[\leadsto x \cdot \color{blue}{\left(\log x - \log y\right)} - z \]
    3. Applied egg-rr99.5%

      \[\leadsto x \cdot \color{blue}{\left(\log x - \log y\right)} - z \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-212}:\\ \;\;\;\;x \cdot \left(-\log \left(\frac{y}{x}\right)\right) - z\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-307}:\\ \;\;\;\;x \cdot 0 - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \]

Alternative 4: 99.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -2e-310)
   (- (* x (- (log (- x)) (log (- y)))) z)
   (- (* x (- (log x) (log y))) z)))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -2e-310) {
		tmp = (x * (log(-x) - log(-y))) - z;
	} else {
		tmp = (x * (log(x) - log(y))) - z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-2d-310)) then
        tmp = (x * (log(-x) - log(-y))) - z
    else
        tmp = (x * (log(x) - log(y))) - z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -2e-310) {
		tmp = (x * (Math.log(-x) - Math.log(-y))) - z;
	} else {
		tmp = (x * (Math.log(x) - Math.log(y))) - z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -2e-310:
		tmp = (x * (math.log(-x) - math.log(-y))) - z
	else:
		tmp = (x * (math.log(x) - math.log(y))) - z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -2e-310)
		tmp = Float64(Float64(x * Float64(log(Float64(-x)) - log(Float64(-y)))) - z);
	else
		tmp = Float64(Float64(x * Float64(log(x) - log(y))) - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -2e-310)
		tmp = (x * (log(-x) - log(-y))) - z;
	else
		tmp = (x * (log(x) - log(y))) - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -2e-310], N[(N[(x * N[(N[Log[(-x)], $MachinePrecision] - N[Log[(-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-310}:\\
\;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right) - z\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x - \log y\right) - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.999999999999994e-310

    1. Initial program 79.3%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
    2. Step-by-step derivation
      1. frac-2neg79.3%

        \[\leadsto x \cdot \log \color{blue}{\left(\frac{-x}{-y}\right)} - z \]
      2. log-div99.5%

        \[\leadsto x \cdot \color{blue}{\left(\log \left(-x\right) - \log \left(-y\right)\right)} - z \]
    3. Applied egg-rr99.5%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(-x\right) - \log \left(-y\right)\right)} - z \]

    if -1.999999999999994e-310 < y

    1. Initial program 74.7%

      \[x \cdot \log \left(\frac{x}{y}\right) - z \]
    2. Step-by-step derivation
      1. log-div99.5%

        \[\leadsto x \cdot \color{blue}{\left(\log x - \log y\right)} - z \]
    3. Applied egg-rr99.5%

      \[\leadsto x \cdot \color{blue}{\left(\log x - \log y\right)} - z \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \]

Alternative 5: 50.8% accurate, 21.4× speedup?

\[\begin{array}{l} \\ x \cdot 0 - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (* x 0.0) z))
double code(double x, double y, double z) {
	return (x * 0.0) - z;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * 0.0d0) - z
end function
public static double code(double x, double y, double z) {
	return (x * 0.0) - z;
}
def code(x, y, z):
	return (x * 0.0) - z
function code(x, y, z)
	return Float64(Float64(x * 0.0) - z)
end
function tmp = code(x, y, z)
	tmp = (x * 0.0) - z;
end
code[x_, y_, z_] := N[(N[(x * 0.0), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
x \cdot 0 - z
\end{array}
Derivation
  1. Initial program 76.9%

    \[x \cdot \log \left(\frac{x}{y}\right) - z \]
  2. Step-by-step derivation
    1. add-cube-cbrt76.9%

      \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
    2. log-prod76.8%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
    3. pow276.8%

      \[\leadsto x \cdot \left(\log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
  3. Applied egg-rr76.8%

    \[\leadsto x \cdot \color{blue}{\left(\log \left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{2}\right) + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
  4. Step-by-step derivation
    1. log-pow76.8%

      \[\leadsto x \cdot \left(\color{blue}{2 \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)} + \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
    2. distribute-lft1-in76.8%

      \[\leadsto x \cdot \color{blue}{\left(\left(2 + 1\right) \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right)} - z \]
    3. metadata-eval76.8%

      \[\leadsto x \cdot \left(\color{blue}{3} \cdot \log \left(\sqrt[3]{\frac{x}{y}}\right)\right) - z \]
    4. *-commutative76.8%

      \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
  5. Simplified76.8%

    \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3\right)} - z \]
  6. Step-by-step derivation
    1. add-log-exp76.8%

      \[\leadsto x \cdot \color{blue}{\log \left(e^{\log \left(\sqrt[3]{\frac{x}{y}}\right) \cdot 3}\right)} - z \]
    2. exp-to-pow76.9%

      \[\leadsto x \cdot \log \color{blue}{\left({\left(\sqrt[3]{\frac{x}{y}}\right)}^{3}\right)} - z \]
    3. pow376.9%

      \[\leadsto x \cdot \log \color{blue}{\left(\left(\sqrt[3]{\frac{x}{y}} \cdot \sqrt[3]{\frac{x}{y}}\right) \cdot \sqrt[3]{\frac{x}{y}}\right)} - z \]
    4. add-cube-cbrt76.9%

      \[\leadsto x \cdot \log \color{blue}{\left(\frac{x}{y}\right)} - z \]
    5. add-sqr-sqrt36.9%

      \[\leadsto x \cdot \color{blue}{\left(\sqrt{\log \left(\frac{x}{y}\right)} \cdot \sqrt{\log \left(\frac{x}{y}\right)}\right)} - z \]
    6. sqrt-unprod60.5%

      \[\leadsto x \cdot \color{blue}{\sqrt{\log \left(\frac{x}{y}\right) \cdot \log \left(\frac{x}{y}\right)}} - z \]
    7. clear-num59.7%

      \[\leadsto x \cdot \sqrt{\log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)} \cdot \log \left(\frac{x}{y}\right)} - z \]
    8. neg-log59.7%

      \[\leadsto x \cdot \sqrt{\color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)} \cdot \log \left(\frac{x}{y}\right)} - z \]
    9. clear-num59.7%

      \[\leadsto x \cdot \sqrt{\left(-\log \left(\frac{y}{x}\right)\right) \cdot \log \color{blue}{\left(\frac{1}{\frac{y}{x}}\right)}} - z \]
    10. neg-log60.9%

      \[\leadsto x \cdot \sqrt{\left(-\log \left(\frac{y}{x}\right)\right) \cdot \color{blue}{\left(-\log \left(\frac{y}{x}\right)\right)}} - z \]
    11. sqr-neg60.9%

      \[\leadsto x \cdot \sqrt{\color{blue}{\log \left(\frac{y}{x}\right) \cdot \log \left(\frac{y}{x}\right)}} - z \]
    12. sqrt-unprod22.7%

      \[\leadsto x \cdot \color{blue}{\left(\sqrt{\log \left(\frac{y}{x}\right)} \cdot \sqrt{\log \left(\frac{y}{x}\right)}\right)} - z \]
    13. add-sqr-sqrt38.3%

      \[\leadsto x \cdot \color{blue}{\log \left(\frac{y}{x}\right)} - z \]
    14. clear-num37.9%

      \[\leadsto x \cdot \log \color{blue}{\left(\frac{1}{\frac{x}{y}}\right)} - z \]
    15. add-sqr-sqrt37.9%

      \[\leadsto x \cdot \log \left(\frac{1}{\color{blue}{\sqrt{\frac{x}{y}} \cdot \sqrt{\frac{x}{y}}}}\right) - z \]
    16. associate-/r*37.9%

      \[\leadsto x \cdot \log \color{blue}{\left(\frac{\frac{1}{\sqrt{\frac{x}{y}}}}{\sqrt{\frac{x}{y}}}\right)} - z \]
    17. metadata-eval37.9%

      \[\leadsto x \cdot \log \left(\frac{\frac{\color{blue}{\sqrt{1}}}{\sqrt{\frac{x}{y}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
    18. sqrt-div37.9%

      \[\leadsto x \cdot \log \left(\frac{\color{blue}{\sqrt{\frac{1}{\frac{x}{y}}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
    19. clear-num37.9%

      \[\leadsto x \cdot \log \left(\frac{\sqrt{\color{blue}{\frac{y}{x}}}}{\sqrt{\frac{x}{y}}}\right) - z \]
    20. add-exp-log37.9%

      \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{\color{blue}{e^{\log \left(\frac{x}{y}\right)}}}}\right) - z \]
    21. add-sqr-sqrt15.2%

      \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{e^{\color{blue}{\sqrt{\log \left(\frac{x}{y}\right)} \cdot \sqrt{\log \left(\frac{x}{y}\right)}}}}}\right) - z \]
    22. sqrt-unprod38.4%

      \[\leadsto x \cdot \log \left(\frac{\sqrt{\frac{y}{x}}}{\sqrt{e^{\color{blue}{\sqrt{\log \left(\frac{x}{y}\right) \cdot \log \left(\frac{x}{y}\right)}}}}}\right) - z \]
  7. Applied egg-rr39.4%

    \[\leadsto x \cdot \color{blue}{\left(\log \left(\sqrt{\frac{x}{y}}\right) - \log \left(\sqrt{\frac{x}{y}}\right)\right)} - z \]
  8. Step-by-step derivation
    1. +-inverses50.7%

      \[\leadsto x \cdot \color{blue}{0} - z \]
  9. Simplified50.7%

    \[\leadsto x \cdot \color{blue}{0} - z \]
  10. Final simplification50.7%

    \[\leadsto x \cdot 0 - z \]

Developer target: 88.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.595077799083773 \cdot 10^{-308}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (< y 7.595077799083773e-308)
   (- (* x (log (/ x y))) z)
   (- (* x (- (log x) (log y))) z)))
double code(double x, double y, double z) {
	double tmp;
	if (y < 7.595077799083773e-308) {
		tmp = (x * log((x / y))) - z;
	} else {
		tmp = (x * (log(x) - log(y))) - z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y < 7.595077799083773d-308) then
        tmp = (x * log((x / y))) - z
    else
        tmp = (x * (log(x) - log(y))) - z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y < 7.595077799083773e-308) {
		tmp = (x * Math.log((x / y))) - z;
	} else {
		tmp = (x * (Math.log(x) - Math.log(y))) - z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y < 7.595077799083773e-308:
		tmp = (x * math.log((x / y))) - z
	else:
		tmp = (x * (math.log(x) - math.log(y))) - z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y < 7.595077799083773e-308)
		tmp = Float64(Float64(x * log(Float64(x / y))) - z);
	else
		tmp = Float64(Float64(x * Float64(log(x) - log(y))) - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y < 7.595077799083773e-308)
		tmp = (x * log((x / y))) - z;
	else
		tmp = (x * (log(x) - log(y))) - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Less[y, 7.595077799083773e-308], N[(N[(x * N[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y < 7.595077799083773 \cdot 10^{-308}:\\
\;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x - \log y\right) - z\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023192 
(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))