Average Error: 6.4 → 1.3
Time: 5.9s
Precision: binary64
\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\]
\[\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\left(\frac{z}{x} \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right) - \frac{z \cdot 0.0027777777777778 - 0.0833333333333329956}{x}\right) - x\right)\right)\]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}
\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\left(\frac{z}{x} \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right) - \frac{z \cdot 0.0027777777777778 - 0.0833333333333329956}{x}\right) - x\right)\right)
double code(double x, double y, double z) {
	return ((double) (((double) (((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) - x)) + 0.91893853320467)) + (((double) (((double) (((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)) * z)) + 0.083333333333333)) / x)));
}
double code(double x, double y, double z) {
	return ((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) + ((double) (0.91893853320467 + ((double) (((double) (((double) ((z / x) * ((double) (z * ((double) (y + 0.0007936500793651)))))) - (((double) (((double) (z * 0.0027777777777778)) - 0.083333333333333)) / x))) - x))))));
}

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

Original6.4
Target1.3
Herbie1.3
\[\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 - x\right)\right) + \frac{0.0833333333333329956}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right) - 0.0027777777777778\right)\]

Derivation

  1. Initial program 6.4

    \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\]
  2. Simplified6.4

    \[\leadsto \color{blue}{\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{z \cdot \left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) + 0.0833333333333329956}{x} - x\right)\right)}\]
  3. Using strategy rm
  4. Applied sub-neg6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{z \cdot \color{blue}{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z + \left(-0.0027777777777778\right)\right)} + 0.0833333333333329956}{x} - x\right)\right)\]
  5. Applied distribute-lft-in6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{\color{blue}{\left(z \cdot \left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z\right) + z \cdot \left(-0.0027777777777778\right)\right)} + 0.0833333333333329956}{x} - x\right)\right)\]
  6. Simplified6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{\left(\color{blue}{z \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right)} + z \cdot \left(-0.0027777777777778\right)\right) + 0.0833333333333329956}{x} - x\right)\right)\]
  7. Using strategy rm
  8. Applied distribute-rgt-neg-out6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{\left(z \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right) + \color{blue}{\left(-z \cdot 0.0027777777777778\right)}\right) + 0.0833333333333329956}{x} - x\right)\right)\]
  9. Applied unsub-neg6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{\color{blue}{\left(z \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right) - z \cdot 0.0027777777777778\right)} + 0.0833333333333329956}{x} - x\right)\right)\]
  10. Applied associate-+l-6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\frac{\color{blue}{z \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right) - \left(z \cdot 0.0027777777777778 - 0.0833333333333329956\right)}}{x} - x\right)\right)\]
  11. Applied div-sub6.4

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\color{blue}{\left(\frac{z \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right)}{x} - \frac{z \cdot 0.0027777777777778 - 0.0833333333333329956}{x}\right)} - x\right)\right)\]
  12. Simplified1.3

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\left(\color{blue}{\frac{z}{x} \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right)} - \frac{z \cdot 0.0027777777777778 - 0.0833333333333329956}{x}\right) - x\right)\right)\]
  13. Final simplification1.3

    \[\leadsto \left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 + \left(\left(\frac{z}{x} \cdot \left(z \cdot \left(y + 7.93650079365100015 \cdot 10^{-4}\right)\right) - \frac{z \cdot 0.0027777777777778 - 0.0833333333333329956}{x}\right) - x\right)\right)\]

Reproduce

herbie shell --seed 2020182 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))

  (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))