?

Average Error: 5.9 → 0.3
Time: 29.6s
Precision: binary64
Cost: 28297

?

\[\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 + \left(y + 0.0007936500793651\right) \cdot z\right)\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{+269} \lor \neg \left(t_0 \leq 10^{+258}\right):\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, -\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)\right)\right) + \frac{t_0 + 0.083333333333333}{x}\\ \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 (* (+ y 0.0007936500793651) z)))))
   (if (or (<= t_0 -5e+269) (not (<= t_0 1e+258)))
     (+
      (fma (+ x -0.5) (log x) (- 0.91893853320467 x))
      (* (+ y 0.0007936500793651) (/ z (/ x z))))
     (+
      (+ 0.91893853320467 (fma (log x) (+ x -0.5) (- (expm1 (log1p x)))))
      (/ (+ t_0 0.083333333333333) 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 = z * (-0.0027777777777778 + ((y + 0.0007936500793651) * z));
	double tmp;
	if ((t_0 <= -5e+269) || !(t_0 <= 1e+258)) {
		tmp = fma((x + -0.5), log(x), (0.91893853320467 - x)) + ((y + 0.0007936500793651) * (z / (x / z)));
	} else {
		tmp = (0.91893853320467 + fma(log(x), (x + -0.5), -expm1(log1p(x)))) + ((t_0 + 0.083333333333333) / 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(z * Float64(-0.0027777777777778 + Float64(Float64(y + 0.0007936500793651) * z)))
	tmp = 0.0
	if ((t_0 <= -5e+269) || !(t_0 <= 1e+258))
		tmp = Float64(fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z / Float64(x / z))));
	else
		tmp = Float64(Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(-expm1(log1p(x))))) + Float64(Float64(t_0 + 0.083333333333333) / 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[(z * N[(-0.0027777777777778 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e+269], N[Not[LessEqual[t$95$0, 1e+258]], $MachinePrecision]], N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + (-N[(Exp[N[Log[1 + x], $MachinePrecision]] - 1), $MachinePrecision])), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 + 0.083333333333333), $MachinePrecision] / x), $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 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{+269} \lor \neg \left(t_0 \leq 10^{+258}\right):\\
\;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\

\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, -\mathsf{expm1}\left(\mathsf{log1p}\left(x\right)\right)\right)\right) + \frac{t_0 + 0.083333333333333}{x}\\


\end{array}

Error?

Target

