?

Average Error: 9.37% → 0.62%
Time: 27.5s
Precision: binary64
Cost: 8265

?

\[\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} \mathbf{if}\;z \leq -12.6 \lor \neg \left(z \leq 5 \cdot 10^{-30}\right):\\ \;\;\;\;\left(\frac{0.083333333333333}{x} + \left(\frac{z \cdot -0.0027777777777778}{x} + z \cdot \left(\frac{z}{x} \cdot \left(y + 0.0007936500793651\right)\right)\right)\right) + \left(x \cdot \log x - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{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
 (if (or (<= z -12.6) (not (<= z 5e-30)))
   (+
    (+
     (/ 0.083333333333333 x)
     (+
      (/ (* z -0.0027777777777778) x)
      (* z (* (/ z x) (+ y 0.0007936500793651)))))
    (- (* x (log x)) x))
   (+
    (+ (* (+ x -0.5) (log x)) (- 0.91893853320467 x))
    (/
     (+
      0.083333333333333
      (* z (+ -0.0027777777777778 (* z (+ y 0.0007936500793651)))))
     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 tmp;
	if ((z <= -12.6) || !(z <= 5e-30)) {
		tmp = ((0.083333333333333 / x) + (((z * -0.0027777777777778) / x) + (z * ((z / x) * (y + 0.0007936500793651))))) + ((x * log(x)) - x);
	} else {
		tmp = (((x + -0.5) * log(x)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * (-0.0027777777777778 + (z * (y + 0.0007936500793651))))) / 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) :: tmp
    if ((z <= (-12.6d0)) .or. (.not. (z <= 5d-30))) then
        tmp = ((0.083333333333333d0 / x) + (((z * (-0.0027777777777778d0)) / x) + (z * ((z / x) * (y + 0.0007936500793651d0))))) + ((x * log(x)) - x)
    else
        tmp = (((x + (-0.5d0)) * log(x)) + (0.91893853320467d0 - x)) + ((0.083333333333333d0 + (z * ((-0.0027777777777778d0) + (z * (y + 0.0007936500793651d0))))) / 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 tmp;
	if ((z <= -12.6) || !(z <= 5e-30)) {
		tmp = ((0.083333333333333 / x) + (((z * -0.0027777777777778) / x) + (z * ((z / x) * (y + 0.0007936500793651))))) + ((x * Math.log(x)) - x);
	} else {
		tmp = (((x + -0.5) * Math.log(x)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * (-0.0027777777777778 + (z * (y + 0.0007936500793651))))) / 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):
	tmp = 0
	if (z <= -12.6) or not (z <= 5e-30):
		tmp = ((0.083333333333333 / x) + (((z * -0.0027777777777778) / x) + (z * ((z / x) * (y + 0.0007936500793651))))) + ((x * math.log(x)) - x)
	else:
		tmp = (((x + -0.5) * math.log(x)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * (-0.0027777777777778 + (z * (y + 0.0007936500793651))))) / 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)
	tmp = 0.0
	if ((z <= -12.6) || !(z <= 5e-30))
		tmp = Float64(Float64(Float64(0.083333333333333 / x) + Float64(Float64(Float64(z * -0.0027777777777778) / x) + Float64(z * Float64(Float64(z / x) * Float64(y + 0.0007936500793651))))) + Float64(Float64(x * log(x)) - x));
	else
		tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(-0.0027777777777778 + Float64(z * Float64(y + 0.0007936500793651))))) / 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)
	tmp = 0.0;
	if ((z <= -12.6) || ~((z <= 5e-30)))
		tmp = ((0.083333333333333 / x) + (((z * -0.0027777777777778) / x) + (z * ((z / x) * (y + 0.0007936500793651))))) + ((x * log(x)) - x);
	else
		tmp = (((x + -0.5) * log(x)) + (0.91893853320467 - x)) + ((0.083333333333333 + (z * (-0.0027777777777778 + (z * (y + 0.0007936500793651))))) / 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_] := If[Or[LessEqual[z, -12.6], N[Not[LessEqual[z, 5e-30]], $MachinePrecision]], N[(N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(N[(N[(z * -0.0027777777777778), $MachinePrecision] / x), $MachinePrecision] + N[(z * N[(N[(z / x), $MachinePrecision] * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(-0.0027777777777778 + N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;z \leq -12.6 \lor \neg \left(z \leq 5 \cdot 10^{-30}\right):\\
\;\;\;\;\left(\frac{0.083333333333333}{x} + \left(\frac{z \cdot -0.0027777777777778}{x} + z \cdot \left(\frac{z}{x} \cdot \left(y + 0.0007936500793651\right)\right)\right)\right) + \left(x \cdot \log x - x\right)\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.37%
Target1.82%
Herbie0.62%
\[\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 z < -12.5999999999999996 or 4.99999999999999972e-30 < z

    1. Initial program 27.96

      \[\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-rr27.96

      \[\leadsto \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} \]
    3. Taylor expanded in z around inf 28.19

      \[\leadsto \left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \color{blue}{\left(0.083333333333333 \cdot \frac{1}{x} + \left(\frac{{z}^{2} \cdot \left(0.0007936500793651 + y\right)}{x} + -0.0027777777777778 \cdot \frac{z}{x}\right)\right)} \]
    4. Simplified19.19

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

      [Start]28.19

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

      associate-*r/ [=>]28.19

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

      metadata-eval [=>]28.19

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

      +-commutative [=>]28.19

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

      associate-*r/ [=>]28.19

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

      associate-/l* [=>]19.19

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

      unpow2 [=>]19.19

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

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

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

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

      [Start]0.73

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

      *-commutative [=>]0.73

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

      sub-neg [=>]0.73

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

      metadata-eval [=>]0.73

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

      distribute-rgt-in [=>]0.79

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

      mul-1-neg [=>]0.79

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

      log-rec [=>]0.79

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

      remove-double-neg [=>]0.79

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

      mul-1-neg [=>]0.79

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

      sub-neg [<=]0.79

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

      *-commutative [=>]0.79

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

    if -12.5999999999999996 < z < 4.99999999999999972e-30

    1. Initial program 0.54

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

      \[\leadsto \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} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.62

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

Alternatives

Alternative 1
Error0.72%
Cost14656
\[\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \left(\left(z \cdot \frac{z}{x}\right) \cdot y + \left(\frac{0.083333333333333}{x} + \frac{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}{\frac{x}{z}}\right)\right) \]
Alternative 2
Error1.41%
Cost9160
\[\begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := 0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+107}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+72}:\\ \;\;\;\;t_2 + \frac{0.083333333333333 + t_1}{x}\\ \mathbf{else}:\\ \;\;\;\;t_2 + z \cdot \frac{t_0}{x}\\ \end{array} \]
Alternative 3
Error1.41%
Cost9160
\[\begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ t_1 := z \cdot \left(-0.0027777777777778 + t_0\right)\\ t_2 := \left(x + -0.5\right) \cdot \log x\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+107}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+72}:\\ \;\;\;\;\left(t_2 + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333 + t_1}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(t_2 - x\right)\right) + z \cdot \frac{t_0}{x}\\ \end{array} \]
Alternative 4
Error2.18%
Cost8256
\[\left(\left(x + -0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \left(\frac{0.083333333333333}{x} + \left(\frac{z \cdot -0.0027777777777778}{x} + z \cdot \left(\frac{z}{x} \cdot \left(y + 0.0007936500793651\right)\right)\right)\right) \]
Alternative 5
Error2.68%
Cost7880
\[\begin{array}{l} t_0 := z \cdot \left(y + 0.0007936500793651\right)\\ \mathbf{if}\;x \leq 0.195:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + t_0\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{elif}\;x \leq 2 \cdot 10^{+149}:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + z \cdot \frac{t_0}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 6
Error5.94%
Cost7748
\[\begin{array}{l} \mathbf{if}\;x \leq 0.45:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 7
Error6.34%
Cost7620
\[\begin{array}{l} \mathbf{if}\;x \leq 6:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 8
Error6.69%
Cost7496
\[\begin{array}{l} \mathbf{if}\;x \leq 9 \cdot 10^{-21}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 - x\right)\\ \mathbf{elif}\;x \leq 3500000000000:\\ \;\;\;\;\left(0.91893853320467 + \left(\left(x + -0.5\right) \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 9
Error6.66%
Cost7496
\[\begin{array}{l} \mathbf{if}\;x \leq 9 \cdot 10^{-21}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 - x\right)\\ \mathbf{elif}\;x \leq 270000000000:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(\left(x + -0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \log x - x\right) + y \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]
Alternative 10
Error10.96%
Cost7364
\[\begin{array}{l} \mathbf{if}\;x \leq 9 \cdot 10^{-21}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 - x\right)\\ \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
Error11.18%
Cost7236
\[\begin{array}{l} \mathbf{if}\;x \leq 28000:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right)\\ \end{array} \]
Alternative 12
Error51.42%
Cost2632
\[\begin{array}{l} t_0 := 0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)\\ \mathbf{if}\;t_0 \leq 0.083333332:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(\frac{0.083333333333333}{x} + \left(\frac{z \cdot -0.0027777777777778}{x} + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\right)\right)\\ \mathbf{elif}\;t_0 \leq 0.2:\\ \;\;\;\;\frac{z}{x} \cdot -0.0027777777777778 + \left(0.91893853320467 + \left(x + \frac{0.083333333333333}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{x} + \left(0.91893853320467 - x\right)\\ \end{array} \]
Alternative 13
Error52.81%
Cost1228
\[\begin{array}{l} t_0 := \left(0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\ \mathbf{if}\;z \leq -3 \cdot 10^{-6}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-118}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot y\right)}{x}\\ \mathbf{elif}\;z \leq 8.5:\\ \;\;\;\;\frac{z}{x} \cdot -0.0027777777777778 + \left(0.91893853320467 + \left(x + \frac{0.083333333333333}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 14
Error50.56%
Cost1220
\[\begin{array}{l} \mathbf{if}\;x \leq 4.2 \cdot 10^{+120}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(-0.0027777777777778 + z \cdot \left(y + 0.0007936500793651\right)\right)}{x} + \left(0.91893853320467 - x\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(x + 0.91893853320467\right)\\ \end{array} \]
Alternative 15
Error55.19%
Cost1097
\[\begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{-71} \lor \neg \left(z \leq 9\right):\\ \;\;\;\;\left(0.91893853320467 - x\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{x} \cdot -0.0027777777777778 + \left(0.91893853320467 + \left(x + \frac{0.083333333333333}{x}\right)\right)\\ \end{array} \]
Alternative 16
Error60.2%
Cost1096
\[\begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+15}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{elif}\;z \leq 0.42:\\ \;\;\;\;\frac{z}{x} \cdot -0.0027777777777778 + \left(0.91893853320467 + \left(x + \frac{0.083333333333333}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{z \cdot z}{\frac{x}{y}}\\ \end{array} \]
Alternative 17
Error60.36%
Cost969
\[\begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+15} \lor \neg \left(z \leq 14.5\right):\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(x + 0.91893853320467\right)\\ \end{array} \]
Alternative 18
Error60.36%
Cost968
\[\begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+15}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{elif}\;z \leq 0.036:\\ \;\;\;\;\frac{0.083333333333333}{x} + \left(x + 0.91893853320467\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 - x\right) + \frac{z \cdot z}{\frac{x}{y}}\\ \end{array} \]
Alternative 19
Error66.88%
Cost448
\[0.91893853320467 + 0.083333333333333 \cdot \frac{1}{x} \]
Alternative 20
Error62.16%
Cost448
\[\frac{0.083333333333333}{x} + \left(x + 0.91893853320467\right) \]
Alternative 21
Error66.84%
Cost320
\[0.91893853320467 + \frac{0.083333333333333}{x} \]
Alternative 22
Error97.47%
Cost192
\[0.91893853320467 - x \]
Alternative 23
Error67.68%
Cost192
\[\frac{0.083333333333333}{x} \]
Alternative 24
Error98.83%
Cost128
\[-x \]

Error

Reproduce?

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