Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B

Percentage Accurate: 94.4% → 98.2%
Time: 17.8s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \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} \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)))
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);
}
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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 94.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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} \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)))
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);
}
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
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);
}
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)
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 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
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]
\begin{array}{l}

\\
\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}
\end{array}

Alternative 1: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + 0.083333333333333 \cdot \frac{1}{x}\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
  (+
   (* z (/ (+ 0.0007936500793651 y) (/ x z)))
   (* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x)));
}
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) + ((z * ((0.0007936500793651d0 + y) / (x / z))) + (0.083333333333333d0 * (1.0d0 / x)))
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x)));
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x)))
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(z * Float64(Float64(0.0007936500793651 + y) / Float64(x / z))) + Float64(0.083333333333333 * Float64(1.0 / x))))
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * ((0.0007936500793651 + y) / (x / z))) + (0.083333333333333 * (1.0 / x)));
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[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + 0.083333333333333 \cdot \frac{1}{x}\right)
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in z around 0 93.2%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)} \]
  4. Taylor expanded in x around 0 92.4%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  5. Step-by-step derivation
    1. associate-/l*97.9%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{z \cdot \frac{z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. fma-neg97.9%

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

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

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

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\frac{z \cdot \left(0.0007936500793651 + y\right)}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  8. Step-by-step derivation
    1. *-commutative97.6%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot z}}{x} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. associate-/l*99.0%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  9. Simplified99.0%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  10. Step-by-step derivation
    1. clear-num99.0%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \color{blue}{\frac{1}{\frac{x}{z}}}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. un-div-inv99.1%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\frac{0.0007936500793651 + y}{\frac{x}{z}}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  11. Applied egg-rr99.1%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\frac{0.0007936500793651 + y}{\frac{x}{z}}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  12. Final simplification99.1%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{0.0007936500793651 + y}{\frac{x}{z}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  13. Add Preprocessing

Alternative 2: 64.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{-43} \lor \neg \left(z \leq 2000000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + 0.083333333333333 \cdot \frac{1}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -8.5e-43) (not (<= z 2000000.0)))
   (* x (+ (+ (log x) -1.0) (/ 0.083333333333333 (* x x))))
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -8.5e-43) || !(z <= 2000000.0)) {
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / 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
    real(8) :: tmp
    if ((z <= (-8.5d-43)) .or. (.not. (z <= 2000000.0d0))) then
        tmp = x * ((log(x) + (-1.0d0)) + (0.083333333333333d0 / (x * x)))
    else
        tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 * (1.0d0 / x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -8.5e-43) || !(z <= 2000000.0)) {
		tmp = x * ((Math.log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -8.5e-43) or not (z <= 2000000.0):
		tmp = x * ((math.log(x) + -1.0) + (0.083333333333333 / (x * x)))
	else:
		tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -8.5e-43) || !(z <= 2000000.0))
		tmp = Float64(x * Float64(Float64(log(x) + -1.0) + Float64(0.083333333333333 / Float64(x * x))));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 * Float64(1.0 / x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -8.5e-43) || ~((z <= 2000000.0)))
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	else
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 * (1.0 / x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -8.5e-43], N[Not[LessEqual[z, 2000000.0]], $MachinePrecision]], N[(x * N[(N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision] + N[(0.083333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-43} \lor \neg \left(z \leq 2000000\right):\\
\;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.50000000000000056e-43 or 2e6 < z

    1. Initial program 87.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. Add Preprocessing
    3. Taylor expanded in z around 0 22.5%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec22.6%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval22.6%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around inf 37.1%

      \[\leadsto \color{blue}{x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{{x}^{2}}\right) - 1\right)} \]
    8. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto x \cdot \left(\color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + -1 \cdot \log \left(\frac{1}{x}\right)\right)} - 1\right) \]
      2. mul-1-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) - 1\right) \]
      3. log-rec37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(-\color{blue}{\left(-\log x\right)}\right)\right) - 1\right) \]
      4. remove-double-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\log x}\right) - 1\right) \]
      5. associate--l+37.1%

        \[\leadsto x \cdot \color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x - 1\right)\right)} \]
      6. sub-neg37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(\log x + \left(-1\right)\right)}\right) \]
      7. metadata-eval37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x + \color{blue}{-1}\right)\right) \]
      8. associate-*r/37.1%

        \[\leadsto x \cdot \left(\color{blue}{\frac{0.083333333333333 \cdot 1}{{x}^{2}}} + \left(\log x + -1\right)\right) \]
      9. metadata-eval37.1%

        \[\leadsto x \cdot \left(\frac{\color{blue}{0.083333333333333}}{{x}^{2}} + \left(\log x + -1\right)\right) \]
      10. +-commutative37.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \color{blue}{\left(-1 + \log x\right)}\right) \]
    9. Simplified37.1%

      \[\leadsto \color{blue}{x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \left(-1 + \log x\right)\right)} \]
    10. Step-by-step derivation
      1. unpow237.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{\color{blue}{x \cdot x}} + \left(-1 + \log x\right)\right) \]
    11. Applied egg-rr37.1%

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

    if -8.50000000000000056e-43 < z < 2e6

    1. Initial program 99.5%

      \[\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. Add Preprocessing
    3. Taylor expanded in z around 0 93.1%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Step-by-step derivation
      1. div-inv46.3%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
      2. *-commutative46.3%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
    5. Applied egg-rr93.2%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{-43} \lor \neg \left(z \leq 2000000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + 0.083333333333333 \cdot \frac{1}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-43} \lor \neg \left(z \leq 1850000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{x \cdot 12.000000000000048}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -9e-43) (not (<= z 1850000.0)))
   (* x (+ (+ (log x) -1.0) (/ 0.083333333333333 (* x x))))
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (/ 1.0 (* x 12.000000000000048)))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -9e-43) || !(z <= 1850000.0)) {
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048));
	}
	return tmp;
}
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 <= (-9d-43)) .or. (.not. (z <= 1850000.0d0))) then
        tmp = x * ((log(x) + (-1.0d0)) + (0.083333333333333d0 / (x * x)))
    else
        tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (1.0d0 / (x * 12.000000000000048d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -9e-43) || !(z <= 1850000.0)) {
		tmp = x * ((Math.log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -9e-43) or not (z <= 1850000.0):
		tmp = x * ((math.log(x) + -1.0) + (0.083333333333333 / (x * x)))
	else:
		tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -9e-43) || !(z <= 1850000.0))
		tmp = Float64(x * Float64(Float64(log(x) + -1.0) + Float64(0.083333333333333 / Float64(x * x))));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(1.0 / Float64(x * 12.000000000000048)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -9e-43) || ~((z <= 1850000.0)))
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	else
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / (x * 12.000000000000048));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -9e-43], N[Not[LessEqual[z, 1850000.0]], $MachinePrecision]], N[(x * N[(N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision] + N[(0.083333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-43} \lor \neg \left(z \leq 1850000\right):\\
\;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{x \cdot 12.000000000000048}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000005e-43 or 1.85e6 < z

    1. Initial program 87.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. Add Preprocessing
    3. Taylor expanded in z around 0 22.5%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec22.6%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval22.6%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around inf 37.1%

      \[\leadsto \color{blue}{x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{{x}^{2}}\right) - 1\right)} \]
    8. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto x \cdot \left(\color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + -1 \cdot \log \left(\frac{1}{x}\right)\right)} - 1\right) \]
      2. mul-1-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) - 1\right) \]
      3. log-rec37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(-\color{blue}{\left(-\log x\right)}\right)\right) - 1\right) \]
      4. remove-double-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\log x}\right) - 1\right) \]
      5. associate--l+37.1%

        \[\leadsto x \cdot \color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x - 1\right)\right)} \]
      6. sub-neg37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(\log x + \left(-1\right)\right)}\right) \]
      7. metadata-eval37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x + \color{blue}{-1}\right)\right) \]
      8. associate-*r/37.1%

        \[\leadsto x \cdot \left(\color{blue}{\frac{0.083333333333333 \cdot 1}{{x}^{2}}} + \left(\log x + -1\right)\right) \]
      9. metadata-eval37.1%

        \[\leadsto x \cdot \left(\frac{\color{blue}{0.083333333333333}}{{x}^{2}} + \left(\log x + -1\right)\right) \]
      10. +-commutative37.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \color{blue}{\left(-1 + \log x\right)}\right) \]
    9. Simplified37.1%

      \[\leadsto \color{blue}{x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \left(-1 + \log x\right)\right)} \]
    10. Step-by-step derivation
      1. unpow237.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{\color{blue}{x \cdot x}} + \left(-1 + \log x\right)\right) \]
    11. Applied egg-rr37.1%

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

    if -9.0000000000000005e-43 < z < 1.85e6

    1. Initial program 99.5%

      \[\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. Add Preprocessing
    3. Taylor expanded in z around 0 93.1%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Step-by-step derivation
      1. div-inv46.3%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
      2. *-commutative46.3%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
    5. Applied egg-rr93.2%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
    6. Step-by-step derivation
      1. associate-/r/93.1%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{1}{\frac{x}{0.083333333333333}}} \]
      2. div-inv93.2%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{\color{blue}{x \cdot \frac{1}{0.083333333333333}}} \]
      3. metadata-eval93.2%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{x \cdot \color{blue}{12.000000000000048}} \]
    7. Applied egg-rr93.2%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{1}{x \cdot 12.000000000000048}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-43} \lor \neg \left(z \leq 1850000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{1}{x \cdot 12.000000000000048}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
  (+
   (* 0.083333333333333 (/ 1.0 x))
   (* z (* (+ 0.0007936500793651 y) (/ z x))))))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x))));
}
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) + ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((0.0007936500793651d0 + y) * (z / x))))
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x))));
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x))))
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))))
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x))));
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[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right)
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in z around 0 93.2%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)} \]
  4. Taylor expanded in x around 0 92.4%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  5. Step-by-step derivation
    1. associate-/l*97.9%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{z \cdot \frac{z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. fma-neg97.9%

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

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

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

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\frac{z \cdot \left(0.0007936500793651 + y\right)}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  8. Step-by-step derivation
    1. *-commutative97.6%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot z}}{x} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. associate-/l*99.0%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  9. Simplified99.0%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  10. Final simplification99.0%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) \]
  11. Add Preprocessing

