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

Percentage Accurate: 93.9% → 99.6%
Time: 16.3s
Alternatives: 10
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 10 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: 93.9% 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: 99.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2 \cdot 10^{+15}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}\\

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


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

    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

    if 2e15 < x

    1. Initial program 84.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 99.5%

      \[\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. Step-by-step derivation
      1. fma-define99.5%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\mathsf{fma}\left(z, z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right)} \]
      2. associate-*r/99.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, z \cdot \left(\frac{\color{blue}{0.0007936500793651}}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right) \]
      4. associate-*r/99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{z}^{2} \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
    7. Step-by-step derivation
      1. unpow289.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)\right)} \]
      3. distribute-rgt-in99.5%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) \]
      5. metadata-eval99.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) \]
      7. associate-*r/99.6%

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) \]
      10. distribute-rgt-out99.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.6% accurate, 1.0× speedup?

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

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

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

      \[\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 \color{blue}{\left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)}\right) \]
    2. distribute-rgt-in87.8%

      \[\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(\color{blue}{\left(\left(0.0007936500793651 \cdot \frac{1}{x}\right) \cdot z + \frac{y}{x} \cdot z\right)} + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    3. associate-*r/87.9%

      \[\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(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    4. metadata-eval87.9%

      \[\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(\frac{\color{blue}{0.0007936500793651}}{x} \cdot z + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    5. associate-*l/87.8%

      \[\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(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    6. associate-*r/87.9%

      \[\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(\color{blue}{0.0007936500793651 \cdot \frac{z}{x}} + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    7. associate-*l/91.2%

      \[\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 \cdot \frac{z}{x} + \color{blue}{\frac{y \cdot z}{x}}\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    8. associate-/l*88.8%

      \[\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 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    9. distribute-rgt-out98.2%

      \[\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(\color{blue}{\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)} + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    10. associate-*r/98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \left(-\color{blue}{\frac{0.0027777777777778 \cdot 1}{x}}\right)\right)\right) \]
    11. metadata-eval98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \left(-\frac{\color{blue}{0.0027777777777778}}{x}\right)\right)\right) \]
    12. distribute-neg-frac98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \color{blue}{\frac{-0.0027777777777778}{x}}\right)\right) \]
    13. metadata-eval98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{\color{blue}{-0.0027777777777778}}{x}\right)\right) \]
  6. Simplified98.2%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(0.083333333333333 \cdot \frac{1}{x} + \color{blue}{z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right)}\right) \]
  7. Step-by-step derivation
    1. div-inv98.2%

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

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

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\color{blue}{\frac{1}{\frac{x}{0.083333333333333}}} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right)\right) \]
  9. Step-by-step derivation
    1. div-inv98.2%

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{1}{x \cdot \color{blue}{12.000000000000048}} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right)\right) \]
  10. Applied egg-rr98.2%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(\frac{1}{\color{blue}{x \cdot 12.000000000000048}} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right)\right) \]
  11. Final simplification98.2%

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

Alternative 3: 98.5% 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 \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+
  (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
  (+
   (* z (+ (* (/ z x) (+ 0.0007936500793651 y)) (/ -0.0027777777777778 x)))
   (* 0.083333333333333 (/ 1.0 x)))))
double code(double x, double y, double z) {
	return ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (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 * (((z / x) * (0.0007936500793651d0 + y)) + ((-0.0027777777777778d0) / x))) + (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 * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (0.083333333333333 * (1.0 / x)));
}
def code(x, y, z):
	return ((((x - 0.5) * math.log(x)) - x) + 0.91893853320467) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (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(Float64(z / x) * Float64(0.0007936500793651 + y)) + Float64(-0.0027777777777778 / x))) + Float64(0.083333333333333 * Float64(1.0 / x))))
end
function tmp = code(x, y, z)
	tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((z * (((z / x) * (0.0007936500793651 + y)) + (-0.0027777777777778 / x))) + (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[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 / x), $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 \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{-0.0027777777777778}{x}\right) + 0.083333333333333 \cdot \frac{1}{x}\right)
\end{array}
Derivation
  1. Initial program 93.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 y around 0 77.4%

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

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

      \[\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 \color{blue}{\left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)}\right) \]
    2. distribute-rgt-in87.8%

      \[\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(\color{blue}{\left(\left(0.0007936500793651 \cdot \frac{1}{x}\right) \cdot z + \frac{y}{x} \cdot z\right)} + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    3. associate-*r/87.9%

      \[\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(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    4. metadata-eval87.9%

      \[\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(\frac{\color{blue}{0.0007936500793651}}{x} \cdot z + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    5. associate-*l/87.8%

      \[\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(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    6. associate-*r/87.9%

      \[\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(\color{blue}{0.0007936500793651 \cdot \frac{z}{x}} + \frac{y}{x} \cdot z\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    7. associate-*l/91.2%

      \[\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 \cdot \frac{z}{x} + \color{blue}{\frac{y \cdot z}{x}}\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    8. associate-/l*88.8%

      \[\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 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    9. distribute-rgt-out98.2%

      \[\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(\color{blue}{\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)} + \left(-0.0027777777777778 \cdot \frac{1}{x}\right)\right)\right) \]
    10. associate-*r/98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \left(-\color{blue}{\frac{0.0027777777777778 \cdot 1}{x}}\right)\right)\right) \]
    11. metadata-eval98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \left(-\frac{\color{blue}{0.0027777777777778}}{x}\right)\right)\right) \]
    12. distribute-neg-frac98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \color{blue}{\frac{-0.0027777777777778}{x}}\right)\right) \]
    13. metadata-eval98.2%

      \[\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(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right) + \frac{\color{blue}{-0.0027777777777778}}{x}\right)\right) \]
  6. Simplified98.2%

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

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

