Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B

?

Percentage Accurate: 93.8% → 99.0%
Time: 21.3s
Precision: binary64
Cost: 14020

?

\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
\[\begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\ \;\;\;\;0.91893853320467 + \left(-0.5 \cdot \log x + \left(\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467 - x\right) + \left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
  (/
   (+
    (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
    0.083333333333333)
   x)))
(FPCore (x y z)
 :precision binary64
 (if (<= x 2.1e-5)
   (+
    0.91893853320467
    (+
     (* -0.5 (log x))
     (+
      (/ (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)) x)
      (* 0.083333333333333 (/ 1.0 x)))))
   (+
    (fma (log x) (+ x -0.5) (- 0.91893853320467 x))
    (* (+ 0.0007936500793651 y) (/ z (/ x z))))))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.1e-5) {
		tmp = 0.91893853320467 + ((-0.5 * log(x)) + (((z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778)) / x) + (0.083333333333333 * (1.0 / x))));
	} else {
		tmp = fma(log(x), (x + -0.5), (0.91893853320467 - x)) + ((0.0007936500793651 + y) * (z / (x / z)));
	}
	return tmp;
}
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x))
end
function code(x, y, z)
	tmp = 0.0
	if (x <= 2.1e-5)
		tmp = Float64(0.91893853320467 + Float64(Float64(-0.5 * log(x)) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778)) / x) + Float64(0.083333333333333 * Float64(1.0 / x)))));
	else
		tmp = Float64(fma(log(x), Float64(x + -0.5), Float64(0.91893853320467 - x)) + Float64(Float64(0.0007936500793651 + y) * Float64(z / Float64(x / z))));
	end
	return tmp