Alternative 5: 64.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-43} \lor \neg \left(z \leq 1500000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -8e-43) (not (<= z 1500000.0)))
   (* x (+ (+ (log x) -1.0) (/ 0.083333333333333 (* x x))))
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -8e-43) || !(z <= 1500000.0)) {
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / 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
    real(8) :: tmp
    if ((z <= (-8d-43)) .or. (.not. (z <= 1500000.0d0))) then
        tmp = x * ((log(x) + (-1.0d0)) + (0.083333333333333d0 / (x * x)))
    else
        tmp = ((((x - 0.5d0) * log(x)) - x) + 0.91893853320467d0) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -8e-43) || !(z <= 1500000.0)) {
		tmp = x * ((Math.log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((((x - 0.5) * Math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -8e-43) or not (z <= 1500000.0):
		tmp = x * ((math.log(x) + -1.0) + (0.083333333333333 / (x * x)))
	else:
		tmp = ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -8e-43) || !(z <= 1500000.0))
		tmp = Float64(x * Float64(Float64(log(x) + -1.0) + Float64(0.083333333333333 / Float64(x * x))));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) - x) + 0.91893853320467) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -8e-43) || ~((z <= 1500000.0)))
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	else
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -8e-43], N[Not[LessEqual[z, 1500000.0]], $MachinePrecision]], N[(x * N[(N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision] + N[(0.083333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-43} \lor \neg \left(z \leq 1500000\right):\\
\;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.00000000000000062e-43 or 1.5e6 < z

    1. Initial program 87.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. Add Preprocessing
    3. Taylor expanded in z around 0 22.5%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec22.6%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval22.6%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around inf 37.1%

      \[\leadsto \color{blue}{x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{{x}^{2}}\right) - 1\right)} \]
    8. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto x \cdot \left(\color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + -1 \cdot \log \left(\frac{1}{x}\right)\right)} - 1\right) \]
      2. mul-1-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) - 1\right) \]
      3. log-rec37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(-\color{blue}{\left(-\log x\right)}\right)\right) - 1\right) \]
      4. remove-double-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\log x}\right) - 1\right) \]
      5. associate--l+37.1%

        \[\leadsto x \cdot \color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x - 1\right)\right)} \]
      6. sub-neg37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(\log x + \left(-1\right)\right)}\right) \]
      7. metadata-eval37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x + \color{blue}{-1}\right)\right) \]
      8. associate-*r/37.1%

        \[\leadsto x \cdot \left(\color{blue}{\frac{0.083333333333333 \cdot 1}{{x}^{2}}} + \left(\log x + -1\right)\right) \]
      9. metadata-eval37.1%

        \[\leadsto x \cdot \left(\frac{\color{blue}{0.083333333333333}}{{x}^{2}} + \left(\log x + -1\right)\right) \]
      10. +-commutative37.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \color{blue}{\left(-1 + \log x\right)}\right) \]
    9. Simplified37.1%

      \[\leadsto \color{blue}{x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \left(-1 + \log x\right)\right)} \]
    10. Step-by-step derivation
      1. unpow237.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{\color{blue}{x \cdot x}} + \left(-1 + \log x\right)\right) \]
    11. Applied egg-rr37.1%

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

    if -8.00000000000000062e-43 < z < 1.5e6

    1. Initial program 99.5%

      \[\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. Add Preprocessing
    3. Taylor expanded in z around 0 93.1%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{-43} \lor \neg \left(z \leq 1500000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-43} \lor \neg \left(z \leq 1820000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(0.91893853320467 + \log x \cdot \left(x + -0.5\right)\right) - x\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -9e-43) (not (<= z 1820000.0)))
   (* x (+ (+ (log x) -1.0) (/ 0.083333333333333 (* x x))))
   (+
    (- (+ 0.91893853320467 (* (log x) (+ x -0.5))) x)
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -9e-43) || !(z <= 1820000.0)) {
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + (0.083333333333333 / 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
    real(8) :: tmp
    if ((z <= (-9d-43)) .or. (.not. (z <= 1820000.0d0))) then
        tmp = x * ((log(x) + (-1.0d0)) + (0.083333333333333d0 / (x * x)))
    else
        tmp = ((0.91893853320467d0 + (log(x) * (x + (-0.5d0)))) - x) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -9e-43) || !(z <= 1820000.0)) {
		tmp = x * ((Math.log(x) + -1.0) + (0.083333333333333 / (x * x)));
	} else {
		tmp = ((0.91893853320467 + (Math.log(x) * (x + -0.5))) - x) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -9e-43) or not (z <= 1820000.0):
		tmp = x * ((math.log(x) + -1.0) + (0.083333333333333 / (x * x)))
	else:
		tmp = ((0.91893853320467 + (math.log(x) * (x + -0.5))) - x) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -9e-43) || !(z <= 1820000.0))
		tmp = Float64(x * Float64(Float64(log(x) + -1.0) + Float64(0.083333333333333 / Float64(x * x))));
	else
		tmp = Float64(Float64(Float64(0.91893853320467 + Float64(log(x) * Float64(x + -0.5))) - x) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -9e-43) || ~((z <= 1820000.0)))
		tmp = x * ((log(x) + -1.0) + (0.083333333333333 / (x * x)));
	else
		tmp = ((0.91893853320467 + (log(x) * (x + -0.5))) - x) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -9e-43], N[Not[LessEqual[z, 1820000.0]], $MachinePrecision]], N[(x * N[(N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision] + N[(0.083333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-43} \lor \neg \left(z \leq 1820000\right):\\
\;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.0000000000000005e-43 or 1.82e6 < z

    1. Initial program 87.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. Add Preprocessing
    3. Taylor expanded in z around 0 22.5%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec22.6%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg22.6%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval22.6%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative22.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified22.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around inf 37.1%

      \[\leadsto \color{blue}{x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{{x}^{2}}\right) - 1\right)} \]
    8. Step-by-step derivation
      1. +-commutative37.1%

        \[\leadsto x \cdot \left(\color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + -1 \cdot \log \left(\frac{1}{x}\right)\right)} - 1\right) \]
      2. mul-1-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) - 1\right) \]
      3. log-rec37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(-\color{blue}{\left(-\log x\right)}\right)\right) - 1\right) \]
      4. remove-double-neg37.1%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\log x}\right) - 1\right) \]
      5. associate--l+37.1%

        \[\leadsto x \cdot \color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x - 1\right)\right)} \]
      6. sub-neg37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(\log x + \left(-1\right)\right)}\right) \]
      7. metadata-eval37.1%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x + \color{blue}{-1}\right)\right) \]
      8. associate-*r/37.1%

        \[\leadsto x \cdot \left(\color{blue}{\frac{0.083333333333333 \cdot 1}{{x}^{2}}} + \left(\log x + -1\right)\right) \]
      9. metadata-eval37.1%

        \[\leadsto x \cdot \left(\frac{\color{blue}{0.083333333333333}}{{x}^{2}} + \left(\log x + -1\right)\right) \]
      10. +-commutative37.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \color{blue}{\left(-1 + \log x\right)}\right) \]
    9. Simplified37.1%

      \[\leadsto \color{blue}{x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \left(-1 + \log x\right)\right)} \]
    10. Step-by-step derivation
      1. unpow237.1%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{\color{blue}{x \cdot x}} + \left(-1 + \log x\right)\right) \]
    11. Applied egg-rr37.1%

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

    if -9.0000000000000005e-43 < z < 1.82e6

    1. Initial program 99.5%

      \[\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. Add Preprocessing
    3. Taylor expanded in z around 0 93.1%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Step-by-step derivation
      1. sub-neg93.1%

        \[\leadsto \left(\color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(-x\right)\right)} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      2. associate-+l+93.1%

        \[\leadsto \color{blue}{\left(\left(x - 0.5\right) \cdot \log x + \left(\left(-x\right) + 0.91893853320467\right)\right)} + \frac{0.083333333333333}{x} \]
      3. +-commutative93.1%

        \[\leadsto \left(\left(x - 0.5\right) \cdot \log x + \color{blue}{\left(0.91893853320467 + \left(-x\right)\right)}\right) + \frac{0.083333333333333}{x} \]
      4. sub-neg93.1%

        \[\leadsto \left(\left(x - 0.5\right) \cdot \log x + \color{blue}{\left(0.91893853320467 - x\right)}\right) + \frac{0.083333333333333}{x} \]
      5. associate-+r-93.1%

        \[\leadsto \color{blue}{\left(\left(\left(x - 0.5\right) \cdot \log x + 0.91893853320467\right) - x\right)} + \frac{0.083333333333333}{x} \]
      6. sub-neg93.1%

        \[\leadsto \left(\left(\color{blue}{\left(x + \left(-0.5\right)\right)} \cdot \log x + 0.91893853320467\right) - x\right) + \frac{0.083333333333333}{x} \]
      7. metadata-eval93.1%

        \[\leadsto \left(\left(\left(x + \color{blue}{-0.5}\right) \cdot \log x + 0.91893853320467\right) - x\right) + \frac{0.083333333333333}{x} \]
      8. *-commutative93.1%

        \[\leadsto \left(\left(\color{blue}{\log x \cdot \left(x + -0.5\right)} + 0.91893853320467\right) - x\right) + \frac{0.083333333333333}{x} \]
    5. Applied egg-rr93.1%

      \[\leadsto \color{blue}{\left(\left(\log x \cdot \left(x + -0.5\right) + 0.91893853320467\right) - x\right)} + \frac{0.083333333333333}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{-43} \lor \neg \left(z \leq 1820000\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(0.91893853320467 + \log x \cdot \left(x + -0.5\right)\right) - x\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 63.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \log x + -1\\ \mathbf{if}\;z \leq -8.6 \cdot 10^{-43} \lor \neg \left(z \leq 6.6 \cdot 10^{+40}\right):\\ \;\;\;\;x \cdot \left(t\_0 + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot t\_0 + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (log x) -1.0)))
   (if (or (<= z -8.6e-43) (not (<= z 6.6e+40)))
     (* x (+ t_0 (/ 0.083333333333333 (* x x))))
     (+ (* x t_0) (/ 0.083333333333333 x)))))
