?

Average Error: 6.1 → 1.0
Time: 21.4s
Precision: binary64
Cost: 23816

?

\[\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 := t_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ t_2 := \frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\\ \mathbf{if}\;t_1 \leq 50000000000000:\\ \;\;\;\;t_0 + t_2\\ \mathbf{elif}\;t_1 \leq 10^{+308}:\\ \;\;\;\;x \cdot \left(-1 + \left(-\log \left(\frac{1}{x}\right)\right)\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right) - z \cdot 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\log x \cdot x - x\right) + t_2\\ \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
         (+
          t_0
          (/
           (+
            (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
            0.083333333333333)
           x)))
        (t_2
         (+
          (/ 0.083333333333333 x)
          (* z (* z (/ (+ y 0.0007936500793651) x))))))
   (if (<= t_1 50000000000000.0)
     (+ t_0 t_2)
     (if (<= t_1 1e+308)
       (+
        (* x (+ -1.0 (- (log (/ 1.0 x)))))
        (/
         (+
          (- (* (+ y 0.0007936500793651) (* z z)) (* z 0.0027777777777778))
          0.083333333333333)
         x))
       (+ (- (* (log x) x) x) t_2)))))
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 = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	double t_2 = (0.083333333333333 / x) + (z * (z * ((y + 0.0007936500793651) / x)));
	double tmp;
	if (t_1 <= 50000000000000.0) {
		tmp = t_0 + t_2;
	} else if (t_1 <= 1e+308) {
		tmp = (x * (-1.0 + -log((1.0 / x)))) + (((((y + 0.0007936500793651) * (z * z)) - (z * 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = ((log(x) * x) - x) + t_2;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0
    t_1 = t_0 + ((((((y + 0.0007936500793651d0) * z) - 0.0027777777777778d0) * z) + 0.083333333333333d0) / x)
    t_2 = (0.083333333333333d0 / x) + (z * (z * ((y + 0.0007936500793651d0) / x)))
    if (t_1 <= 50000000000000.0d0) then
        tmp = t_0 + t_2
    else if (t_1 <= 1d+308) then
        tmp = (x * ((-1.0d0) + -log((1.0d0 / x)))) + (((((y + 0.0007936500793651d0) * (z * z)) - (z * 0.0027777777777778d0)) + 0.083333333333333d0) / x)
    else
        tmp = ((log(x) * x) - x) + t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
}
public static double code(double x, double y, double z) {
	double t_0 = (((x - 0.5) * Math.log(x)) - x) + 0.91893853320467;
	double t_1 = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	double t_2 = (0.083333333333333 / x) + (z * (z * ((y + 0.0007936500793651) / x)));
	double tmp;
	if (t_1 <= 50000000000000.0) {
		tmp = t_0 + t_2;
	} else if (t_1 <= 1e+308) {
		tmp = (x * (-1.0 + -Math.log((1.0 / x)))) + (((((y + 0.0007936500793651) * (z * z)) - (z * 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = ((Math.log(x) * x) - x) + t_2;
	}
	return tmp;
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
def code(x, y, z):
	t_0 = (((x - 0.5) * math.log(x)) - x) + 0.91893853320467
	t_1 = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x)
	t_2 = (0.083333333333333 / x) + (z * (z * ((y + 0.0007936500793651) / x)))
	tmp = 0
	if t_1 <= 50000000000000.0:
		tmp = t_0 + t_2
	elif t_1 <= 1e+308:
		tmp = (x * (-1.0 + -math.log((1.0 / x)))) + (((((y + 0.0007936500793651) * (z * z)) - (z * 0.0027777777777778)) + 0.083333333333333) / x)
	else:
		tmp = ((math.log(x) * x) - x) + t_2
	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(t_0 + Float64(Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x))
	t_2 = Float64(Float64(0.083333333333333 / x) + Float64(z * Float64(z * Float64(Float64(y + 0.0007936500793651) / x))))
	tmp = 0.0
	if (t_1 <= 50000000000000.0)
		tmp = Float64(t_0 + t_2);
	elseif (t_1 <= 1e+308)
		tmp = Float64(Float64(x * Float64(-1.0 + Float64(-log(Float64(1.0 / x))))) + Float64(Float64(Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z * z)) - Float64(z * 0.0027777777777778)) + 0.083333333333333) / x));
	else
		tmp = Float64(Float64(Float64(log(x) * x) - x) + t_2);
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
end
function tmp_2 = code(x, y, z)
	t_0 = (((x - 0.5) * log(x)) - x) + 0.91893853320467;
	t_1 = t_0 + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x);
	t_2 = (0.083333333333333 / x) + (z * (z * ((y + 0.0007936500793651) / x)));
	tmp = 0.0;
	if (t_1 <= 50000000000000.0)
		tmp = t_0 + t_2;
	elseif (t_1 <= 1e+308)
		tmp = (x * (-1.0 + -log((1.0 / x)))) + (((((y + 0.0007936500793651) * (z * z)) - (z * 0.0027777777777778)) + 0.083333333333333) / x);
	else
		tmp = ((log(x) * x) - x) + t_2;
	end
	tmp_2 = 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[(t$95$0 + N[(N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * z), $MachinePrecision] - 0.0027777777777778), $MachinePrecision] * z), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(z * N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 50000000000000.0], N[(t$95$0 + t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 1e+308], N[(N[(x * N[(-1.0 + (-N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision] - N[(z * 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[x], $MachinePrecision] * x), $MachinePrecision] - x), $MachinePrecision] + t$95$2), $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 := t_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\
t_2 := \frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\\
\mathbf{if}\;t_1 \leq 50000000000000:\\
\;\;\;\;t_0 + t_2\\

\mathbf{elif}\;t_1 \leq 10^{+308}:\\
\;\;\;\;x \cdot \left(-1 + \left(-\log \left(\frac{1}{x}\right)\right)\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right) - z \cdot 0.0027777777777778\right) + 0.083333333333333}{x}\\

\mathbf{else}:\\
\;\;\;\;\left(\log x \cdot x - x\right) + t_2\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.1
Target1.3
Herbie1.0
\[\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 (-.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)) < 5e13

    1. Initial program 16.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-rr8.6

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

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

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

      [Start]8.9

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

      rational_best-simplify-1 [=>]8.9

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

      rational_best-simplify-3 [<=]8.9

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

      rational_best-simplify-62 [<=]7.6

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

    if 5e13 < (+.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)) < 1e308

    1. Initial program 0.4

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Taylor expanded in x around inf 0.4

      \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot x} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    3. Simplified0.4

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

      [Start]0.4

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

      rational_best-simplify-1 [=>]0.4

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

      rational_best-simplify-18 [=>]0.4

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

      rational_best-simplify-3 [=>]0.4

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

      rational_best-simplify-1 [=>]0.4

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

      rational_best-simplify-10 [=>]0.4

      \[ x \cdot \left(-1 + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Applied egg-rr0.4

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

    if 1e308 < (+.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. Initial program 63.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-rr7.6

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

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

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

      [Start]7.6

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

      rational_best-simplify-1 [=>]7.6

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

      rational_best-simplify-3 [<=]7.6

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

      rational_best-simplify-62 [<=]0.4

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

      \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot x} + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right) \]
    6. Simplified0.4

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

      [Start]0.3

      \[ \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot x + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right) \]

      rational_best-simplify-1 [=>]0.3

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

      rational_best-simplify-73 [=>]0.4

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

      rational_best-simplify-1 [<=]0.4

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

      rational_best-simplify-1 [=>]0.4

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

      rational_best-simplify-10 [=>]0.4

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

      rational_best-simplify-7 [=>]0.4

      \[ \left(x \cdot \left(-\log \left(\frac{1}{x}\right)\right) - \color{blue}{x}\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right) \]
    7. Taylor expanded in x around 0 0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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} \leq 50000000000000:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right)\\ \mathbf{elif}\;\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} \leq 10^{+308}:\\ \;\;\;\;x \cdot \left(-1 + \left(-\log \left(\frac{1}{x}\right)\right)\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot \left(z \cdot z\right) - z \cdot 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\log x \cdot x - x\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error1.0
Cost23688
\[\begin{array}{l} t_0 := \left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\\ t_1 := \frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\\ t_2 := \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ t_3 := t_0 + t_2\\ \mathbf{if}\;t_3 \leq 50000000000000:\\ \;\;\;\;t_0 + t_1\\ \mathbf{elif}\;t_3 \leq 10^{+305}:\\ \;\;\;\;x \cdot \left(-1 + \left(-\log \left(\frac{1}{x}\right)\right)\right) + t_2\\ \mathbf{else}:\\ \;\;\;\;\left(\log x \cdot x - x\right) + t_1\\ \end{array} \]
Alternative 2
Error2.6
Cost8904
\[\begin{array}{l} t_0 := \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z\\ t_1 := \left(\log x \cdot x - x\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right)\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{+115}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_0 \leq 10^{-11}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{0.083333333333333}{x} + -0.0027777777777778 \cdot \frac{z}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error5.0
Cost8144
\[\begin{array}{l} t_0 := -0.5 \cdot \log x + 0.91893853320467\\ \mathbf{if}\;x \leq 1.2:\\ \;\;\;\;t_0 + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 21000000000:\\ \;\;\;\;\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 56000000000:\\ \;\;\;\;t_0 + \frac{\left(0.0007936500793651 \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+130}:\\ \;\;\;\;\left(1 + \left(-\log x\right)\right) \cdot \left(-x\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\log x - 1\right) \cdot x + \frac{0.083333333333333}{x}\\ \end{array} \]
Alternative 4
Error1.0
Cost8136
\[\begin{array}{l} t_0 := \left(\log x \cdot x - x\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right)\\ \mathbf{if}\;z \leq -5 \cdot 10^{+27}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+108}:\\ \;\;\;\;\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error1.9
Cost8008
\[\begin{array}{l} t_0 := \left(\log x \cdot x - x\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right)\\ \mathbf{if}\;z \leq -82000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-28}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(y \cdot \frac{z}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error1.3
Cost8000
\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{0.083333333333333}{x} + \frac{z}{x} \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)\right) \]
Alternative 7
Error9.3
Cost7880
\[\begin{array}{l} t_0 := \left(0.91893853320467 + -0.5 \cdot \log x\right) + \left(\frac{0.083333333333333}{x} + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\right)\\ \mathbf{if}\;z \leq -3.6 \cdot 10^{+24}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+92}:\\ \;\;\;\;\left(1 + \left(-\log x\right)\right) \cdot \left(-x\right) + \frac{\left(z \cdot y - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error9.1
Cost7620
\[\begin{array}{l} \mathbf{if}\;x \leq 0.00048:\\ \;\;\;\;\left(-0.5 \cdot \log x + 0.91893853320467\right) + \frac{\left(0.0007936500793651 \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{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 9
Error11.7
Cost7232
\[\left(\log x \cdot \left(x + -0.5\right) + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x} \]
Alternative 10
Error11.7
Cost7232
\[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
Alternative 11
Error12.6
Cost6976
\[\left(\log x - 1\right) \cdot x + \frac{0.083333333333333}{x} \]
Alternative 12
Error43.2
Cost192
\[\frac{0.083333333333333}{x} \]

Error

Reproduce?

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