?

Average Error: 6.0 → 0.5
Time: 26.3s
Precision: binary64
Cost: 27976

?

\[\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 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ t_1 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;t_0 + y \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+32}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\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
 (let* ((t_0 (+ (- (* (+ x -0.5) (log x)) x) 0.91893853320467))
        (t_1 (* z (+ -0.0027777777777778 (* (+ y 0.0007936500793651) z)))))
   (if (<= t_1 (- INFINITY))
     (+ t_0 (* y (/ z (/ x z))))
     (if (<= t_1 5e+32)
       (+
        (fma (+ x -0.5) (log x) (- 0.91893853320467 x))
        (/
         (fma
          z
          (fma (+ y 0.0007936500793651) z -0.0027777777777778)
          0.083333333333333)
         x))
       (+ t_0 (* z (* (+ y 0.0007936500793651) (/ z 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 t_0 = (((x + -0.5) * log(x)) - x) + 0.91893853320467;
	double t_1 = z * (-0.0027777777777778 + ((y + 0.0007936500793651) * z));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_0 + (y * (z / (x / z)));
	} else if (t_1 <= 5e+32) {
		tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
	} else {
		tmp = t_0 + (z * ((y + 0.0007936500793651) * (z / 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)
	t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + 0.91893853320467)
	t_1 = Float64(z * Float64(-0.0027777777777778 + Float64(Float64(y + 0.0007936500793651) * z)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(t_0 + Float64(y * Float64(z / Float64(x / z))));
	elseif (t_1 <= 5e+32)
		tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x));
	else
		tmp = Float64(t_0 + Float64(z * Float64(Float64(y + 0.0007936500793651) * Float64(z / 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_] := Block[{t$95$0 = N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(-0.0027777777777778 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t$95$0 + N[(y * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+32], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / x), $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}
t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\
t_1 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_0 + y \cdot \frac{z}{\frac{x}{z}}\\

\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+32}:\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\

\mathbf{else}:\\
\;\;\;\;t_0 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\


\end{array}

Error?

Target

Original6.0
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 3 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -inf.0

    1. Initial program 64.0

      \[\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 64.0

      \[\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}} \]
    3. Simplified23.6

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

      [Start]64.0

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

      associate-/l* [=>]23.6

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

      unpow2 [=>]23.6

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
    5. Simplified1.3

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

      [Start]64.0

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

      unpow2 [=>]64.0

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

      associate-*r/ [<=]23.6

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

      associate-/l* [=>]1.3

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

    if -inf.0 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 4.9999999999999997e32

    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. Simplified0.3

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

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

      associate-+l- [=>]0.4

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

      sub-neg [=>]0.4

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

      associate--r+ [=>]0.4

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

      associate--r+ [<=]0.4

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

      sub-neg [<=]0.4

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

      fma-neg [=>]0.3

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

      sub-neg [=>]0.3

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

      metadata-eval [=>]0.3

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

      neg-sub0 [=>]0.3

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

      associate-+l- [<=]0.3

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

      neg-sub0 [<=]0.3

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

      +-commutative [=>]0.3

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

      unsub-neg [=>]0.3

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

    if 4.9999999999999997e32 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 18.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. Taylor expanded in z around inf 18.3

      \[\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}} \]
    3. Simplified15.8

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

      [Start]18.3

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

      associate-/l* [=>]15.8

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

      unpow2 [=>]15.8

      \[ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\color{blue}{z \cdot z}}{\frac{x}{0.0007936500793651 + y}} \]
    4. Applied egg-rr1.0

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

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

Alternatives

Alternative 1
Error0.5
Cost23753
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ t_1 := t_0 + \frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+278} \lor \neg \left(t_1 \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;t_0 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error2.1
Cost8904
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\ t_1 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{+103}:\\ \;\;\;\;t_1 + y \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{-11}:\\ \;\;\;\;t_1 + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_1 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 3
Error0.6
Cost8388
\[\begin{array}{l} \mathbf{if}\;x \leq 2 \cdot 10^{+58}:\\ \;\;\;\;\left(0.91893853320467 + \left(\frac{\log x}{-0.5 - x} \cdot \left(0.25 - x \cdot x\right) - x\right)\right) + \frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 4
Error4.1
Cost7752
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;x \leq 2.3:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+173}:\\ \;\;\;\;t_0 + 0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 5
Error4.1
Cost7752
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;x \leq 24:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+174}:\\ \;\;\;\;t_0 + z \cdot \frac{z}{\frac{x}{0.0007936500793651}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 6
Error3.8
Cost7752
\[\begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ \mathbf{if}\;x \leq 6.2:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{elif}\;x \leq 10^{+172}:\\ \;\;\;\;t_0 + z \cdot \frac{z}{\frac{x}{0.0007936500793651}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 7
Error4.1
Cost7620
\[\begin{array}{l} \mathbf{if}\;x \leq 2.95:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x + -0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + 0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 8
Error6.1
Cost7496
\[\begin{array}{l} \mathbf{if}\;x \leq 2.9 \cdot 10^{+14}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{+125}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + \frac{z \cdot \left(y \cdot z\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 9
Error4.4
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 118:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right)\\ \end{array} \]
Alternative 10
Error6.9
Cost7364
\[\begin{array}{l} \mathbf{if}\;x \leq 0.00012:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\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 11
Error7.9
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 7.5 \cdot 10^{+27}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z\right) + z \cdot -0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 12
Error31.0
Cost2760
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333\\ t_1 := \frac{z \cdot -0.0027777777777778}{x}\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{+103}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(y \cdot \frac{z}{\frac{x}{z}} + t_1\right)\\ \mathbf{elif}\;t_0 \leq 0.1:\\ \;\;\;\;x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right) + t_1\right)\\ \end{array} \]
Alternative 13
Error31.0
Cost2504
\[\begin{array}{l} t_0 := -0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\\ t_1 := z \cdot t_0 + 0.083333333333333\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+103}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(y \cdot \frac{z}{\frac{x}{z}} + \frac{z \cdot -0.0027777777777778}{x}\right)\\ \mathbf{elif}\;t_1 \leq 0.1:\\ \;\;\;\;x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{z}{x} \cdot t_0\\ \end{array} \]
Alternative 14
Error32.4
Cost1225
\[\begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{-15} \lor \neg \left(z \leq 1.9 \cdot 10^{-12}\right):\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{z}{x} \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\ \end{array} \]
Alternative 15
Error34.1
Cost1097
\[\begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{-14} \lor \neg \left(z \leq 3.5 \cdot 10^{-12}\right):\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\ \end{array} \]
Alternative 16
Error34.1
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -2.25 \cdot 10^{-14}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-16}:\\ \;\;\;\;x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\ \end{array} \]
Alternative 17
Error38.8
Cost969
\[\begin{array}{l} \mathbf{if}\;z \leq 2.1 \cdot 10^{-12} \lor \neg \left(z \leq 2.05 \cdot 10^{+62}\right):\\ \;\;\;\;x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(z \cdot z\right) \cdot \frac{y}{x}\\ \end{array} \]
Alternative 18
Error39.2
Cost448
\[x + \left(0.91893853320467 + \frac{0.083333333333333}{x}\right) \]
Alternative 19
Error42.2
Cost320
\[0.91893853320467 + \frac{0.083333333333333}{x} \]
Alternative 20
Error42.7
Cost192
\[\frac{0.083333333333333}{x} \]
Alternative 21
Error63.3
Cost128
\[-x \]

Error

Reproduce?

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