Alternative 4: 95.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.00055 \lor \neg \left(z \leq 4.2 \cdot 10^{-34}\right):\\ \;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\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 -0.00055) (not (<= z 4.2e-34)))
   (+ (* x (+ (log x) -1.0)) (* z (* (/ z x) (+ 0.0007936500793651 y))))
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -0.00055) || !(z <= 4.2e-34)) {
		tmp = (x * (log(x) + -1.0)) + (z * ((z / x) * (0.0007936500793651 + y)));
	} 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 <= (-0.00055d0)) .or. (.not. (z <= 4.2d-34))) then
        tmp = (x * (log(x) + (-1.0d0))) + (z * ((z / x) * (0.0007936500793651d0 + y)))
    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 <= -0.00055) || !(z <= 4.2e-34)) {
		tmp = (x * (Math.log(x) + -1.0)) + (z * ((z / x) * (0.0007936500793651 + y)));
	} 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 <= -0.00055) or not (z <= 4.2e-34):
		tmp = (x * (math.log(x) + -1.0)) + (z * ((z / x) * (0.0007936500793651 + y)))
	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 <= -0.00055) || !(z <= 4.2e-34))
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(z * Float64(Float64(z / x) * Float64(0.0007936500793651 + y))));
	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 <= -0.00055) || ~((z <= 4.2e-34)))
		tmp = (x * (log(x) + -1.0)) + (z * ((z / x) * (0.0007936500793651 + y)));
	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, -0.00055], N[Not[LessEqual[z, 4.2e-34]], $MachinePrecision]], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(z * N[(N[(z / x), $MachinePrecision] * N[(0.0007936500793651 + y), $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 -0.00055 \lor \neg \left(z \leq 4.2 \cdot 10^{-34}\right):\\
\;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\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 < -5.50000000000000033e-4 or 4.2000000000000002e-34 < z

    1. Initial program 87.9%

      \[\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 99.1%

      \[\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. Step-by-step derivation
      1. fma-define99.1%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\mathsf{fma}\left(z, z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right)} \]
      2. associate-*r/99.2%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, z \cdot \left(\frac{\color{blue}{0.0007936500793651}}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right) \]
      4. associate-*r/99.2%

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{z}^{2} \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
    7. Step-by-step derivation
      1. unpow290.8%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)\right)} \]
      3. distribute-rgt-in87.2%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) \]
      5. metadata-eval87.2%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) \]
      7. associate-*r/87.3%

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) \]
      10. distribute-rgt-out98.7%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \color{blue}{\left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right)} \]
    8. Simplified98.7%

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

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

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      2. mul-1-neg98.7%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      3. log-rec98.7%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      4. remove-double-neg98.7%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      5. metadata-eval98.7%

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

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
    11. Simplified98.7%

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

    if -5.50000000000000033e-4 < z < 4.2000000000000002e-34

    1. Initial program 99.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 94.6%

      \[\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 simplification96.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.00055 \lor \neg \left(z \leq 4.2 \cdot 10^{-34}\right):\\ \;\;\;\;x \cdot \left(\log x + -1\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\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 5: 98.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;x \leq 50000000000000:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_0 + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right)\\


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

    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 x around inf 97.8%

      \[\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-neg57.1%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      2. mul-1-neg57.1%

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

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

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      5. metadata-eval57.1%

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

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
    5. Simplified97.8%

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

    if 5e13 < x

    1. Initial program 84.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 99.5%

      \[\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. Step-by-step derivation
      1. fma-define99.5%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\mathsf{fma}\left(z, z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right)} \]
      2. associate-*r/99.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, z \cdot \left(\frac{\color{blue}{0.0007936500793651}}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right) \]
      4. associate-*r/99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{z}^{2} \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
    7. Step-by-step derivation
      1. unpow289.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)\right)} \]
      3. distribute-rgt-in99.5%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) \]
      5. metadata-eval99.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) \]
      7. associate-*r/99.6%

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) \]
      10. distribute-rgt-out99.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\

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


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

    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 x around 0 99.1%

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

    if 1 < x

    1. Initial program 85.6%

      \[\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 99.6%

      \[\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. Step-by-step derivation
      1. fma-define99.6%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\mathsf{fma}\left(z, z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right)} \]
      2. associate-*r/99.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, z \cdot \left(\frac{\color{blue}{0.0007936500793651}}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right) \]
      4. associate-*r/99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{z}^{2} \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
    7. Step-by-step derivation
      1. unpow290.0%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)\right)} \]
      3. distribute-rgt-in99.3%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) \]
      5. metadata-eval99.3%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) \]
      7. associate-*r/99.3%

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) \]
      10. distribute-rgt-out99.2%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      2. mul-1-neg98.8%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      3. log-rec98.8%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      4. remove-double-neg98.8%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      5. metadata-eval98.8%

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

        \[\leadsto x \cdot \color{blue}{\left(-1 + \log x\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
    11. Simplified98.8%

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

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

Alternative 7: 99.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.21:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\

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


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

    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 x around 0 99.1%

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

    if 0.209999999999999992 < x

    1. Initial program 85.6%

      \[\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 99.6%

      \[\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. Step-by-step derivation
      1. fma-define99.6%

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\mathsf{fma}\left(z, z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right)} \]
      2. associate-*r/99.6%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \mathsf{fma}\left(z, z \cdot \left(\frac{\color{blue}{0.0007936500793651}}{x} + \frac{y}{x}\right) - 0.0027777777777778 \cdot \frac{1}{x}, 0.083333333333333 \cdot \frac{1}{x}\right) \]
      4. associate-*r/99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{{z}^{2} \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
    7. Step-by-step derivation
      1. unpow290.0%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{z \cdot \left(z \cdot \left(0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}\right)\right)} \]
      3. distribute-rgt-in99.3%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot 1}{x}} \cdot z + \frac{y}{x} \cdot z\right) \]
      5. metadata-eval99.3%

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\color{blue}{\frac{0.0007936500793651 \cdot z}{x}} + \frac{y}{x} \cdot z\right) \]
      7. associate-*r/99.3%

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(0.0007936500793651 \cdot \frac{z}{x} + \color{blue}{y \cdot \frac{z}{x}}\right) \]
      10. distribute-rgt-out99.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.21:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x} + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 62.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 3400:\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\

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


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

    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 x around 0 99.1%

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

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

        \[\leadsto \left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{\color{blue}{z \cdot -0.0027777777777778} + 0.083333333333333}{x} \]
    6. Simplified59.2%

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

    if 3400 < x

    1. Initial program 85.3%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 68.4%

      \[\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 67.7%

      \[\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-neg98.8%

        \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(-1\right)\right)} + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      2. mul-1-neg98.8%

        \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      3. log-rec98.8%

        \[\leadsto x \cdot \left(\left(-\color{blue}{\left(-\log x\right)}\right) + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      4. remove-double-neg98.8%

        \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
      5. metadata-eval98.8%

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

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

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

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

Alternative 9: 62.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 6 \cdot 10^{-21}:\\ \;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \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 (<= x 6e-21)
   (+
    (+ 0.91893853320467 (* (log x) -0.5))
    (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x))
   (+
    (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 6e-21) {
		tmp = (0.91893853320467 + (log(x) * -0.5)) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 (x <= 6d-21) then
        tmp = (0.91893853320467d0 + (log(x) * (-0.5d0))) + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / 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 (x <= 6e-21) {
		tmp = (0.91893853320467 + (Math.log(x) * -0.5)) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 x <= 6e-21:
		tmp = (0.91893853320467 + (math.log(x) * -0.5)) + ((0.083333333333333 + (z * -0.0027777777777778)) / 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 (x <= 6e-21)
		tmp = Float64(Float64(0.91893853320467 + Float64(log(x) * -0.5)) + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / 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 (x <= 6e-21)
		tmp = (0.91893853320467 + (log(x) * -0.5)) + ((0.083333333333333 + (z * -0.0027777777777778)) / x);
	else
		tmp = ((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 6e-21], N[(N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $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}\;x \leq 6 \cdot 10^{-21}:\\
\;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\

\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 x < 5.99999999999999982e-21

    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 x around 0 99.7%

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

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

        \[\leadsto \left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{\color{blue}{z \cdot -0.0027777777777778} + 0.083333333333333}{x} \]
    6. Simplified63.2%

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

    if 5.99999999999999982e-21 < x

    1. Initial program 86.9%

      \[\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 64.4%

      \[\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 simplification63.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 6 \cdot 10^{-21}:\\ \;\;\;\;\left(0.91893853320467 + \log x \cdot -0.5\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\\ \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 10: 56.0% 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 93.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 55.9%

    \[\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 54.8%

    \[\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-neg75.5%

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

      \[\leadsto x \cdot \left(\color{blue}{\left(-\log \left(\frac{1}{x}\right)\right)} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
    3. log-rec75.5%

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

      \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(-1\right)\right) + z \cdot \left(\frac{z}{x} \cdot \left(0.0007936500793651 + y\right)\right) \]
    5. metadata-eval75.5%

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

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

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

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

Developer target: 98.5% 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 2024077 
(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)))