Average Error: 6.0 → 0.4
Time: 30.5s
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 10000000000:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + \left(z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(\left(0.0007936500793651 + y\right) \cdot \left(z \cdot \frac{z}{x}\right) - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right)\\ \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 10000000000.0)
   (+
    (+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))
    (/
     (+
      0.083333333333333
      (+ (* z (* z (+ 0.0007936500793651 y))) (* z -0.0027777777777778)))
     x))
   (+
    0.91893853320467
    (- (* (+ 0.0007936500793651 y) (* z (/ z x))) (fma (log x) (- 0.5 x) x)))))
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 <= 10000000000.0) {
		tmp = (0.91893853320467 + ((log(x) * (x + -0.5)) - x)) + ((0.083333333333333 + ((z * (z * (0.0007936500793651 + y))) + (z * -0.0027777777777778))) / x);
	} else {
		tmp = 0.91893853320467 + (((0.0007936500793651 + y) * (z * (z / x))) - fma(log(x), (0.5 - x), x));
	}
	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 <= 10000000000.0)
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(Float64(z * Float64(z * Float64(0.0007936500793651 + y))) + Float64(z * -0.0027777777777778))) / x));
	else
		tmp = Float64(0.91893853320467 + Float64(Float64(Float64(0.0007936500793651 + y) * Float64(z * Float64(z / x))) - fma(log(x), Float64(0.5 - x), x)));
	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, 10000000000.0], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(N[(z * N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.91893853320467 + N[(N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Log[x], $MachinePrecision] * N[(0.5 - x), $MachinePrecision] + x), $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 10000000000:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + \left(z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right) + z \cdot -0.0027777777777778\right)}{x}\\

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


\end{array}

Error

Target

Original6.0
Target1.5
Herbie0.4
\[\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 < 1e10

    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. Applied egg-rr0.4

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

    if 1e10 < x

    1. Initial program 10.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. Simplified10.2

      \[\leadsto \color{blue}{0.91893853320467 + \left(\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right)} \]
      Proof
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z -13888888888889/5000000000000000) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (fma.f64 z (fma.f64 (+.f64 y 7936500793651/10000000000000000) z (Rewrite<= metadata-eval (neg.f64 13888888888889/5000000000000000))) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (fma.f64 z (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000)) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 1 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 z (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000)) 83333333333333/1000000000000000)) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (-.f64 1/2 x) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite<= unsub-neg_binary64 (+.f64 1/2 (neg.f64 x))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite=> +-commutative_binary64 (+.f64 (neg.f64 x) 1/2)) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (+.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 x)) 1/2) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite<= associate--r-_binary64 (-.f64 0 (-.f64 x 1/2))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (fma.f64 (log.f64 x) (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 x 1/2))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (log.f64 x) (neg.f64 (-.f64 x 1/2))) x)))): 20 points increase in error, 7 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (log.f64 x) (-.f64 x 1/2)))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (+.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 x 1/2) (log.f64 x)))) x))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (Rewrite<= +-commutative_binary64 (+.f64 x (neg.f64 (*.f64 (-.f64 x 1/2) (log.f64 x))))))): 0 points increase in error, 0 points decrease in error
      (+.f64 91893853320467/100000000000000 (-.f64 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x) (Rewrite<= sub-neg_binary64 (-.f64 x (*.f64 (-.f64 x 1/2) (log.f64 x)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-+r-_binary64 (-.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (-.f64 x (*.f64 (-.f64 x 1/2) (log.f64 x))))): 1 points increase in error, 1 points decrease in error
      (Rewrite=> associate--r-_binary64 (+.f64 (-.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) x) (*.f64 (-.f64 x 1/2) (log.f64 x)))): 0 points increase in error, 2 points decrease in error
      (+.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (neg.f64 x))) (*.f64 (-.f64 x 1/2) (log.f64 x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+r+_binary64 (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (+.f64 (neg.f64 x) (*.f64 (-.f64 x 1/2) (log.f64 x))))): 2 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) (neg.f64 x)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)) (Rewrite<= sub-neg_binary64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x) (+.f64 91893853320467/100000000000000 (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-+l+_binary64 (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x 1/2) (log.f64 x)) x) 91893853320467/100000000000000) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) 83333333333333/1000000000000000) x))): 1 points increase in error, 1 points decrease in error
    3. Taylor expanded in z around inf 10.2

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

      \[\leadsto 0.91893853320467 + \left(\color{blue}{\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)} - \mathsf{fma}\left(\log x, 0.5 - x, x\right)\right) \]
      Proof
      (*.f64 (+.f64 y 7936500793651/10000000000000000) (*.f64 z (/.f64 z x))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 7936500793651/10000000000000000 y)) (*.f64 z (/.f64 z x))): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 7936500793651/10000000000000000 y) (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 z z) x))): 51 points increase in error, 27 points decrease in error
      (*.f64 (+.f64 7936500793651/10000000000000000 y) (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 z 2)) x)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 z 2) x) (+.f64 7936500793651/10000000000000000 y))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (pow.f64 z 2) (+.f64 7936500793651/10000000000000000 y)) x)): 30 points increase in error, 15 points decrease in error
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

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

