Average Error: 15.6 → 0.2
Time: 7.9s
Precision: binary64
Cost: 39360
\[x \cdot \log \left(\frac{x}{y}\right) - z\]
\[\left(x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) - z\]
x \cdot \log \left(\frac{x}{y}\right) - z
\left(x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) - z
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
(FPCore (x y z)
 :precision binary64
 (-
  (+
   (* x (* 2.0 (log (/ (cbrt x) (cbrt y)))))
   (* x (log (/ (cbrt x) (cbrt y)))))
  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 * (2.0 * log(cbrt(x) / cbrt(y)))) + (x * log(cbrt(x) / cbrt(y)))) - z;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original15.6
Target7.8
Herbie0.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}\]

Alternatives

Alternative 1
Error0.2
Cost39232
\[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\]
Alternative 2
Error0.2
Cost39425
\[\begin{array}{l} \mathbf{if}\;y \leq -5.32267937711542 \cdot 10^{-309}:\\ \;\;\;\;x \cdot \left(\log \left(\frac{-1}{y}\right) + \log \left(-x\right)\right) - z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log \left(\frac{\sqrt{x}}{\sqrt{y}}\right) + \log \left(\frac{\sqrt{x}}{\sqrt{y}}\right)\right) - z\\ \end{array}\]
Alternative 3
Error0.4
Cost13761
\[\begin{array}{l} \mathbf{if}\;y \leq -5.32267937711542 \cdot 10^{-309}:\\ \;\;\;\;x \cdot \left(\log \left(\frac{-1}{y}\right) + \log \left(-x\right)\right) - z\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \log x - x \cdot \log y\right) - z\\ \end{array}\]
Alternative 4
Error4.6
Cost14339
\[\begin{array}{l} \mathbf{if}\;x \leq -4.251695761728055 \cdot 10^{+203}:\\ \;\;\;\;x \cdot \left(\log \left(\frac{-1}{y}\right) - \log \left(\frac{-1}{x}\right)\right)\\ \mathbf{elif}\;x \leq -2.9240587643734853 \cdot 10^{-165}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \mathbf{elif}\;x \leq 2.0913932542268 \cdot 10^{-310}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \log x - x \cdot \log y\right) - z\\ \end{array}\]
Alternative 5
Error6.1
Cost14018
\[\begin{array}{l} \mathbf{if}\;x \leq -8.061489415130566 \cdot 10^{-166}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \mathbf{elif}\;x \leq 2.0913932542268 \cdot 10^{-310}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \log x - x \cdot \log y\right) - z\\ \end{array}\]
Alternative 6
Error6.1
Cost13890
\[\begin{array}{l} \mathbf{if}\;x \leq -3.645628171678718 \cdot 10^{-165}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \mathbf{elif}\;x \leq 2.0913932542268 \cdot 10^{-310}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x - \log y\right) - z\\ \end{array}\]
Alternative 7
Error8.1
Cost20488
\[\begin{array}{l} \mathbf{if}\;x \cdot \log \left(\frac{x}{y}\right) \leq -1.7753655568145892 \cdot 10^{+308} \lor \neg \left(x \cdot \log \left(\frac{x}{y}\right) \leq 1.77169392732599 \cdot 10^{+308}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right) - z\\ \end{array}\]
Alternative 8
Error21.8
Cost7313
\[\begin{array}{l} \mathbf{if}\;z \leq -1.710839888818094 \cdot 10^{-23} \lor \neg \left(z \leq -9.40358822995624 \cdot 10^{-133} \lor \neg \left(z \leq -8.221622857389028 \cdot 10^{-170}\right) \land z \leq 3.2378445002596346 \cdot 10^{-45}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log \left(\frac{x}{y}\right)\\ \end{array}\]
Alternative 9
Error31.7
Cost128
\[-z\]
Alternative 10
Error61.9
Cost64
\[-1\]
Alternative 11
Error61.9
Cost64
\[1\]

Error

Derivation

  1. Initial program 15.6

    \[x \cdot \log \left(\frac{x}{y}\right) - z\]
  2. Using strategy rm
  3. Applied add-cube-cbrt_binary64_1341215.6

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

    \[\leadsto x \cdot \log \left(\frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}\right) - z\]
  5. Applied times-frac_binary64_1338315.6

    \[\leadsto 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\]
  6. Applied log-prod_binary64_134633.7

    \[\leadsto 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\]
  7. Applied distribute-rgt-in_binary64_133273.7

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

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

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

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

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

Reproduce

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