end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := If[LessEqual[x, 2.1e-5], N[(0.91893853320467 + N[(N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\begin{array}{l}
\mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\
\;\;\;\;0.91893853320467 + \left(-0.5 \cdot \log x + \left(\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467 - x\right) + \left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}}\\


\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Herbie found 16 alternatives:

AlternativeAccuracySpeedup

Accuracy vs Speed

The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Bogosity?

Bogosity

Target

Original93.8%
Target98.7%
Herbie99.0%
\[\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) \]

Derivation?

  1. Split input into 2 regimes
  2. if x < 2.09999999999999988e-5

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Simplified99.7%

      \[\leadsto \color{blue}{\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]
      Step-by-step derivation

      [Start]99.7%

      \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      remove-double-neg [<=]99.7%

      \[ \left(\left(\color{blue}{\left(-\left(-\left(x - 0.5\right)\right)\right)} \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      remove-double-neg [=>]99.7%

      \[ \left(\left(\color{blue}{\left(x - 0.5\right)} \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      sub-neg [=>]99.7%

      \[ \left(\left(\color{blue}{\left(x + \left(-0.5\right)\right)} \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      metadata-eval [=>]99.7%

      \[ \left(\left(\left(x + \color{blue}{-0.5}\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      *-commutative [=>]99.7%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)} + 0.083333333333333}{x} \]

      fma-def [=>]99.7%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{\mathsf{fma}\left(z, \left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, 0.083333333333333\right)}}{x} \]

      fma-neg [=>]99.7%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)}, 0.083333333333333\right)}{x} \]

      metadata-eval [=>]99.7%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, \color{blue}{-0.0027777777777778}\right), 0.083333333333333\right)}{x} \]
    3. Taylor expanded in x around 0 99.7%

      \[\leadsto \color{blue}{0.91893853320467 + \left(-0.5 \cdot \log x + \left(\frac{\left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) \cdot z}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right)} \]

    if 2.09999999999999988e-5 < x

    1. Initial program 87.2%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Simplified87.2%

      \[\leadsto \color{blue}{\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]
      Step-by-step derivation

      [Start]87.2%

      \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      remove-double-neg [<=]87.2%

      \[ \left(\left(\color{blue}{\left(-\left(-\left(x - 0.5\right)\right)\right)} \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      remove-double-neg [=>]87.2%

      \[ \left(\left(\color{blue}{\left(x - 0.5\right)} \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      sub-neg [=>]87.2%

      \[ \left(\left(\color{blue}{\left(x + \left(-0.5\right)\right)} \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      metadata-eval [=>]87.2%

      \[ \left(\left(\left(x + \color{blue}{-0.5}\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]

      *-commutative [=>]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right)} + 0.083333333333333}{x} \]

      fma-def [=>]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{\mathsf{fma}\left(z, \left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778, 0.083333333333333\right)}}{x} \]

      fma-neg [=>]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right)}, 0.083333333333333\right)}{x} \]

      metadata-eval [=>]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, \color{blue}{-0.0027777777777778}\right), 0.083333333333333\right)}{x} \]
    3. Taylor expanded in z around inf 87.2%

      \[\leadsto \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{{z}^{2} \cdot \left(0.0007936500793651 + y\right)}}{x} \]
    4. Simplified87.2%

      \[\leadsto \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{\left(z \cdot z\right) \cdot \left(y + 0.0007936500793651\right)}}{x} \]
      Step-by-step derivation

      [Start]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{{z}^{2} \cdot \left(0.0007936500793651 + y\right)}{x} \]

      unpow2 [=>]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{\left(z \cdot z\right)} \cdot \left(0.0007936500793651 + y\right)}{x} \]

      +-commutative [<=]87.2%

      \[ \left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(z \cdot z\right) \cdot \color{blue}{\left(y + 0.0007936500793651\right)}}{x} \]
    5. Applied egg-rr87.2%

      \[\leadsto \color{blue}{1 \cdot \left(\frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} + \left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right)\right)} \]
      Step-by-step derivation

      [Start]87.2%

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

      *-un-lft-identity [=>]87.2%

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

      +-commutative [=>]87.2%

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

      *-commutative [=>]87.2%

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

      +-commutative [=>]87.2%

      \[ 1 \cdot \left(\frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} + \color{blue}{\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right)}\right) \]
    6. Simplified98.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, -0.5 + x, 0.91893853320467 - x\right) + \frac{z}{\frac{x}{z}} \cdot \left(0.0007936500793651 + y\right)} \]
      Step-by-step derivation

      [Start]87.2%

      \[ 1 \cdot \left(\frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} + \left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right)\right) \]

      *-lft-identity [=>]87.2%

      \[ \color{blue}{\frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} + \left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right)} \]

      +-commutative [=>]87.2%

      \[ \color{blue}{\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x}} \]

      associate-+r- [=>]87.2%

      \[ \color{blue}{\left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right)} + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      +-commutative [=>]87.2%

      \[ \left(\color{blue}{\left(\left(x + -0.5\right) \cdot \log x + 0.91893853320467\right)} - x\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      associate-+r- [<=]87.2%

      \[ \color{blue}{\left(\left(x + -0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right)} + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      metadata-eval [<=]87.2%

      \[ \left(\left(x + \color{blue}{\left(-0.5\right)}\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      sub-neg [<=]87.2%

      \[ \left(\color{blue}{\left(x - 0.5\right)} \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      *-commutative [=>]87.2%

      \[ \left(\color{blue}{\log x \cdot \left(x - 0.5\right)} + \left(0.91893853320467 - x\right)\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      fma-def [=>]87.3%

      \[ \color{blue}{\mathsf{fma}\left(\log x, x - 0.5, 0.91893853320467 - x\right)} + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      sub-neg [=>]87.3%

      \[ \mathsf{fma}\left(\log x, \color{blue}{x + \left(-0.5\right)}, 0.91893853320467 - x\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      metadata-eval [=>]87.3%

      \[ \mathsf{fma}\left(\log x, x + \color{blue}{-0.5}, 0.91893853320467 - x\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      +-commutative [=>]87.3%

      \[ \mathsf{fma}\left(\log x, \color{blue}{-0.5 + x}, 0.91893853320467 - x\right) + \frac{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right)}{x} \]

      *-commutative [=>]87.3%

      \[ \mathsf{fma}\left(\log x, -0.5 + x, 0.91893853320467 - x\right) + \frac{\color{blue}{\left(z \cdot z\right) \cdot \left(y + 0.0007936500793651\right)}}{x} \]

      associate-/l* [=>]90.9%

      \[ \mathsf{fma}\left(\log x, -0.5 + x, 0.91893853320467 - x\right) + \color{blue}{\frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}} \]

      associate-/r/ [=>]90.9%

      \[ \mathsf{fma}\left(\log x, -0.5 + x, 0.91893853320467 - x\right) + \color{blue}{\frac{z \cdot z}{x} \cdot \left(y + 0.0007936500793651\right)} \]

      associate-/l* [=>]98.2%

      \[ \mathsf{fma}\left(\log x, -0.5 + x, 0.91893853320467 - x\right) + \color{blue}{\frac{z}{\frac{x}{z}}} \cdot \left(y + 0.0007936500793651\right) \]

      +-commutative [=>]98.2%

      \[ \mathsf{fma}\left(\log x, -0.5 + x, 0.91893853320467 - x\right) + \frac{z}{\frac{x}{z}} \cdot \color{blue}{\left(0.0007936500793651 + y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\ \;\;\;\;0.91893853320467 + \left(-0.5 \cdot \log x + \left(\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467 - x\right) + \left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy99.0%
Cost14020
\[\begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\ \;\;\;\;0.91893853320467 + \left(-0.5 \cdot \log x + \left(\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\log x, x + -0.5, 0.91893853320467 - x\right) + \left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 2
Accuracy99.0%
Cost8004
\[\begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\ \;\;\;\;0.91893853320467 + \left(-0.5 \cdot \log x + \left(\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}} + \left(\left(0.91893853320467 - x\right) + \log x \cdot \left(x + -0.5\right)\right)\\ \end{array} \]
Alternative 3
Accuracy90.4%
Cost7752
\[\begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+143}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + y \cdot \frac{z \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 4
Accuracy98.7%
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 2.1 \cdot 10^{-5}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}} + \left(\left(0.91893853320467 - x\right) + \log x \cdot \left(x + -0.5\right)\right)\\ \end{array} \]
Alternative 5
Accuracy83.4%
Cost7496
\[\begin{array}{l} \mathbf{if}\;x \leq 780000000:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 6.9 \cdot 10^{+43}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+100}:\\ \;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 6
Accuracy83.4%
Cost7240
\[\begin{array}{l} \mathbf{if}\;x \leq 950000000:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{+45}:\\ \;\;\;\;\left(0.91893853320467 + \log x \cdot \left(x - 0.5\right)\right) - x\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+101}:\\ \;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 7
Accuracy83.4%
Cost7117
\[\begin{array}{l} \mathbf{if}\;x \leq 860000000:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{+44} \lor \neg \left(x \leq 5 \cdot 10^{+100}\right):\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\ \end{array} \]
Alternative 8
Accuracy65.0%
Cost964
\[\begin{array}{l} \mathbf{if}\;x \leq 4.1 \cdot 10^{+66}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\ \end{array} \]
Alternative 9
Accuracy42.7%
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+24} \lor \neg \left(y \leq 0.00078\right):\\ \;\;\;\;z \cdot \left(z \cdot \frac{y}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 10
Accuracy42.9%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+24}:\\ \;\;\;\;z \cdot \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;y \leq 0.00078:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{y}{x}\right)\\ \end{array} \]
Alternative 11
Accuracy43.0%
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+24}:\\ \;\;\;\;\frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{elif}\;y \leq 0.00078:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{y}{x}\right)\\ \end{array} \]
Alternative 12
Accuracy44.2%
Cost576
\[z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right) \]
Alternative 13
Accuracy44.4%
Cost576
\[\left(0.0007936500793651 + y\right) \cdot \frac{z}{\frac{x}{z}} \]
Alternative 14
Accuracy44.5%
Cost576
\[\frac{0.0007936500793651 + y}{\frac{\frac{x}{z}}{z}} \]
Alternative 15
Accuracy25.7%
Cost448
\[0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right) \]
Alternative 16
Accuracy25.9%
Cost448
\[z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right) \]

Reproduce?

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