double code(double x, double y, double z) {
	double t_0 = log(x) + -1.0;
	double tmp;
	if ((z <= -8.6e-43) || !(z <= 6.6e+40)) {
		tmp = x * (t_0 + (0.083333333333333 / (x * x)));
	} else {
		tmp = (x * t_0) + (0.083333333333333 / 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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = log(x) + (-1.0d0)
    if ((z <= (-8.6d-43)) .or. (.not. (z <= 6.6d+40))) then
        tmp = x * (t_0 + (0.083333333333333d0 / (x * x)))
    else
        tmp = (x * t_0) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.log(x) + -1.0;
	double tmp;
	if ((z <= -8.6e-43) || !(z <= 6.6e+40)) {
		tmp = x * (t_0 + (0.083333333333333 / (x * x)));
	} else {
		tmp = (x * t_0) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.log(x) + -1.0
	tmp = 0
	if (z <= -8.6e-43) or not (z <= 6.6e+40):
		tmp = x * (t_0 + (0.083333333333333 / (x * x)))
	else:
		tmp = (x * t_0) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	t_0 = Float64(log(x) + -1.0)
	tmp = 0.0
	if ((z <= -8.6e-43) || !(z <= 6.6e+40))
		tmp = Float64(x * Float64(t_0 + Float64(0.083333333333333 / Float64(x * x))));
	else
		tmp = Float64(Float64(x * t_0) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = log(x) + -1.0;
	tmp = 0.0;
	if ((z <= -8.6e-43) || ~((z <= 6.6e+40)))
		tmp = x * (t_0 + (0.083333333333333 / (x * x)));
	else
		tmp = (x * t_0) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]}, If[Or[LessEqual[z, -8.6e-43], N[Not[LessEqual[z, 6.6e+40]], $MachinePrecision]], N[(x * N[(t$95$0 + N[(0.083333333333333 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \log x + -1\\
\mathbf{if}\;z \leq -8.6 \cdot 10^{-43} \lor \neg \left(z \leq 6.6 \cdot 10^{+40}\right):\\
\;\;\;\;x \cdot \left(t\_0 + \frac{0.083333333333333}{x \cdot x}\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot t\_0 + \frac{0.083333333333333}{x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.59999999999999927e-43 or 6.5999999999999997e40 < z

    1. Initial program 86.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. Add Preprocessing
    3. Taylor expanded in z around 0 19.3%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 19.4%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg19.4%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg19.4%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec19.4%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg19.4%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval19.4%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative19.4%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified19.4%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around inf 34.7%

      \[\leadsto \color{blue}{x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{{x}^{2}}\right) - 1\right)} \]
    8. Step-by-step derivation
      1. +-commutative34.7%

        \[\leadsto x \cdot \left(\color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + -1 \cdot \log \left(\frac{1}{x}\right)\right)} - 1\right) \]
      2. mul-1-neg34.7%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) - 1\right) \]
      3. log-rec34.7%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(-\color{blue}{\left(-\log x\right)}\right)\right) - 1\right) \]
      4. remove-double-neg34.7%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\log x}\right) - 1\right) \]
      5. associate--l+34.7%

        \[\leadsto x \cdot \color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x - 1\right)\right)} \]
      6. sub-neg34.7%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(\log x + \left(-1\right)\right)}\right) \]
      7. metadata-eval34.7%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x + \color{blue}{-1}\right)\right) \]
      8. associate-*r/34.7%

        \[\leadsto x \cdot \left(\color{blue}{\frac{0.083333333333333 \cdot 1}{{x}^{2}}} + \left(\log x + -1\right)\right) \]
      9. metadata-eval34.7%

        \[\leadsto x \cdot \left(\frac{\color{blue}{0.083333333333333}}{{x}^{2}} + \left(\log x + -1\right)\right) \]
      10. +-commutative34.7%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \color{blue}{\left(-1 + \log x\right)}\right) \]
    9. Simplified34.7%

      \[\leadsto \color{blue}{x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \left(-1 + \log x\right)\right)} \]
    10. Step-by-step derivation
      1. unpow234.7%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{\color{blue}{x \cdot x}} + \left(-1 + \log x\right)\right) \]
    11. Applied egg-rr34.7%

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

    if -8.59999999999999927e-43 < z < 6.5999999999999997e40

    1. Initial program 99.5%

      \[\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. Add Preprocessing
    3. Taylor expanded in z around 0 92.7%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 91.5%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg91.5%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg91.5%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec91.5%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg91.5%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval91.5%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative91.5%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified91.5%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{-43} \lor \neg \left(z \leq 6.6 \cdot 10^{+40}\right):\\ \;\;\;\;x \cdot \left(\left(\log x + -1\right) + \frac{0.083333333333333}{x \cdot x}\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 97.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) + x \cdot \left(\log x + -1\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+
   (* 0.083333333333333 (/ 1.0 x))
   (* z (* (+ 0.0007936500793651 y) (/ z x))))
  (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
	return ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (log(x) + -1.0));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = ((0.083333333333333d0 * (1.0d0 / x)) + (z * ((0.0007936500793651d0 + y) * (z / x)))) + (x * (log(x) + (-1.0d0)))
end function
public static double code(double x, double y, double z) {
	return ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (Math.log(x) + -1.0));
}
def code(x, y, z):
	return ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (math.log(x) + -1.0))
