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

?

Percentage Accurate: 93.9% → 99.6%
Time: 17.0s
Precision: binary64
Cost: 8004

?

\[\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 3.6 \cdot 10^{+19}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\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 3.6e+19)
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (/
     (+
      (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
      0.083333333333333)
     x))
   (+ (* x (+ (log x) -1.0)) (* (+ y 0.0007936500793651) (/ 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 <= 3.6e+19) {
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 3.6d+19) then
        tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
    else
        tmp = (x * (log(x) + (-1.0d0))) + ((y + 0.0007936500793651d0) * (z / (x / z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 3.6e+19) {
		tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = (x * (Math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
	}
	return tmp;
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
def code(x, y, z):
	tmp = 0
	if x <= 3.6e+19:
		tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)
	else:
		tmp = (x * (math.log(x) + -1.0)) + ((y + 0.0007936500793651) * (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 <= 3.6e+19)
		tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x));
	else
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z))));
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 3.6e+19)
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	else
		tmp = (x * (log(x) + -1.0)) + ((y + 0.0007936500793651) * (z / (x / z)));
	end
	tmp_2 = 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, 3.6e+19], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $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 3.6 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\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 13 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

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original93.9%
Target98.5%
Herbie99.6%
\[\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 < 3.6e19

    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} \]

    if 3.6e19 < x

    1. Initial program 89.1%

      \[\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. Applied egg-rr89.1%

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

      [Start]89.1%

      \[ \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} \]

      clear-num [=>]89.1%

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

      inv-pow [=>]89.1%

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

      *-commutative [=>]89.1%

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

      fma-udef [<=]89.1%

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

      fma-neg [=>]89.1%

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

      metadata-eval [=>]89.1%

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

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

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

      [Start]89.1%

      \[ \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} \]

      +-commutative [=>]89.1%

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

      associate-*l/ [<=]91.4%

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

      unpow2 [=>]91.4%

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

      +-commutative [<=]91.4%

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

      *-commutative [=>]91.4%

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

      associate-/l* [=>]99.6%

      \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.0007936500793651 + y\right) \cdot \color{blue}{\frac{z}{\frac{x}{z}}} \]
    5. Taylor expanded in x around inf 99.6%

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

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

      [Start]99.6%

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

      *-commutative [=>]99.6%

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

      sub-neg [=>]99.6%

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

      mul-1-neg [=>]99.6%

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

      log-rec [=>]99.6%

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

      remove-double-neg [=>]99.6%

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

      metadata-eval [=>]99.6%

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

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

Alternatives

Alternative 1
Accuracy99.6%
Cost8004
\[\begin{array}{l} \mathbf{if}\;x \leq 3.6 \cdot 10^{+19}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 2
Accuracy69.0%
Cost8156
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ t_1 := 0.91893853320467 + \log x \cdot -0.5\\ t_2 := t_1 + \frac{z \cdot \left(0.0007936500793651 \cdot z\right)}{x}\\ t_3 := t_1 + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{if}\;z \leq -4.6 \cdot 10^{+200}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -3 \cdot 10^{+96}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-16}:\\ \;\;\;\;t_1 + \frac{z \cdot z}{\frac{x}{y}}\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-90}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-42}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{+69}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + t_0\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+136}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Accuracy70.3%
Cost8156
\[\begin{array}{l} t_0 := \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ t_1 := 0.91893853320467 + \log x \cdot -0.5\\ t_2 := t_1 + \frac{z \cdot \left(0.0007936500793651 \cdot z\right)}{x}\\ t_3 := t_1 + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{if}\;z \leq -9 \cdot 10^{+200}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1 \cdot 10^{+95}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-16}:\\ \;\;\;\;t_1 + \frac{z \cdot z}{\frac{x}{y}}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-42}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+59}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{+134}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Accuracy67.7%
Cost8025
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ t_1 := \left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{if}\;z \leq -2.15 \cdot 10^{+200}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{+96}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-16}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-90}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-42} \lor \neg \left(z \leq 7.2 \cdot 10^{+66}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + t_0\right)\\ \end{array} \]
Alternative 5
Accuracy66.8%
Cost8024
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ t_1 := 0.91893853320467 + \log x \cdot -0.5\\ t_2 := t_1 + \frac{y}{\frac{x}{z \cdot z}}\\ t_3 := t_1 + \frac{z \cdot z}{\frac{x}{y}}\\ \mathbf{if}\;z \leq -2.15 \cdot 10^{+200}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+95}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-16}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.2 \cdot 10^{-90}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-42}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{+69}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + t_0\right)\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Accuracy98.6%
Cost7748
\[\begin{array}{l} t_0 := x \cdot \left(\log x + -1\right)\\ \mathbf{if}\;x \leq 880:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + t_0\\ \mathbf{else}:\\ \;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 7
Accuracy98.9%
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 1:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 8
Accuracy99.0%
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 1.15 \cdot 10^{-8}:\\ \;\;\;\;\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 9
Accuracy95.5%
Cost7625
\[\begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{-25} \lor \neg \left(z \leq 3.4 \cdot 10^{-81}\right):\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
Alternative 10
Accuracy95.5%
Cost7625
\[\begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{-30} \lor \neg \left(z \leq 3.4 \cdot 10^{-81}\right):\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{\frac{x}{0.083333333333333}}\\ \end{array} \]
Alternative 11
Accuracy56.0%
Cost7104
\[\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) \]
Alternative 12
Accuracy56.1%
Cost6976
\[x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x} \]
Alternative 13
Accuracy23.0%
Cost192
\[\frac{0.083333333333333}{x} \]

Reproduce?

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