?

Average Accuracy: 75.0% → 99.2%
Time: 14.5s
Precision: binary64
Cost: 19776

?

\[x \cdot \log \left(\frac{x}{y}\right) - z \]
\[x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot 3\right) - z \]
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
(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((x / y))) - 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((x / y))) - 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 * log(Float64(x / y))) - z)
end
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[Log[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]
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]
x \cdot \log \left(\frac{x}{y}\right) - z
x \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot 3\right) - z

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original75.0%
Target87.2%
Herbie99.2%
\[\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 77.0%

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

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

    [Start]77.0

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

    add-cube-cbrt [=>]76.9

    \[ 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 \]

    associate-*l* [=>]76.9

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

    log-prod [=>]76.9

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

    pow2 [=>]76.9

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

    metadata-eval [<=]76.9

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

    log-pow [=>]76.9

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

    metadata-eval [=>]76.9

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

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

    [Start]76.9

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

    distribute-rgt1-in [=>]76.9

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

    metadata-eval [=>]76.9

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

    *-commutative [=>]76.9

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

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

    [Start]76.9

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

    cbrt-div [=>]99.2

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

    div-inv [=>]99.2

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

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

    [Start]99.2

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

    associate-*r/ [=>]99.2

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

    *-rgt-identity [=>]99.2

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

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

Alternatives

Alternative 1
Accuracy86.7%
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 5 \cdot 10^{+305}:\\ \;\;\;\;t_0 - z\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
Alternative 2
Accuracy99.1%
Cost19908
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \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 3
Accuracy86.9%
Cost13648
\[\begin{array}{l} t_0 := x \cdot \log \left(\frac{x}{y}\right) - z\\ \mathbf{if}\;x \leq -5.4 \cdot 10^{+153}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right)\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-116}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-121}:\\ \;\;\;\;-z\\ \mathbf{elif}\;x \leq 5.5 \cdot 10^{+138}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right)\\ \end{array} \]
Alternative 4
Accuracy93.0%
Cost13644
\[\begin{array}{l} \mathbf{if}\;x \leq -1.28 \cdot 10^{+154}:\\ \;\;\;\;x \cdot \left(\log \left(-x\right) - \log \left(-y\right)\right)\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-122}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-306}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array} \]
Alternative 5
Accuracy99.0%
Cost13508
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \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 6
Accuracy65.3%
Cost7049
\[\begin{array}{l} \mathbf{if}\;x \leq -350000 \lor \neg \left(x \leq 8 \cdot 10^{+41}\right):\\ \;\;\;\;\left(-x\right) \cdot \log \left(\frac{y}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
Alternative 7
Accuracy64.6%
Cost6985
\[\begin{array}{l} \mathbf{if}\;x \leq -255000 \lor \neg \left(x \leq 4.5 \cdot 10^{+41}\right):\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
Alternative 8
Accuracy49.7%
Cost128
\[-z \]

Error

Reproduce?

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