function code(x, y, z)
	return Float64(Float64(Float64(0.083333333333333 * Float64(1.0 / x)) + Float64(z * Float64(Float64(0.0007936500793651 + y) * Float64(z / x)))) + Float64(x * Float64(log(x) + -1.0)))
end
function tmp = code(x, y, z)
	tmp = ((0.083333333333333 * (1.0 / x)) + (z * ((0.0007936500793651 + y) * (z / x)))) + (x * (log(x) + -1.0));
end
code[x_, y_, z_] := N[(N[(N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.083333333333333 \cdot \frac{1}{x} + z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)\right) + x \cdot \left(\log x + -1\right)
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in z around 0 93.2%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\left(z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)} \]
  4. Taylor expanded in x around 0 92.4%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{\frac{z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  5. Step-by-step derivation
    1. associate-/l*97.9%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{z \cdot \frac{z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. fma-neg97.9%

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

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

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

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\frac{z \cdot \left(0.0007936500793651 + y\right)}{x}} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  8. Step-by-step derivation
    1. *-commutative97.6%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot z}}{x} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
    2. associate-/l*99.0%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(z \cdot \color{blue}{\left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right)} + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  9. Simplified99.0%

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

    \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \left(z \cdot \left(\left(0.0007936500793651 + y\right) \cdot \frac{z}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \]
  11. Step-by-step derivation
    1. sub-neg52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
    2. mul-1-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    3. log-rec52.4%

      \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    4. remove-double-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    5. metadata-eval52.4%

      \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
    6. +-commutative52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  12. Simplified98.6%

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

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

Alternative 9: 93.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (* x (+ (log x) -1.0))
  (/
   (+
    0.083333333333333
    (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
   x)))
double code(double x, double y, double z) {
	return (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * (log(x) + (-1.0d0))) + ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / x)
end function
public static double code(double x, double y, double z) {
	return (x * (Math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
}
def code(x, y, z):
	return (x * (math.log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x)
function code(x, y, z)
	return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / x))
end
function tmp = code(x, y, z)
	tmp = (x * (log(x) + -1.0)) + ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / x);
end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in x around inf 91.9%

    \[\leadsto \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} \]
  4. Step-by-step derivation
    1. sub-neg52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
    2. mul-1-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    3. log-rec52.4%

      \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    4. remove-double-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    5. metadata-eval52.4%

      \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
    6. +-commutative52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  5. Simplified91.9%

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

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

Alternative 10: 56.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 2.8) (* 0.083333333333333 (/ 1.0 x)) (* x (+ (log x) -1.0))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.8) {
		tmp = 0.083333333333333 * (1.0 / x);
	} else {
		tmp = x * (log(x) + -1.0);
	}
	return tmp;
}
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 (x <= 2.8d0) then
        tmp = 0.083333333333333d0 * (1.0d0 / x)
    else
        tmp = x * (log(x) + (-1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 2.8) {
		tmp = 0.083333333333333 * (1.0 / x);
	} else {
		tmp = x * (Math.log(x) + -1.0);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 2.8:
		tmp = 0.083333333333333 * (1.0 / x)
	else:
		tmp = x * (math.log(x) + -1.0)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 2.8)
		tmp = Float64(0.083333333333333 * Float64(1.0 / x));
	else
		tmp = Float64(x * Float64(log(x) + -1.0));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 2.8)
		tmp = 0.083333333333333 * (1.0 / x);
	else
		tmp = x * (log(x) + -1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 2.8], N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.8:\\
