Average Error: 6.1 → 1.0
Time: 22.4min
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}\]
\[\begin{array}{l} \mathbf{if}\;x \le 64580610598537.156:\\ \;\;\;\;\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 - x\right)\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\\ \mathbf{elif}\;x \le 2.4155518908026999 \cdot 10^{197}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{z}{x} \cdot \left(z \cdot \left(7.93650079365100015 \cdot 10^{-4} + y\right) - 0.0027777777777778\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(2 \cdot \log \left(\sqrt[3]{x}\right)\right) \cdot \left(x - 0.5\right) + \left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x}\right)\right) - x\right) + 0.91893853320467001\right) + \left(\frac{0.0833333333333329956}{x} - \frac{z}{x} \cdot \left(0.0027777777777778 - 7.93650079365100015 \cdot 10^{-4} \cdot z\right)\right)\\ \end{array}\]
\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}
\begin{array}{l}
\mathbf{if}\;x \le 64580610598537.156:\\
\;\;\;\;\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 - x\right)\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\\

\mathbf{elif}\;x \le 2.4155518908026999 \cdot 10^{197}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{z}{x} \cdot \left(z \cdot \left(7.93650079365100015 \cdot 10^{-4} + y\right) - 0.0027777777777778\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(2 \cdot \log \left(\sqrt[3]{x}\right)\right) \cdot \left(x - 0.5\right) + \left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x}\right)\right) - x\right) + 0.91893853320467001\right) + \left(\frac{0.0833333333333329956}{x} - \frac{z}{x} \cdot \left(0.0027777777777778 - 7.93650079365100015 \cdot 10^{-4} \cdot z\right)\right)\\

\end{array}
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) {
	double VAR;
	if ((x <= 64580610598537.16)) {
		VAR = ((double) (((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) + ((double) (0.91893853320467 - x)))) + (((double) (((double) (((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)) * z)) + 0.083333333333333)) / x)));
	} else {
		double VAR_1;
		if ((x <= 2.4155518908027e+197)) {
			VAR_1 = ((double) (((double) (((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) - x)) + 0.91893853320467)) + ((double) ((z / x) * ((double) (((double) (z * ((double) (0.0007936500793651 + y)))) - 0.0027777777777778))))));
		} else {
			VAR_1 = ((double) (((double) (((double) (((double) (((double) (((double) (2.0 * ((double) log(((double) cbrt(x)))))) * ((double) (x - 0.5)))) + ((double) (((double) (x - 0.5)) * ((double) log(((double) cbrt(x)))))))) - x)) + 0.91893853320467)) + ((double) ((0.083333333333333 / x) - ((double) ((z / x) * ((double) (0.0027777777777778 - ((double) (0.0007936500793651 * z))))))))));
		}
		VAR = VAR_1;
	}
	return VAR;
}

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.1
Target1.3
Herbie1.0
\[\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. Split input into 3 regimes
  2. if x < 64580610598537.156

    1. Initial program 0.1

      \[\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. Using strategy rm
    3. Applied sub-neg0.1

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

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

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

    if 64580610598537.156 < x < 2.4155518908026999e197

    1. Initial program 7.3

      \[\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. Taylor expanded around inf 7.5

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

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

    if 2.4155518908026999e197 < x

    1. Initial program 15.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. Taylor expanded around 0 11.5

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \color{blue}{\left(\frac{0.0833333333333329956}{x} - \frac{z}{x} \cdot \left(0.0027777777777778 - 7.93650079365100015 \cdot 10^{-4} \cdot z\right)\right)}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt2.2

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

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

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

      \[\leadsto \left(\left(\left(\color{blue}{\left(2 \cdot \log \left(\sqrt[3]{x}\right)\right) \cdot \left(x - 0.5\right)} + \left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x}\right)\right) - x\right) + 0.91893853320467001\right) + \left(\frac{0.0833333333333329956}{x} - \frac{z}{x} \cdot \left(0.0027777777777778 - 7.93650079365100015 \cdot 10^{-4} \cdot z\right)\right)\]
  3. Recombined 3 regimes into one program.
  4. Final simplification1.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 64580610598537.156:\\ \;\;\;\;\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467001 - x\right)\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\\ \mathbf{elif}\;x \le 2.4155518908026999 \cdot 10^{197}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{z}{x} \cdot \left(z \cdot \left(7.93650079365100015 \cdot 10^{-4} + y\right) - 0.0027777777777778\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\left(2 \cdot \log \left(\sqrt[3]{x}\right)\right) \cdot \left(x - 0.5\right) + \left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x}\right)\right) - x\right) + 0.91893853320467001\right) + \left(\frac{0.0833333333333329956}{x} - \frac{z}{x} \cdot \left(0.0027777777777778 - 7.93650079365100015 \cdot 10^{-4} \cdot z\right)\right)\\ \end{array}\]

Reproduce

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