Average Error: 6.4 → 0.5
Time: 27.6s
Precision: binary64
Cost: 15816
\[\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} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ t_1 := \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \left(z \cdot \left(z \cdot \frac{1}{x}\right)\right) \cdot \left(0.0007936500793651 + y\right)\right) + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-11}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 4 \cdot 10^{-21}:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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
 (let* ((t_0 (* z (+ -0.0027777777777778 (* z (+ 0.0007936500793651 y)))))
        (t_1
         (+
          (+
           (fma -0.0027777777777778 (/ z x) (/ 0.083333333333333 x))
           (* (* z (* z (/ 1.0 x))) (+ 0.0007936500793651 y)))
          (+ 0.91893853320467 (- (* x (log x)) x)))))
   (if (<= t_0 -2e-11)
     t_1
     (if (<= t_0 4e-21)
       (+
        (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467)
        (pow (* x 12.000000000000048) -1.0))
       t_1))))
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 t_0 = z * (-0.0027777777777778 + (z * (0.0007936500793651 + y)));
	double t_1 = (fma(-0.0027777777777778, (z / x), (0.083333333333333 / x)) + ((z * (z * (1.0 / x))) * (0.0007936500793651 + y))) + (0.91893853320467 + ((x * log(x)) - x));
	double tmp;
	if (t_0 <= -2e-11) {
		tmp = t_1;
	} else if (t_0 <= 4e-21) {
		tmp = ((((x + -0.5) * log(x)) - x) + 0.91893853320467) + pow((x * 12.000000000000048), -1.0);
	} else {
		tmp = t_1;
	}
	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)
	t_0 = Float64(z * Float64(-0.0027777777777778 + Float64(z * Float64(0.0007936500793651 + y))))
	t_1 = Float64(Float64(fma(-0.0027777777777778, Float64(z / x), Float64(0.083333333333333 / x)) + Float64(Float64(z * Float64(z * Float64(1.0 / x))) * Float64(0.0007936500793651 + y))) + Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)))
	tmp = 0.0
	if (t_0 <= -2e-11)
		tmp = t_1;
	elseif (t_0 <= 4e-21)
		tmp = Float64(Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467) + (Float64(x * 12.000000000000048) ^ -1.0));
	else
		tmp = t_1;
	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_] := Block[{t$95$0 = N[(z * N[(-0.0027777777777778 + N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(-0.0027777777777778 * N[(z / x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(z * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-11], t$95$1, If[LessEqual[t$95$0, 4e-21], N[(N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[Power[N[(x * 12.000000000000048), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], t$95$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}
\begin{array}{l}
t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\
t_1 := \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \left(z \cdot \left(z \cdot \frac{1}{x}\right)\right) \cdot \left(0.0007936500793651 + y\right)\right) + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\
\mathbf{if}\;t_0 \leq -2 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{-21}:\\
\;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + {\left(x \cdot 12.000000000000048\right)}^{-1}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error

Target

Original6.4
Target1.2
Herbie0.5
\[\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 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -1.99999999999999988e-11 or 3.99999999999999963e-21 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 15.9

      \[\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. Taylor expanded in z around inf 16.0

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \frac{z \cdot z}{x} \cdot \left(0.0007936500793651 + y\right)\right)} \]
      Proof
      (+.f64 (fma.f64 -13888888888889/5000000000000000 (/.f64 z x) (/.f64 83333333333333/1000000000000000 x)) (*.f64 (/.f64 (*.f64 z z) x) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 -13888888888889/5000000000000000 (/.f64 z x) (/.f64 (Rewrite<= metadata-eval (*.f64 83333333333333/1000000000000000 1)) x)) (*.f64 (/.f64 (*.f64 z z) x) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (fma.f64 -13888888888889/5000000000000000 (/.f64 z x) (Rewrite<= associate-*r/_binary64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)))) (*.f64 (/.f64 (*.f64 z z) x) (+.f64 7936500793651/10000000000000000 y))): 22 points increase in error, 27 points decrease in error
      (+.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 -13888888888889/5000000000000000 (/.f64 z x)) (*.f64 83333333333333/1000000000000000 (/.f64 1 x)))) (*.f64 (/.f64 (*.f64 z z) x) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x)))) (*.f64 (/.f64 (*.f64 z z) x) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (/.f64 (*.f64 z z) (Rewrite<= *-rgt-identity_binary64 (*.f64 x 1))) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (Rewrite=> times-frac_binary64 (*.f64 (/.f64 z x) (/.f64 z 1))) (+.f64 7936500793651/10000000000000000 y))): 6 points increase in error, 22 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (*.f64 (/.f64 (Rewrite<= remove-double-div_binary64 (/.f64 1 (/.f64 1 z))) x) (/.f64 z 1)) (+.f64 7936500793651/10000000000000000 y))): 5 points increase in error, 3 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (*.f64 (/.f64 (Rewrite<= unpow-1_binary64 (pow.f64 (/.f64 1 z) -1)) x) (/.f64 z 1)) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (*.f64 (/.f64 (pow.f64 (/.f64 1 z) (Rewrite<= metadata-eval (/.f64 -2 2))) x) (/.f64 z 1)) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (*.f64 (/.f64 (pow.f64 (/.f64 1 z) (/.f64 -2 2)) x) (/.f64 (Rewrite<= remove-double-div_binary64 (/.f64 1 (/.f64 1 z))) 1)) (+.f64 7936500793651/10000000000000000 y))): 12 points increase in error, 3 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (*.f64 (/.f64 (pow.f64 (/.f64 1 z) (/.f64 -2 2)) x) (/.f64 (Rewrite<= unpow-1_binary64 (pow.f64 (/.f64 1 z) -1)) 1)) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (*.f64 (/.f64 (pow.f64 (/.f64 1 z) (/.f64 -2 2)) x) (/.f64 (pow.f64 (/.f64 1 z) (Rewrite<= metadata-eval (/.f64 -2 2))) 1)) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (pow.f64 (/.f64 1 z) (/.f64 -2 2)) (pow.f64 (/.f64 1 z) (/.f64 -2 2))) (*.f64 x 1))) (+.f64 7936500793651/10000000000000000 y))): 24 points increase in error, 8 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (/.f64 (Rewrite<= sqr-pow_binary64 (pow.f64 (/.f64 1 z) -2)) (*.f64 x 1)) (+.f64 7936500793651/10000000000000000 y))): 4 points increase in error, 11 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (*.f64 (/.f64 (pow.f64 (/.f64 1 z) -2) (Rewrite=> *-rgt-identity_binary64 x)) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 (/.f64 1 z) -2) (/.f64 x (+.f64 7936500793651/10000000000000000 y))))): 37 points increase in error, 18 points decrease in error
      (+.f64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (*.f64 -13888888888889/5000000000000000 (/.f64 z x))) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 (/.f64 1 z) -2) (+.f64 7936500793651/10000000000000000 y)) x))): 25 points increase in error, 36 points decrease in error
      (Rewrite<= associate-+r+_binary64 (+.f64 (*.f64 83333333333333/1000000000000000 (/.f64 1 x)) (+.f64 (*.f64 -13888888888889/5000000000000000 (/.f64 z x)) (/.f64 (*.f64 (pow.f64 (/.f64 1 z) -2) (+.f64 7936500793651/10000000000000000 y)) x)))): 1 points increase in error, 1 points decrease in error
    4. Applied egg-rr0.7

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

      \[\leadsto \left(\left(\color{blue}{-1 \cdot \left(\log \left(\frac{1}{x}\right) \cdot x\right)} - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \left(z \cdot \left(z \cdot \frac{1}{x}\right)\right) \cdot \left(0.0007936500793651 + y\right)\right) \]
    6. Simplified0.8

      \[\leadsto \left(\left(\color{blue}{x \cdot \log x} - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \left(z \cdot \left(z \cdot \frac{1}{x}\right)\right) \cdot \left(0.0007936500793651 + y\right)\right) \]
      Proof
      (*.f64 x (log.f64 x)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (log.f64 x) x)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= remove-double-neg_binary64 (neg.f64 (neg.f64 (log.f64 x)))) x): 0 points increase in error, 0 points decrease in error
      (*.f64 (neg.f64 (Rewrite<= log-rec_binary64 (log.f64 (/.f64 1 x)))) x): 0 points increase in error, 1 points decrease in error
      (Rewrite=> distribute-lft-neg-out_binary64 (neg.f64 (*.f64 (log.f64 (/.f64 1 x)) x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (*.f64 (log.f64 (/.f64 1 x)) x))): 0 points increase in error, 0 points decrease in error

    if -1.99999999999999988e-11 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.99999999999999963e-21

    1. Initial program 0.4

      \[\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. Taylor expanded in z around 0 0.4

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    3. Applied egg-rr0.4

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{\left(x \cdot 12.000000000000048\right)}^{-1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.5

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

Alternatives

Alternative 1
Error1.7
Cost15688
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ t_1 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+191}:\\ \;\;\;\;t_1 + \frac{{\left(\frac{1}{z}\right)}^{-2}}{\frac{x}{0.0007936500793651 + y}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+290}:\\ \;\;\;\;t_1 + \frac{0.083333333333333 + t_0}{x}\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot 0.0007936500793651\right)\right)\\ \end{array} \]
Alternative 2
Error1.7
Cost15560
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ t_1 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+191}:\\ \;\;\;\;t_1 + \frac{{\left(\frac{1}{z}\right)}^{-2}}{\frac{x}{0.0007936500793651 + y}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+290}:\\ \;\;\;\;t_1 + \frac{0.083333333333333 + t_0}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + z \cdot \left(\frac{z}{x} \cdot 0.0007936500793651\right)\right)\\ \end{array} \]
Alternative 3
Error1.0
Cost15172
\[\begin{array}{l} t_0 := \mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right)\\ \mathbf{if}\;z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right) \leq 5 \cdot 10^{-24}:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(t_0 + \left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_0 + \left(z \cdot \left(z \cdot \frac{1}{x}\right)\right) \cdot \left(0.0007936500793651 + y\right)\right) + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 4
Error4.0
Cost15048
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ t_1 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;t_0 + \frac{0.083333333333333 + t_1}{x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.0007936500793651, \frac{z}{\frac{x}{z}}, \mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right)\right) - x\\ \end{array} \]
Alternative 5
Error4.0
Cost15048
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ t_1 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+191}:\\ \;\;\;\;t_1 + \frac{{\left(\frac{1}{z}\right)}^{-2}}{\frac{x}{0.0007936500793651 + y}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;t_1 + \frac{0.083333333333333 + t_0}{x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.0007936500793651, \frac{z}{\frac{x}{z}}, \mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right)\right) - x\\ \end{array} \]
Alternative 6
Error0.5
Cost14656
\[\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \left(z \cdot \left(z \cdot \frac{1}{x}\right)\right) \cdot \left(0.0007936500793651 + y\right)\right) \]
Alternative 7
Error1.2
Cost14528
\[\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\mathsf{fma}\left(-0.0027777777777778, \frac{z}{x}, \frac{0.083333333333333}{x}\right) + \frac{z \cdot \left(0.0007936500793651 + y\right)}{\frac{x}{z}}\right) \]
Alternative 8
Error3.1
Cost9160
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ t_1 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;t_0 + \frac{0.083333333333333 + t_1}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x} + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y}{x}\right)\right)\right) - x\\ \end{array} \]
Alternative 9
Error4.0
Cost9032
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{z \cdot z}{\frac{x}{y}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;\frac{0.083333333333333 + t_0}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{x} + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y}{x}\right)\right)\right) - x\\ \end{array} \]
Alternative 10
Error4.6
Cost7884
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;x \leq 1.1 \cdot 10^{-25}:\\ \;\;\;\;\left(\frac{y \cdot \left(z \cdot z\right)}{x} + \left(\frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) - x\\ \mathbf{elif}\;x \leq 1400000:\\ \;\;\;\;t_0 + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 1450000:\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_0 + z \cdot \left(z \cdot \frac{y}{x}\right)\\ \end{array} \]
Alternative 11
Error6.9
Cost7760
\[\begin{array}{l} \mathbf{if}\;x \leq 1.1 \cdot 10^{-25}:\\ \;\;\;\;\left(\frac{y \cdot \left(z \cdot z\right)}{x} + \left(\frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) - x\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{+20}:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\frac{0.083333333333333 + \left(0.0007936500793651 + y\right) \cdot \left(z \cdot z\right)}{x} - x\\ \mathbf{elif}\;x \leq 10^{+116}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + \frac{z \cdot \left(z \cdot y\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 12
Error3.8
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 5.3:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{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) + z \cdot \left(z \cdot \frac{y}{x}\right)\\ \end{array} \]
Alternative 13
Error4.8
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 0.205:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{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(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x}\\ \end{array} \]
Alternative 14
Error7.5
Cost7364
\[\begin{array}{l} \mathbf{if}\;x \leq 1.1 \cdot 10^{-25}:\\ \;\;\;\;\left(\frac{y \cdot \left(z \cdot z\right)}{x} + \left(\frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
Alternative 15
Error8.1
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 9.2 \cdot 10^{+27}:\\ \;\;\;\;\left(\frac{y \cdot \left(z \cdot z\right)}{x} + \left(\frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 16
Error35.6
Cost1600
\[\left(\frac{y \cdot \left(z \cdot z\right)}{x} + \left(\frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) - x \]
Alternative 17
Error36.8
Cost968
\[\begin{array}{l} t_0 := \left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x} - x\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{-34}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-5}:\\ \;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 18
Error35.3
Cost968
\[\begin{array}{l} t_0 := \left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x} - x\\ \mathbf{if}\;z \leq -3300:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-19}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot y\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 19
Error35.3
Cost968
\[\begin{array}{l} t_0 := \left(0.0007936500793651 + y\right) \cdot \frac{z \cdot z}{x} - x\\ \mathbf{if}\;z \leq -3300:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-19}:\\ \;\;\;\;\frac{0.083333333333333 + y \cdot \left(z \cdot z\right)}{x} - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 20
Error35.6
Cost960
\[\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(0.0007936500793651 + y\right)\right)}{x} - x \]
Alternative 21
Error39.8
Cost840
\[\begin{array}{l} t_0 := \frac{0.0007936500793651}{\frac{x}{z \cdot z}} - x\\ \mathbf{if}\;z \leq -3300:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 21:\\ \;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 22
Error36.0
Cost832
\[\frac{0.083333333333333 + \left(0.0007936500793651 + y\right) \cdot \left(z \cdot z\right)}{x} - x \]
Alternative 23
Error43.1
Cost320
\[0.083333333333333 \cdot \frac{1}{x} \]
Alternative 24
Error43.1
Cost192
\[\frac{0.083333333333333}{x} \]

Error

Reproduce

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