Alternatives

Alternative 1
Error1.5
Cost14272
\[\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651 + y, -0.0027777777777778\right)\right) \]
Alternative 2
Error0.5
Cost9544
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_3 := t_2 + \left(\frac{0.083333333333333}{x} + \left(\frac{z}{x} \cdot -0.0027777777777778 + z \cdot \frac{z}{\frac{x}{0.0007936500793651 + y}}\right)\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+93}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_1 \leq 10^{+192}:\\ \;\;\;\;t_2 + \frac{0.083333333333333 + \left(z \cdot t_0 + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Error1.0
Cost9288
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;t_1 \leq -4 \cdot 10^{+145}:\\ \;\;\;\;t_2 + z \cdot \left(z \cdot \frac{y}{x}\right)\\ \mathbf{elif}\;t_1 \leq 10^{+225}:\\ \;\;\;\;t_2 + \frac{0.083333333333333 + \left(z \cdot t_0 + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{t_0}{\frac{x}{z}}\\ \end{array} \]
Alternative 4
Error1.9
Cost9160
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+17}:\\ \;\;\;\;t_2 + \frac{t_0}{\frac{x}{z}}\\ \mathbf{elif}\;t_1 \leq 1000000000:\\ \;\;\;\;t_2 + \left(\frac{0.083333333333333}{x} + \frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{z}{x} \cdot t_0\\ \end{array} \]
Alternative 5
Error1.0
Cost9160
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;t_1 \leq -4 \cdot 10^{+145}:\\ \;\;\;\;t_2 + z \cdot \left(z \cdot \frac{y}{x}\right)\\ \mathbf{elif}\;t_1 \leq 10^{+225}:\\ \;\;\;\;t_2 + \frac{0.083333333333333 + t_1}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{t_0}{\frac{x}{z}}\\ \end{array} \]
Alternative 6
Error1.9
Cost9032
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+17}:\\ \;\;\;\;t_2 + \frac{t_0}{\frac{x}{z}}\\ \mathbf{elif}\;t_1 \leq 1000000000:\\ \;\;\;\;t_2 + \frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{z}{x} \cdot t_0\\ \end{array} \]
Alternative 7
Error7.1
Cost7884
\[\begin{array}{l} t_0 := \log x \cdot \left(x + -0.5\right)\\ t_1 := 0.91893853320467 + \left(t_0 - x\right)\\ t_2 := t_1 + z \cdot \left(\frac{z}{x} \cdot 0.0007936500793651\right)\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-18}:\\ \;\;\;\;t_1 + y \cdot \frac{z \cdot z}{x}\\ \mathbf{elif}\;z \leq 1500000:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + t_0\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 8
Error7.0
Cost7884
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_1 := t_0 + z \cdot \left(\frac{z}{x} \cdot 0.0007936500793651\right)\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3.35 \cdot 10^{-18}:\\ \;\;\;\;t_0 + y \cdot \frac{z \cdot z}{x}\\ \mathbf{elif}\;z \leq 8.5:\\ \;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error4.7
Cost7880
\[\begin{array}{l} t_0 := \log x \cdot \left(x + -0.5\right)\\ t_1 := \left(0.91893853320467 + \left(t_0 - x\right)\right) + \frac{z \cdot \left(0.0007936500793651 + y\right)}{\frac{x}{z}}\\ \mathbf{if}\;z \leq -2.5395450579810315 \cdot 10^{-39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.4549068488256894 \cdot 10^{-48}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + t_0\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error4.5
Cost7880
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := \log x \cdot \left(x + -0.5\right)\\ t_2 := 0.91893853320467 + \left(t_1 - x\right)\\ \mathbf{if}\;z \leq -3.35 \cdot 10^{-18}:\\ \;\;\;\;t_2 + \frac{z}{\frac{x}{t_0}}\\ \mathbf{elif}\;z \leq 2.4549068488256894 \cdot 10^{-48}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + t_1\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{t_0}{\frac{x}{z}}\\ \end{array} \]
Alternative 11
Error4.5
Cost7880
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := \log x \cdot \left(x + -0.5\right)\\ t_2 := 0.91893853320467 + \left(t_1 - x\right)\\ \mathbf{if}\;z \leq -3.35 \cdot 10^{-18}:\\ \;\;\;\;t_2 + \frac{z}{x} \cdot t_0\\ \mathbf{elif}\;z \leq 2.4549068488256894 \cdot 10^{-48}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + t_1\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_2 + \frac{t_0}{\frac{x}{z}}\\ \end{array} \]
Alternative 12
Error4.1
Cost7880
\[\begin{array}{l} t_0 := \log x \cdot \left(x + -0.5\right)\\ t_1 := 0.91893853320467 + \left(t_0 - x\right)\\ \mathbf{if}\;z \leq -3.35 \cdot 10^{-18}:\\ \;\;\;\;t_1 + \frac{z}{x} \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right)\\ \mathbf{elif}\;z \leq 2.4549068488256894 \cdot 10^{-48}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + t_0\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_1 + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\ \end{array} \]
Alternative 13
Error0.8
Cost7876
\[\begin{array}{l} \mathbf{if}\;x \leq 0.2:\\ \;\;\;\;\frac{0.083333333333333 + \left(z \cdot \left(z \cdot \left(0.0007936500793651 + y\right)\right) + z \cdot -0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\ \end{array} \]
Alternative 14
Error7.0
Cost7752
\[\begin{array}{l} t_0 := \log x \cdot \left(x + -0.5\right)\\ t_1 := \left(0.91893853320467 + \left(t_0 - x\right)\right) + z \cdot \left(\frac{z}{x} \cdot 0.0007936500793651\right)\\ \mathbf{if}\;z \leq -850000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1500000:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + t_0\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 15
Error0.8
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 0.2:\\ \;\;\;\;\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(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right)\\ \end{array} \]
Alternative 16
Error15.5
Cost7628
\[\begin{array}{l} t_0 := 0.91893853320467 + \log x \cdot -0.5\\ t_1 := t_0 + \frac{z}{x} \cdot \left(z \cdot 0.0007936500793651\right)\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3300000000:\\ \;\;\;\;t_0 + \frac{z}{x} \cdot \left(z \cdot y\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+109}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 17
Error15.5
Cost7628
\[\begin{array}{l} t_0 := 0.91893853320467 + \log x \cdot -0.5\\ t_1 := t_0 + \frac{z}{x} \cdot \left(z \cdot 0.0007936500793651\right)\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3300000000:\\ \;\;\;\;t_0 + z \cdot \left(\frac{z}{x} \cdot y\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+109}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 18
Error14.6
Cost7628
\[\begin{array}{l} t_0 := 0.91893853320467 + \log x \cdot -0.5\\ t_1 := t_0 + \frac{z}{x} \cdot \left(z \cdot 0.0007936500793651\right)\\ \mathbf{if}\;z \leq -1.02 \cdot 10^{+46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -3300000000:\\ \;\;\;\;t_0 + z \cdot \left(\frac{z}{x} \cdot y\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+109}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \log x \cdot \left(x + -0.5\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 19
Error12.6
Cost7624
\[\begin{array}{l} t_0 := \left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{z}{\frac{x}{z \cdot \left(0.0007936500793651 + y\right)}}\\ \mathbf{if}\;z \leq -3300000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+109}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \log x \cdot \left(x + -0.5\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 20
Error12.6
Cost7624
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := 0.91893853320467 + \log x \cdot -0.5\\ \mathbf{if}\;z \leq -3300000000:\\ \;\;\;\;t_1 + \frac{z}{\frac{x}{t_0}}\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+109}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \log x \cdot \left(x + -0.5\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{\frac{x}{z}} + t_1\\ \end{array} \]
Alternative 21
Error12.6
Cost7624
\[\begin{array}{l} t_0 := z \cdot \left(0.0007936500793651 + y\right)\\ t_1 := 0.91893853320467 + \log x \cdot -0.5\\ \mathbf{if}\;z \leq -3300000000:\\ \;\;\;\;\frac{z}{x} \cdot t_0 + t_1\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{+109}:\\ \;\;\;\;\left(\left(0.91893853320467 + \frac{0.083333333333333}{x}\right) + \log x \cdot \left(x + -0.5\right)\right) - x\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{\frac{x}{z}} + t_1\\ \end{array} \]
Alternative 22
Error12.3
Cost7236
\[\begin{array}{l} \mathbf{if}\;x \leq 0.2:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot -0.5 - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \end{array} \]
Alternative 23
Error12.5
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq 0.034:\\ \;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \end{array} \]
Alternative 24
Error12.3
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq 0.2:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \end{array} \]
Alternative 25
Error12.8
Cost7104
\[\frac{0.083333333333333}{x} + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) \]
Alternative 26
Error12.7
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 0.2:\\ \;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \log x - x\\ \end{array} \]
Alternative 27
Error43.1
Cost6656
\[{\left(x \cdot 12.000000000000048\right)}^{-1} \]
Alternative 28
Error43.2
Cost192
\[\frac{0.083333333333333}{x} \]

Error

Reproduce

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