Average Error: 14.9 → 14.9
Time: 898.0ms
Precision: binary64
Cost: 6848
\[x \cdot \log \left(\frac{x}{y}\right) - z\]
\[x \cdot \log \left(\frac{x}{y}\right) - z\]
x \cdot \log \left(\frac{x}{y}\right) - z
x \cdot \log \left(\frac{x}{y}\right) - z
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
(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;
}
double code(double x, double y, double z) {
	return (x * log(x / 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

Original14.9
Target7.3
Herbie14.9
\[\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 14.9

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

Reproduce

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