\;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 2.7999999999999998

    1. Initial program 99.7%

      \[\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. Add Preprocessing
    3. Taylor expanded in z around 0 44.6%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 44.2%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg44.2%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg44.2%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec44.2%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg44.2%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval44.2%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative44.2%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified44.2%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around 0 44.2%

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    8. Step-by-step derivation
      1. div-inv44.2%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
      2. *-commutative44.2%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
    9. Applied egg-rr44.2%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]

    if 2.7999999999999998 < x

    1. Initial program 86.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. Add Preprocessing
    3. Taylor expanded in z around 0 60.1%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
    4. Taylor expanded in x around inf 59.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. sub-neg59.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
      2. mul-1-neg59.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      3. log-rec59.6%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      4. remove-double-neg59.6%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
      5. metadata-eval59.6%

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
      6. +-commutative59.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    6. Simplified59.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
    7. Taylor expanded in x around inf 59.6%

      \[\leadsto \color{blue}{x \cdot \left(\left(-1 \cdot \log \left(\frac{1}{x}\right) + 0.083333333333333 \cdot \frac{1}{{x}^{2}}\right) - 1\right)} \]
    8. Step-by-step derivation
      1. +-commutative59.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + -1 \cdot \log \left(\frac{1}{x}\right)\right)} - 1\right) \]
      2. mul-1-neg59.6%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)}\right) - 1\right) \]
      3. log-rec59.6%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(-\color{blue}{\left(-\log x\right)}\right)\right) - 1\right) \]
      4. remove-double-neg59.6%

        \[\leadsto x \cdot \left(\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\log x}\right) - 1\right) \]
      5. associate--l+59.6%

        \[\leadsto x \cdot \color{blue}{\left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x - 1\right)\right)} \]
      6. sub-neg59.6%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \color{blue}{\left(\log x + \left(-1\right)\right)}\right) \]
      7. metadata-eval59.6%

        \[\leadsto x \cdot \left(0.083333333333333 \cdot \frac{1}{{x}^{2}} + \left(\log x + \color{blue}{-1}\right)\right) \]
      8. associate-*r/59.6%

        \[\leadsto x \cdot \left(\color{blue}{\frac{0.083333333333333 \cdot 1}{{x}^{2}}} + \left(\log x + -1\right)\right) \]
      9. metadata-eval59.6%

        \[\leadsto x \cdot \left(\frac{\color{blue}{0.083333333333333}}{{x}^{2}} + \left(\log x + -1\right)\right) \]
      10. +-commutative59.6%

        \[\leadsto x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \color{blue}{\left(-1 + \log x\right)}\right) \]
    9. Simplified59.6%

      \[\leadsto \color{blue}{x \cdot \left(\frac{0.083333333333333}{{x}^{2}} + \left(-1 + \log x\right)\right)} \]
    10. Taylor expanded in x around inf 59.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} \]
    11. Step-by-step derivation
      1. sub-neg59.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} \]
      2. metadata-eval59.6%

        \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) + \color{blue}{-1}\right) \]
      3. mul-1-neg59.6%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + -1\right) \]
      4. log-rec59.6%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + -1\right) \]
      5. remove-double-neg59.6%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + -1\right) \]
      6. *-lft-identity59.6%

        \[\leadsto x \cdot \color{blue}{\left(1 \cdot \left(\log x + -1\right)\right)} \]
      7. *-lft-identity59.6%

        \[\leadsto x \cdot \color{blue}{\left(\log x + -1\right)} \]
      8. +-commutative59.6%

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} \]
    12. Simplified59.6%

      \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.8:\\ \;\;\;\;0.083333333333333 \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 56.2% accurate, 1.1× speedup?