Original5.9
Target1.2
Herbie0.3
\[\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) < -5.0000000000000002e269 or 1.00000000000000006e258 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 48.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. Simplified48.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]48.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- [=>]48.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 [=>]48.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+ [=>]48.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+ [<=]48.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 [<=]48.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 [=>]48.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 [=>]48.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 [=>]48.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 [=>]48.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- [<=]48.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 [<=]48.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 [=>]48.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 [=>]48.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} \]
    3. Applied egg-rr48.3

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

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

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

      [Start]49.0

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

      +-commutative [=>]49.0

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

      associate-*l/ [<=]33.7

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

      unpow2 [=>]33.7

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

      associate-/l* [=>]0.8

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

    if -5.0000000000000002e269 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 1.00000000000000006e258

    1. Initial program 0.3

      \[\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.3

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

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

      [Start]0.3

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

      associate-+l- [=>]0.3

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

      *-commutative [=>]0.3

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

      fma-neg [=>]0.2

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

      sub-neg [=>]0.2

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

      metadata-eval [=>]0.2

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

      expm1-def [=>]0.2

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

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

Alternatives

Alternative 1
Error0.4
Cost27977
\[\begin{array}{l} t_0 := \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+269} \lor \neg \left(t_1 \leq 2 \cdot 10^{+169}\right):\\ \;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \end{array} \]
Alternative 2
Error0.4
Cost15561
\[\begin{array}{l} t_0 := \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\ t_1 := \left(y + 0.0007936500793651\right) \cdot z\\ t_2 := z \cdot \left(-0.0027777777777778 + t_1\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+269} \lor \neg \left(t_2 \leq 2 \cdot 10^{+169}\right):\\ \;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \frac{\left(0.083333333333333 + z \cdot t_1\right) + z \cdot -0.0027777777777778}{x}\\ \end{array} \]
Alternative 3
Error0.4
Cost14020
\[\begin{array}{l} \mathbf{if}\;x \leq 15500000:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 4
Error2.5
Cost8268
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ t_1 := \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ t_2 := \left(y + 0.0007936500793651\right) \cdot z\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{z}{\frac{x}{t_2}}\\ \mathbf{elif}\;z \leq -5 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + t_1\\ \mathbf{elif}\;z \leq 10^{+18}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + t_2\right) + 0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_0 + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 5
Error3.4
Cost8144
\[\begin{array}{l} t_0 := \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{z}{\frac{x}{\left(y + 0.0007936500793651\right) \cdot z}}\\ \mathbf{elif}\;z \leq -3.3 \cdot 10^{+28}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + t_0\\ \mathbf{elif}\;z \leq 11:\\ \;\;\;\;t_1 + \frac{0.083333333333333 + z \cdot \left(y \cdot z\right)}{x}\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;t_1 + t_0\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 6
Error3.6
Cost8144
\[\begin{array}{l} t_0 := x \cdot \left(\log x + -1\right)\\ t_1 := \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ t_2 := \left(y + 0.0007936500793651\right) \cdot z\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{z}{\frac{x}{t_2}}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+29}:\\ \;\;\;\;t_0 + t_1\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+16}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + t_2\right) + 0.083333333333333}{x} + \left(0.91893853320467 + t_0\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + t_1\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 7
Error2.4
Cost7880
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{+132}:\\ \;\;\;\;t_0 + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{else}:\\ \;\;\;\;t_0 + z \cdot \frac{0.0007936500793651 \cdot z}{x}\\ \end{array} \]
Alternative 8
Error3.1
Cost7752
\[\begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{+132}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \frac{0.0007936500793651 \cdot z}{x}\\ \end{array} \]
Alternative 9
Error2.8
Cost7752
\[\begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{elif}\;x \leq 5 \cdot 10^{+132}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + z \cdot \frac{0.0007936500793651 \cdot z}{x}\\ \end{array} \]
Alternative 10
Error5.4
Cost7492
\[\begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{-7}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \end{array} \]
Alternative 11
Error7.0
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 5.6 \cdot 10^{+17}:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 12
Error31.5
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -380000000000:\\ \;\;\;\;z \cdot \left(z \cdot \left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right)\right)\\ \mathbf{elif}\;z \leq 1050000000000:\\ \;\;\;\;\frac{z \cdot \left(-0.0027777777777778 + \left(y + 0.0007936500793651\right) \cdot z\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 13
Error52.4
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -230000000 \lor \neg \left(y \leq 3.7 \cdot 10^{+26}\right):\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 14
Error52.3
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -240000000 \lor \neg \left(y \leq 1.04 \cdot 10^{+21}\right):\\ \;\;\;\;y \cdot \frac{z \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 15
Error52.3
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -0.00098 \lor \neg \left(y \leq 0.00029\right):\\ \;\;\;\;z \cdot \left(y \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 16
Error51.9
Cost713
\[\begin{array}{l} \mathbf{if}\;y \leq -230000000 \lor \neg \left(y \leq 0.00029\right):\\ \;\;\;\;\frac{y}{\frac{\frac{x}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 17
Error52.4
Cost712
\[\begin{array}{l} \mathbf{if}\;y \leq -240000000:\\ \;\;\;\;z \cdot \frac{y}{\frac{x}{z}}\\ \mathbf{elif}\;y \leq 0.00029:\\ \;\;\;\;z \cdot \left(0.0007936500793651 \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(y \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 18
Error51.7
Cost576
\[\left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}} \]
Alternative 19
Error57.0
Cost448
\[0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right) \]

Error

Reproduce?

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