?

Average Error: 6.3 → 3.6
Time: 17.5s
Precision: binary64
Cost: 9548

?

\[\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 + z \cdot \left(y + 0.0007936500793651\right)\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+15}:\\ \;\;\;\;t_1 + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{-23}:\\ \;\;\;\;t_1 + \left(0.083333333333333 \cdot \frac{1}{x} + -0.0027777777777778 \cdot \frac{z}{x}\right)\\ \mathbf{elif}\;t_0 \leq 10^{+300}:\\ \;\;\;\;\frac{0.083333333333333 + t_0}{x} + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{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 (* z (+ y 0.0007936500793651)))))
        (t_1 (+ 0.91893853320467 (- (* (log x) (+ x -0.5)) x))))
   (if (<= t_0 -1e+15)
     (+ t_1 (/ y (/ x (* z z))))
     (if (<= t_0 5e-23)
       (+
        t_1
        (+ (* 0.083333333333333 (/ 1.0 x)) (* -0.0027777777777778 (/ z x))))
       (if (<= t_0 1e+300)
         (+ (/ (+ 0.083333333333333 t_0) x) (- (* x (log x)) x))
         (+
          (* x (+ (log x) -1.0))
          (/ (+ 0.083333333333333 (* z -0.0027777777777778)) 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 + (z * (y + 0.0007936500793651)));
	double t_1 = 0.91893853320467 + ((log(x) * (x + -0.5)) - x);
	double tmp;
	if (t_0 <= -1e+15) {
		tmp = t_1 + (y / (x / (z * z)));
	} else if (t_0 <= 5e-23) {
		tmp = t_1 + ((0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x)));
	} else if (t_0 <= 1e+300) {
		tmp = ((0.083333333333333 + t_0) / x) + ((x * log(x)) - x);
	} else {
		tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
	}
	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) :: tmp
    t_0 = z * ((-0.0027777777777778d0) + (z * (y + 0.0007936500793651d0)))
    t_1 = 0.91893853320467d0 + ((log(x) * (x + (-0.5d0))) - x)
    if (t_0 <= (-1d+15)) then
        tmp = t_1 + (y / (x / (z * z)))
    else if (t_0 <= 5d-23) then
        tmp = t_1 + ((0.083333333333333d0 * (1.0d0 / x)) + ((-0.0027777777777778d0) * (z / x)))
    else if (t_0 <= 1d+300) then
        tmp = ((0.083333333333333d0 + t_0) / x) + ((x * log(x)) - x)
    else
        tmp = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x)
    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 = z * (-0.0027777777777778 + (z * (y + 0.0007936500793651)));
	double t_1 = 0.91893853320467 + ((Math.log(x) * (x + -0.5)) - x);
	double tmp;
	if (t_0 <= -1e+15) {
		tmp = t_1 + (y / (x / (z * z)));
	} else if (t_0 <= 5e-23) {
		tmp = t_1 + ((0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x)));
	} else if (t_0 <= 1e+300) {
		tmp = ((0.083333333333333 + t_0) / x) + ((x * Math.log(x)) - x);
	} else {
		tmp = (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
	}
	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 = z * (-0.0027777777777778 + (z * (y + 0.0007936500793651)))
	t_1 = 0.91893853320467 + ((math.log(x) * (x + -0.5)) - x)
	tmp = 0
	if t_0 <= -1e+15:
		tmp = t_1 + (y / (x / (z * z)))
	elif t_0 <= 5e-23:
		tmp = t_1 + ((0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x)))
	elif t_0 <= 1e+300:
		tmp = ((0.083333333333333 + t_0) / x) + ((x * math.log(x)) - x)
	else:
		tmp = (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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(z * Float64(y + 0.0007936500793651))))
	t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x + -0.5)) - x))
	tmp = 0.0
	if (t_0 <= -1e+15)
		tmp = Float64(t_1 + Float64(y / Float64(x / Float64(z * z))));
	elseif (t_0 <= 5e-23)
		tmp = Float64(t_1 + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(-0.0027777777777778 * Float64(z / x))));
	elseif (t_0 <= 1e+300)
		tmp = Float64(Float64(Float64(0.083333333333333 + t_0) / x) + Float64(Float64(x * log(x)) - x));
	else
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x));
	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 = z * (-0.0027777777777778 + (z * (y + 0.0007936500793651)));
	t_1 = 0.91893853320467 + ((log(x) * (x + -0.5)) - x);
	tmp = 0.0;
	if (t_0 <= -1e+15)
		tmp = t_1 + (y / (x / (z * z)));
	elseif (t_0 <= 5e-23)
		tmp = t_1 + ((0.083333333333333 * (1.0 / x)) + (-0.0027777777777778 * (z / x)));
	elseif (t_0 <= 1e+300)
		tmp = ((0.083333333333333 + t_0) / x) + ((x * log(x)) - x);
	else
		tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
	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[(z * N[(-0.0027777777777778 + N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+15], N[(t$95$1 + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e-23], N[(t$95$1 + N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+300], N[(N[(N[(0.083333333333333 + t$95$0), $MachinePrecision] / x), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $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 + z \cdot \left(y + 0.0007936500793651\right)\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \frac{y}{\frac{x}{z \cdot z}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{-23}:\\
\;\;\;\;t_1 + \left(0.083333333333333 \cdot \frac{1}{x} + -0.0027777777777778 \cdot \frac{z}{x}\right)\\

\mathbf{elif}\;t_0 \leq 10^{+300}:\\
\;\;\;\;\frac{0.083333333333333 + t_0}{x} + \left(x \cdot \log x - x\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original6.3
Target1.5
Herbie3.6
\[\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 4 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < -1e15

    1. Initial program 17.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 y around inf 18.3

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

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

      [Start]18.3

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

      associate-/l* [=>]6.6

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

      unpow2 [=>]6.6

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

    if -1e15 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 5.0000000000000002e-23

    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 z around 0 0.8

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

    if 5.0000000000000002e-23 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 1.0000000000000001e300

    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}{\left(x \cdot \log x - x\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} \]

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

      sub-neg [=>]0.4

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

      metadata-eval [=>]0.4

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

      distribute-lft-in [=>]0.4

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

      mul-1-neg [=>]0.4

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

      log-rec [=>]0.4

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

      remove-double-neg [=>]0.4

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

      *-commutative [=>]0.4

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

      *-commutative [<=]0.4

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

      neg-mul-1 [<=]0.4

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

      unsub-neg [=>]0.4

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

      *-commutative [<=]0.4

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

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

    1. Initial program 60.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. Simplified60.1

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

      associate-+l- [=>]60.1

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

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

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

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

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

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

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

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

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

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

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

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

      \[ \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. Taylor expanded in z around 0 32.2

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

      \[\leadsto \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) \cdot x} + \frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x} \]
    5. Simplified32.2

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

      [Start]32.2

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

      *-commutative [=>]32.2

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

      sub-neg [=>]32.2

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

      metadata-eval [=>]32.2

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

      distribute-rgt-in [=>]32.2

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

      mul-1-neg [=>]32.2

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

      log-rec [=>]32.2

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

      remove-double-neg [=>]32.2

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

      distribute-rgt-in [<=]32.2

      \[ \color{blue}{x \cdot \left(\log x + -1\right)} + \frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification3.6

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

Alternatives

Alternative 1
Error3.5
Cost20548
\[\begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{+139}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x} + \left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 2
Error3.8
Cost9548
\[\begin{array}{l} t_0 := z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\\ \mathbf{if}\;t_0 \leq -1 \cdot 10^{+15}:\\ \;\;\;\;t_1 + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{elif}\;t_0 \leq 6 \cdot 10^{-205}:\\ \;\;\;\;t_1 + \left(-0.0027777777777778 \cdot \frac{z}{x} + \frac{0.083333333333333}{x}\right)\\ \mathbf{elif}\;t_0 \leq 10^{+300}:\\ \;\;\;\;\frac{0.083333333333333 + t_0}{x} + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \end{array} \]
Alternative 3
Error3.5
Cost8004
\[\begin{array}{l} \mathbf{if}\;x \leq 2 \cdot 10^{+140}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 4
Error5.4
Cost7888
\[\begin{array}{l} t_0 := \left(x \cdot \log x - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\ t_1 := x \cdot \left(\log x + -1\right)\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_1 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-15}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-5}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+151}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error4.2
Cost7888
\[\begin{array}{l} t_0 := x \cdot \log x - x\\ t_1 := t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\ t_2 := x \cdot \left(\log x + -1\right)\\ \mathbf{if}\;z \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_2 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+16}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 10.5:\\ \;\;\;\;t_0 + \frac{0.083333333333333 + y \cdot \left(z \cdot z\right)}{x}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+151}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 6
Error10.3
Cost7496
\[\begin{array}{l} \mathbf{if}\;x \leq 620000000000:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;x \leq 5 \cdot 10^{+183}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + \left(z \cdot z\right) \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 7
Error12.3
Cost7232
\[\left(0.91893853320467 + \left(\log x \cdot \left(x + -0.5\right) - x\right)\right) + \frac{0.083333333333333}{x} \]
Alternative 8
Error12.9
Cost7108
\[\begin{array}{l} \mathbf{if}\;x \leq 510:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 9
Error13.2
Cost6976
\[\left(x \cdot \log x - x\right) + \frac{0.083333333333333}{x} \]
Alternative 10
Error13.2
Cost6852
\[\begin{array}{l} \mathbf{if}\;x \leq 510:\\ \;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
Alternative 11
Error43.5
Cost6656
\[{\left(x \cdot 12.000000000000048\right)}^{-1} \]
Alternative 12
Error43.5
Cost320
\[0.083333333333333 \cdot \frac{1}{x} \]
Alternative 13
Error43.5
Cost192
\[\frac{0.083333333333333}{x} \]

Error

Reproduce?

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