\[\begin{array}{l} \\ x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
	return (x * (log(x) + -1.0)) + (0.083333333333333 / x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
end function
public static double code(double x, double y, double z) {
	return (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
}
def code(x, y, z):
	return (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
function code(x, y, z)
	return Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x))
end
function tmp = code(x, y, z)
	tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
end
code[x_, y_, z_] := N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in z around 0 52.8%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
  4. Taylor expanded in x around inf 52.4%

    \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
  5. Step-by-step derivation
    1. sub-neg52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
    2. mul-1-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    3. log-rec52.4%

      \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    4. remove-double-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    5. metadata-eval52.4%

      \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
    6. +-commutative52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  6. Simplified52.4%

    \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  7. Final simplification52.4%

    \[\leadsto x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x} \]
  8. Add Preprocessing

Alternative 12: 23.3% accurate, 24.6× speedup?

\[\begin{array}{l} \\ 0.083333333333333 \cdot \frac{1}{x} \end{array} \]
(FPCore (x y z) :precision binary64 (* 0.083333333333333 (/ 1.0 x)))
double code(double x, double y, double z) {
	return 0.083333333333333 * (1.0 / x);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 0.083333333333333d0 * (1.0d0 / x)
end function
public static double code(double x, double y, double z) {
	return 0.083333333333333 * (1.0 / x);
}
def code(x, y, z):
	return 0.083333333333333 * (1.0 / x)
function code(x, y, z)
	return Float64(0.083333333333333 * Float64(1.0 / x))
end
function tmp = code(x, y, z)
	tmp = 0.083333333333333 * (1.0 / x);
end
code[x_, y_, z_] := N[(0.083333333333333 * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.083333333333333 \cdot \frac{1}{x}
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in z around 0 52.8%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
  4. Taylor expanded in x around inf 52.4%

    \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
  5. Step-by-step derivation
    1. sub-neg52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
    2. mul-1-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    3. log-rec52.4%

      \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    4. remove-double-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    5. metadata-eval52.4%

      \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
    6. +-commutative52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  6. Simplified52.4%

    \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  7. Taylor expanded in x around 0 22.2%

    \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Step-by-step derivation
    1. div-inv22.2%

      \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
    2. *-commutative22.2%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
  9. Applied egg-rr22.2%

    \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
  10. Final simplification22.2%

    \[\leadsto 0.083333333333333 \cdot \frac{1}{x} \]
  11. Add Preprocessing

Alternative 13: 23.3% accurate, 41.0× speedup?

\[\begin{array}{l} \\ \frac{0.083333333333333}{x} \end{array} \]
(FPCore (x y z) :precision binary64 (/ 0.083333333333333 x))
double code(double x, double y, double z) {
	return 0.083333333333333 / x;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = 0.083333333333333d0 / x
end function
public static double code(double x, double y, double z) {
	return 0.083333333333333 / x;
}
def code(x, y, z):
	return 0.083333333333333 / x
function code(x, y, z)
	return Float64(0.083333333333333 / x)
end
function tmp = code(x, y, z)
	tmp = 0.083333333333333 / x;
end
code[x_, y_, z_] := N[(0.083333333333333 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 92.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. Add Preprocessing
  3. Taylor expanded in z around 0 52.8%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
  4. Taylor expanded in x around inf 52.4%

    \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
  5. Step-by-step derivation
    1. sub-neg52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + \frac{0.083333333333333}{x} \]
    2. mul-1-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    3. log-rec52.4%

      \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    4. remove-double-neg52.4%

      \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + \frac{0.083333333333333}{x} \]
    5. metadata-eval52.4%

      \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) + \frac{0.083333333333333}{x} \]
    6. +-commutative52.4%

      \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  6. Simplified52.4%

    \[\leadsto \color{blue}{x \cdot \left(-1 + \log x\right)} + \frac{0.083333333333333}{x} \]
  7. Taylor expanded in x around 0 22.2%

    \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Final simplification22.2%

    \[\leadsto \frac{0.083333333333333}{x} \]
  9. Add Preprocessing

Developer target: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x))
  (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
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)) + (0.91893853320467d0 - x)) + (0.083333333333333d0 / x)) + ((z / x) * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))
end function
public static double code(double x, double y, double z) {
	return ((((x - 0.5) * Math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))
function code(x, y, z)
	return Float64(Float64(Float64(Float64(Float64(x - 0.5) * log(x)) + Float64(0.91893853320467 - x)) + Float64(0.083333333333333 / x)) + Float64(Float64(z / x) * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)))
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) + (0.91893853320467 - x)) + (0.083333333333333 / x)) + ((z / x) * ((z * (y + 0.0007936500793651)) - 0.0027777777777778));
end
code[x_, y_, z_] := N[(N[(N[(N[(N[(x - 0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\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)
\end{array}

Reproduce

?
herbie shell --seed 2024096 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

  :alt
  (+ (+ (+ (* (- 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)))