Average Error: 6.0 → 0.4
Time: 19.3s
Precision: binary64
Cost: 14536
\[\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 := \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{+16}:\\ \;\;\;\;t_0 + \frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+18}:\\ \;\;\;\;t_0 + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right) + \left(z \cdot -0.0027777777777778 + 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + 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 (fma (+ x -0.5) (log x) (- 0.91893853320467 x))))
   (if (<= z -1.75e+16)
     (+ t_0 (* (/ z (/ x z)) (+ y 0.0007936500793651)))
     (if (<= z 7.5e+18)
       (+
        t_0
        (/
         (+
          (* z (* z (+ y 0.0007936500793651)))
          (+ (* z -0.0027777777777778) 0.083333333333333))
         x))
       (+
        (+ 0.91893853320467 (- (* (+ x -0.5) (log x)) x))
        (* 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 = fma((x + -0.5), log(x), (0.91893853320467 - x));
	double tmp;
	if (z <= -1.75e+16) {
		tmp = t_0 + ((z / (x / z)) * (y + 0.0007936500793651));
	} else if (z <= 7.5e+18) {
		tmp = t_0 + (((z * (z * (y + 0.0007936500793651))) + ((z * -0.0027777777777778) + 0.083333333333333)) / x);
	} else {
		tmp = (0.91893853320467 + (((x + -0.5) * log(x)) - x)) + (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 = fma(Float64(x + -0.5), log(x), Float64(0.91893853320467 - x))
	tmp = 0.0
	if (z <= -1.75e+16)
		tmp = Float64(t_0 + Float64(Float64(z / Float64(x / z)) * Float64(y + 0.0007936500793651)));
	elseif (z <= 7.5e+18)
		tmp = Float64(t_0 + Float64(Float64(Float64(z * Float64(z * Float64(y + 0.0007936500793651))) + Float64(Float64(z * -0.0027777777777778) + 0.083333333333333)) / x));
	else
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(Float64(x + -0.5) * log(x)) - x)) + 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[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+16], N[(t$95$0 + N[(N[(z / N[(x / z), $MachinePrecision]), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e+18], N[(t$95$0 + N[(N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + 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 := \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+16}:\\
\;\;\;\;t_0 + \frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right)\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+18}:\\
\;\;\;\;t_0 + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right)\right) + \left(z \cdot -0.0027777777777778 + 0.083333333333333\right)}{x}\\

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


\end{array}

Error

Target

Original6.0
Target1.2
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 3 regimes
  2. if z < -1.75e16

    1. Initial program 23.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. Simplified23.0

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

      associate-+l- [=>]23.0

      \[ \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 [=>]23.0

      \[ \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+ [=>]23.0

      \[ \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+ [<=]23.0

      \[ \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 [<=]23.0

      \[ \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 [=>]23.0

      \[ \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 [=>]23.0

      \[ \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 [=>]23.0

      \[ \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 [=>]23.0

      \[ \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- [<=]23.0

      \[ \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 [<=]23.0

      \[ \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 [=>]23.0

      \[ \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 [=>]23.0

      \[ \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-rr23.0

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

      \[\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. Simplified1.0

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

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

      +-commutative [<=]23.3

      \[ \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/ [<=]15.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 [=>]15.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* [=>]1.0

      \[ \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 -1.75e16 < z < 7.5e18

    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} \]
    3. Applied egg-rr0.3

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

    if 7.5e18 < z

    1. Initial program 22.8

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

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

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

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

      associate-/l* [=>]16.5

      \[ \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 [=>]16.5

      \[ \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-rr0.4

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

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

Alternatives

Alternative 1
Error0.4
Cost14020
\[\begin{array}{l} \mathbf{if}\;x \leq 500000:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \left(\frac{y}{\frac{x}{z \cdot z}} + \left(\frac{0.083333333333333}{x} + \frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right)\\ \end{array} \]
Alternative 2
Error0.4
Cost9161
\[\begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+16} \lor \neg \left(t_0 \leq 2 \cdot 10^{+136}\right):\\ \;\;\;\;\frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right) + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \frac{0.083333333333333 + t_0}{x}\\ \end{array} \]
Alternative 3
Error0.4
Cost9161
\[\begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_0 \leq -4 \cdot 10^{+16} \lor \neg \left(t_0 \leq 2 \cdot 10^{+136}\right):\\ \;\;\;\;\frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right) + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right) + \frac{0.083333333333333 + t_0}{x}\\ \end{array} \]
Alternative 4
Error1.4
Cost8905
\[\begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_0 \leq -40000000 \lor \neg \left(t_0 \leq 10^{-16}\right):\\ \;\;\;\;\frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right) + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \left(\frac{0.083333333333333}{x} + -0.0027777777777778 \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 5
Error1.5
Cost8649
\[\begin{array}{l} t_0 := z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) + -0.0027777777777778\right)\\ \mathbf{if}\;t_0 \leq -40000000 \lor \neg \left(t_0 \leq 10^{-16}\right):\\ \;\;\;\;\frac{z}{\frac{x}{z}} \cdot \left(y + 0.0007936500793651\right) + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right)\\ \end{array} \]
Alternative 6
Error0.4
Cost8649
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+101} \lor \neg \left(z \leq 5 \cdot 10^{+15}\right):\\ \;\;\;\;t_0 + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 + \left(\frac{y}{\frac{x}{z \cdot z}} + \left(\frac{0.083333333333333}{x} + \frac{z \cdot \left(-0.0027777777777778 + z \cdot 0.0007936500793651\right)}{x}\right)\right)\\ \end{array} \]
Alternative 7
Error8.3
Cost7889
\[\begin{array}{l} t_0 := \left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + 0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+142}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+86}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+15} \lor \neg \left(z \leq 9 \cdot 10^{-47}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right)\\ \end{array} \]
Alternative 8
Error8.2
Cost7889
\[\begin{array}{l} t_0 := 0.91893853320467 + \left(x \cdot \log x - x\right)\\ \mathbf{if}\;z \leq -1 \cdot 10^{+142}:\\ \;\;\;\;t_0 + 0.0007936500793651 \cdot \left(z \cdot \frac{z}{x}\right)\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{+86}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+15} \lor \neg \left(z \leq 9 \cdot 10^{-47}\right):\\ \;\;\;\;t_0 + z \cdot \left(z \cdot \frac{0.0007936500793651}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right)\\ \end{array} \]
Alternative 9
Error0.8
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 0.195:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) + -0.0027777777777778\right)}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + z \cdot \left(\left(y + 0.0007936500793651\right) \cdot \frac{z}{x}\right)\\ \end{array} \]
Alternative 10
Error10.6
Cost7629
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{-17} \lor \neg \left(z \leq 9 \cdot 10^{-47}\right):\\ \;\;\;\;t_0 + \left(z \cdot z\right) \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
Alternative 11
Error10.4
Cost7629
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-18} \lor \neg \left(z \leq 9 \cdot 10^{-47}\right):\\ \;\;\;\;\frac{y}{\frac{x}{z \cdot z}} + t_0\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
Alternative 12
Error10.5
Cost7629
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{-19} \lor \neg \left(z \leq 4.5 \cdot 10^{-50}\right):\\ \;\;\;\;\frac{y}{\frac{x}{z \cdot z}} + t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right)\\ \end{array} \]
Alternative 13
Error11.8
Cost7628
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ \mathbf{if}\;z \leq -7 \cdot 10^{+142}:\\ \;\;\;\;\frac{0.083333333333333}{x} + t_0\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+86}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-47}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\left(0.91893853320467 + \left(x + -0.5\right) \cdot \log x\right) - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{x}{z \cdot z}} + t_0\\ \end{array} \]
Alternative 14
Error11.5
Cost7232
\[\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x} \]
Alternative 15
Error12.3
Cost7104
\[\frac{0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) \]
Alternative 16
Error12.4
Cost6976
\[\frac{0.083333333333333}{x} + \left(x \cdot \log x - x\right) \]
Alternative 17
Error42.9
Cost6656
\[{\left(x \cdot 12.000000000000048\right)}^{-1} \]
Alternative 18
Error42.9
Cost192
\[\frac{0.083333333333333}{x} \]

Error

Reproduce

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