?

Average Accuracy: 75.8% → 99.7%
Time: 12.7s
Precision: binary64
Cost: 39232

?

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

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original75.8%
Target87.8%
Herbie99.7%
\[\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} \]

Derivation?

  1. Initial program 75.8%

    \[x \cdot \log \left(\frac{x}{y}\right) - z \]
  2. Applied egg-rr48.8%

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

    [Start]75.8

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

    frac-2neg [=>]75.8

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

    log-div [=>]48.8

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

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

    [Start]48.8

    \[ x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right) - z \]

    diff-log [=>]75.8

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

    add-cube-cbrt [=>]75.8

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

    add-cube-cbrt [=>]75.8

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

    times-frac [=>]75.8

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

    log-prod [=>]94.5

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

    cbrt-unprod [=>]52.0

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

    sqr-neg [=>]52.0

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

    cbrt-unprod [<=]94.5

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

    pow2 [=>]94.5

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

    cbrt-unprod [=>]51.0

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

    sqr-neg [=>]51.0

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

    cbrt-unprod [<=]94.5

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

    pow2 [=>]94.5

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

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

    [Start]94.5

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

    log-div [=>]99.6

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

    log-pow [=>]50.8

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

    log-pow [=>]50.8

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

    distribute-lft-out-- [=>]50.8

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

    log-div [<=]99.7

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

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

Alternatives

Alternative 1
Accuracy86.8%
Cost26696
\[\begin{array}{l} t_0 := x \cdot \log \left(\frac{x}{y}\right)\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;-z\\ \mathbf{elif}\;t_0 \leq 10^{+290}:\\ \;\;\;\;t_0 - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right)\\ \end{array} \]
Alternative 2
Accuracy87.3%
Cost20424
\[\begin{array}{l} t_0 := x \cdot \log \left(\frac{x}{y}\right)\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;-z\\ \mathbf{elif}\;t_0 \leq 10^{+290}:\\ \;\;\;\;t_0 - z\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
Alternative 3
Accuracy99.6%
Cost19908
\[\begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-310}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(2 \cdot \log \left(\frac{\sqrt{x}}{\sqrt{y}}\right)\right) - z\\ \end{array} \]
Alternative 4
Accuracy86.6%
Cost13648
\[\begin{array}{l} t_0 := \left(-z\right) - x \cdot \log \left(\frac{y}{x}\right)\\ \mathbf{if}\;x \leq -2.8 \cdot 10^{+171}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right)\\ \mathbf{elif}\;x \leq -2.55 \cdot 10^{-154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-178}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{+123}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right)\\ \end{array} \]
Alternative 5
Accuracy93.4%
Cost13644
\[\begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+171}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right)\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{-154}:\\ \;\;\;\;\left(-z\right) - x \cdot \log \left(\frac{y}{x}\right)\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-308}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \]
Alternative 6
Accuracy99.5%
Cost13508
\[\begin{array}{l} \mathbf{if}\;x \leq -5 \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 7
Accuracy67.2%
Cost7048
\[\begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+17}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-84}:\\ \;\;\;\;x \cdot \left(-\log \left(\frac{y}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
Alternative 8
Accuracy67.2%
Cost6984
\[\begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+16}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-84}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
Alternative 9
Accuracy50.9%
Cost128
\[-z \]

Error

Reproduce?

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