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

Percentage Accurate: 93.6% → 99.5%
Time: 20.6s
Alternatives: 17
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 17 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.6% 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.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 500000000000:\\ \;\;\;\;\left(\mathsf{fma}\left(x + -0.5, \log x, -x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 500000000000.0)
   (+
    (+ (fma (+ x -0.5) (log x) (- x)) 0.91893853320467)
    (/
     (fma
      z
      (fma (+ y 0.0007936500793651) z -0.0027777777777778)
      0.083333333333333)
     x))
   (+
    (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
    (* (+ y 0.0007936500793651) (* z (/ z x))))))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 500000000000.0) {
		tmp = (fma((x + -0.5), log(x), -x) + 0.91893853320467) + (fma(z, fma((y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x);
	} else {
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((y + 0.0007936500793651) * (z * (z / x)));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (x <= 500000000000.0)
		tmp = Float64(Float64(fma(Float64(x + -0.5), log(x), Float64(-x)) + 0.91893853320467) + Float64(fma(z, fma(Float64(y + 0.0007936500793651), z, -0.0027777777777778), 0.083333333333333) / x));
	else
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))));
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[x, 500000000000.0], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision] + 0.91893853320467), $MachinePrecision] + N[(N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] * z + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

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

        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(x - 0.5, \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. sub-neg99.7%

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

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

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

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

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

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

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

    if 5e11 < x

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 500000000000:\\ \;\;\;\;\left(\mathsf{fma}\left(x + -0.5, \log x, -x\right) + 0.91893853320467\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]

Alternative 2: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\ \mathbf{if}\;x \leq 0.0017:\\ \;\;\;\;t_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= x 0.0017)
     (+
      t_0
      (/
       (+
        0.083333333333333
        (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
       x))
     (+ t_0 (* (+ y 0.0007936500793651) (* z (/ z x)))))))
double code(double x, double y, double z) {
	double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (x <= 0.0017) {
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	} else {
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    if (x <= 0.0017d0) then
        tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
    else
        tmp = t_0 + ((y + 0.0007936500793651d0) * (z * (z / x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
	double tmp;
	if (x <= 0.0017) {
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	} else {
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if x <= 0.0017:
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)
	else:
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)))
	return tmp
function code(x, y, z)
	t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))
	tmp = 0.0
	if (x <= 0.0017)
		tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x));
	else
		tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	tmp = 0.0;
	if (x <= 0.0017)
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	else
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.0017], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

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

    if 0.00169999999999999991 < 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. Taylor expanded in z around inf 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.5% accurate, 1.0× speedup?

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

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

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


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

    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. Step-by-step derivation
      1. associate-+l-41.4%

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

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

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

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

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

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

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

    if 1e12 < x

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\ \mathbf{if}\;z \leq -2.95 \cdot 10^{+32}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+165}:\\ \;\;\;\;t_1 + z \cdot \left(z \cdot \frac{y}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          (* (+ y 0.0007936500793651) (* z (/ z x)))
          (+ 0.91893853320467 (* -0.5 (log x)))))
        (t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= z -2.95e+32)
     t_0
     (if (<= z 1e-83)
       (+ t_1 (/ 1.0 (* x 12.000000000000048)))
       (if (<= z 7.2e+165) (+ t_1 (* z (* z (/ y x)))) t_0)))))
double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -2.95e+32) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 7.2e+165) {
		tmp = t_1 + (z * (z * (y / x)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((y + 0.0007936500793651d0) * (z * (z / x))) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
    t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    if (z <= (-2.95d+32)) then
        tmp = t_0
    else if (z <= 1d-83) then
        tmp = t_1 + (1.0d0 / (x * 12.000000000000048d0))
    else if (z <= 7.2d+165) then
        tmp = t_1 + (z * (z * (y / x)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * Math.log(x)));
	double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -2.95e+32) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 7.2e+165) {
		tmp = t_1 + (z * (z * (y / x)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * math.log(x)))
	t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if z <= -2.95e+32:
		tmp = t_0
	elif z <= 1e-83:
		tmp = t_1 + (1.0 / (x * 12.000000000000048))
	elif z <= 7.2e+165:
		tmp = t_1 + (z * (z * (y / x)))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))) + Float64(0.91893853320467 + Float64(-0.5 * log(x))))
	t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))
	tmp = 0.0
	if (z <= -2.95e+32)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = Float64(t_1 + Float64(1.0 / Float64(x * 12.000000000000048)));
	elseif (z <= 7.2e+165)
		tmp = Float64(t_1 + Float64(z * Float64(z * Float64(y / x))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	tmp = 0.0;
	if (z <= -2.95e+32)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	elseif (z <= 7.2e+165)
		tmp = t_1 + (z * (z * (y / x)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.95e+32], t$95$0, If[LessEqual[z, 1e-83], N[(t$95$1 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+165], N[(t$95$1 + N[(z * N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+32}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 10^{-83}:\\
\;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+165}:\\
\;\;\;\;t_1 + z \cdot \left(z \cdot \frac{y}{x}\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.94999999999999983e32 or 7.1999999999999996e165 < z

    1. Initial program 88.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. Taylor expanded in z around inf 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.94999999999999983e32 < z < 1e-83

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 1e-83 < z < 7.1999999999999996e165

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.95 \cdot 10^{+32}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+165}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + z \cdot \left(z \cdot \frac{y}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \end{array} \]

Alternative 5: 85.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+120}:\\ \;\;\;\;t_1 + \frac{y}{x} \cdot \left(z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          (* (+ y 0.0007936500793651) (* z (/ z x)))
          (+ 0.91893853320467 (* -0.5 (log x)))))
        (t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= z -3.1e+31)
     t_0
     (if (<= z 1e-83)
       (+ t_1 (/ 1.0 (* x 12.000000000000048)))
       (if (<= z 3.6e+120) (+ t_1 (* (/ y x) (* z z))) t_0)))))
double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -3.1e+31) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 3.6e+120) {
		tmp = t_1 + ((y / x) * (z * z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((y + 0.0007936500793651d0) * (z * (z / x))) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
    t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    if (z <= (-3.1d+31)) then
        tmp = t_0
    else if (z <= 1d-83) then
        tmp = t_1 + (1.0d0 / (x * 12.000000000000048d0))
    else if (z <= 3.6d+120) then
        tmp = t_1 + ((y / x) * (z * z))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * Math.log(x)));
	double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -3.1e+31) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 3.6e+120) {
		tmp = t_1 + ((y / x) * (z * z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * math.log(x)))
	t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if z <= -3.1e+31:
		tmp = t_0
	elif z <= 1e-83:
		tmp = t_1 + (1.0 / (x * 12.000000000000048))
	elif z <= 3.6e+120:
		tmp = t_1 + ((y / x) * (z * z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))) + Float64(0.91893853320467 + Float64(-0.5 * log(x))))
	t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))
	tmp = 0.0
	if (z <= -3.1e+31)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = Float64(t_1 + Float64(1.0 / Float64(x * 12.000000000000048)));
	elseif (z <= 3.6e+120)
		tmp = Float64(t_1 + Float64(Float64(y / x) * Float64(z * z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	tmp = 0.0;
	if (z <= -3.1e+31)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	elseif (z <= 3.6e+120)
		tmp = t_1 + ((y / x) * (z * z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+31], t$95$0, If[LessEqual[z, 1e-83], N[(t$95$1 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+120], N[(t$95$1 + N[(N[(y / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 10^{-83}:\\
\;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+120}:\\
\;\;\;\;t_1 + \frac{y}{x} \cdot \left(z \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.1000000000000002e31 or 3.60000000000000016e120 < z

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.1000000000000002e31 < z < 1e-83

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 1e-83 < z < 3.60000000000000016e120

    1. Initial program 94.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. Taylor expanded in y around inf 70.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+31}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+120}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{x} \cdot \left(z \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \end{array} \]

Alternative 6: 85.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\ \mathbf{if}\;z \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+122}:\\ \;\;\;\;t_1 + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          (* (+ y 0.0007936500793651) (* z (/ z x)))
          (+ 0.91893853320467 (* -0.5 (log x)))))
        (t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= z -1.95e+31)
     t_0
     (if (<= z 1e-83)
       (+ t_1 (/ 1.0 (* x 12.000000000000048)))
       (if (<= z 1.45e+122) (+ t_1 (/ y (/ x (* z z)))) t_0)))))
double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -1.95e+31) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 1.45e+122) {
		tmp = t_1 + (y / (x / (z * z)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((y + 0.0007936500793651d0) * (z * (z / x))) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
    t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    if (z <= (-1.95d+31)) then
        tmp = t_0
    else if (z <= 1d-83) then
        tmp = t_1 + (1.0d0 / (x * 12.000000000000048d0))
    else if (z <= 1.45d+122) then
        tmp = t_1 + (y / (x / (z * z)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * Math.log(x)));
	double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -1.95e+31) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 1.45e+122) {
		tmp = t_1 + (y / (x / (z * z)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * math.log(x)))
	t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if z <= -1.95e+31:
		tmp = t_0
	elif z <= 1e-83:
		tmp = t_1 + (1.0 / (x * 12.000000000000048))
	elif z <= 1.45e+122:
		tmp = t_1 + (y / (x / (z * z)))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))) + Float64(0.91893853320467 + Float64(-0.5 * log(x))))
	t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))
	tmp = 0.0
	if (z <= -1.95e+31)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = Float64(t_1 + Float64(1.0 / Float64(x * 12.000000000000048)));
	elseif (z <= 1.45e+122)
		tmp = Float64(t_1 + Float64(y / Float64(x / Float64(z * z))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	tmp = 0.0;
	if (z <= -1.95e+31)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	elseif (z <= 1.45e+122)
		tmp = t_1 + (y / (x / (z * z)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.95e+31], t$95$0, If[LessEqual[z, 1e-83], N[(t$95$1 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+122], N[(t$95$1 + N[(y / N[(x / N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;z \leq -1.95 \cdot 10^{+31}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 10^{-83}:\\
\;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+122}:\\
\;\;\;\;t_1 + \frac{y}{\frac{x}{z \cdot z}}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.95e31 or 1.45e122 < z

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.95e31 < z < 1e-83

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 1e-83 < z < 1.45e122

    1. Initial program 94.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. Taylor expanded in y around inf 70.0%

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
    3. Step-by-step derivation
      1. associate-/l*77.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+122}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \end{array} \]

Alternative 7: 85.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\ \mathbf{if}\;z \leq -1.62 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+165}:\\ \;\;\;\;t_1 + \frac{y}{\frac{\frac{x}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          (* (+ y 0.0007936500793651) (* z (/ z x)))
          (+ 0.91893853320467 (* -0.5 (log x)))))
        (t_1 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= z -1.62e+31)
     t_0
     (if (<= z 1e-83)
       (+ t_1 (/ 1.0 (* x 12.000000000000048)))
       (if (<= z 7.2e+165) (+ t_1 (/ y (/ (/ x z) z))) t_0)))))
double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	double t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -1.62e+31) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 7.2e+165) {
		tmp = t_1 + (y / ((x / z) / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((y + 0.0007936500793651d0) * (z * (z / x))) + (0.91893853320467d0 + ((-0.5d0) * log(x)))
    t_1 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    if (z <= (-1.62d+31)) then
        tmp = t_0
    else if (z <= 1d-83) then
        tmp = t_1 + (1.0d0 / (x * 12.000000000000048d0))
    else if (z <= 7.2d+165) then
        tmp = t_1 + (y / ((x / z) / z))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * Math.log(x)));
	double t_1 = 0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x);
	double tmp;
	if (z <= -1.62e+31) {
		tmp = t_0;
	} else if (z <= 1e-83) {
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	} else if (z <= 7.2e+165) {
		tmp = t_1 + (y / ((x / z) / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * math.log(x)))
	t_1 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if z <= -1.62e+31:
		tmp = t_0
	elif z <= 1e-83:
		tmp = t_1 + (1.0 / (x * 12.000000000000048))
	elif z <= 7.2e+165:
		tmp = t_1 + (y / ((x / z) / z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))) + Float64(0.91893853320467 + Float64(-0.5 * log(x))))
	t_1 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))
	tmp = 0.0
	if (z <= -1.62e+31)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = Float64(t_1 + Float64(1.0 / Float64(x * 12.000000000000048)));
	elseif (z <= 7.2e+165)
		tmp = Float64(t_1 + Float64(y / Float64(Float64(x / z) / z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y + 0.0007936500793651) * (z * (z / x))) + (0.91893853320467 + (-0.5 * log(x)));
	t_1 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	tmp = 0.0;
	if (z <= -1.62e+31)
		tmp = t_0;
	elseif (z <= 1e-83)
		tmp = t_1 + (1.0 / (x * 12.000000000000048));
	elseif (z <= 7.2e+165)
		tmp = t_1 + (y / ((x / z) / z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.62e+31], t$95$0, If[LessEqual[z, 1e-83], N[(t$95$1 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+165], N[(t$95$1 + N[(y / N[(N[(x / z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\
t_1 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\
\mathbf{if}\;z \leq -1.62 \cdot 10^{+31}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 10^{-83}:\\
\;\;\;\;t_1 + \frac{1}{x \cdot 12.000000000000048}\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+165}:\\
\;\;\;\;t_1 + \frac{y}{\frac{\frac{x}{z}}{z}}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.6199999999999999e31 or 7.1999999999999996e165 < z

    1. Initial program 88.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. Taylor expanded in z around inf 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6199999999999999e31 < z < 1e-83

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    if 1e-83 < z < 7.1999999999999996e165

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{y}{\color{blue}{\frac{\frac{x}{z}}{z}}} \]
    10. Simplified78.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.62 \cdot 10^{+31}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{elif}\;z \leq 10^{-83}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+165}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{\frac{\frac{x}{z}}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \end{array} \]

Alternative 8: 95.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 96.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. Taylor expanded in x around inf 95.9%

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

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

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

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

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

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

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

    if 2.0999999999999999e201 < x

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 98.5% accurate, 1.0× speedup?

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

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

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


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

    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. Taylor expanded in x around inf 99.2%

      \[\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} \]
    3. Step-by-step derivation
      1. sub-neg41.9%

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

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

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

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

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

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

    if 0.00169999999999999991 < 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. Taylor expanded in z around inf 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 84.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+36} \lor \neg \left(z \leq 3.6 \cdot 10^{+25}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5999999999999999e36 or 3.60000000000000015e25 < z

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e36 < z < 3.60000000000000015e25

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 84.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+35} \lor \neg \left(z \leq 2.9 \cdot 10^{+25}\right):\\
\;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8e35 or 2.8999999999999999e25 < z

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e35 < z < 2.8999999999999999e25

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+35} \lor \neg \left(z \leq 2.9 \cdot 10^{+25}\right):\\ \;\;\;\;\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{1}{x \cdot 12.000000000000048}\\ \end{array} \]

Alternative 12: 57.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -3.2e+70)
   (sqrt (/ 0.0069444444444443885 (* x x)))
   (+
    (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -3.2e+70) {
		tmp = sqrt((0.0069444444444443885 / (x * x)));
	} else {
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-3.2d+70)) then
        tmp = sqrt((0.0069444444444443885d0 / (x * x)))
    else
        tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -3.2e+70) {
		tmp = Math.sqrt((0.0069444444444443885 / (x * x)));
	} else {
		tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -3.2e+70:
		tmp = math.sqrt((0.0069444444444443885 / (x * x)))
	else:
		tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -3.2e+70)
		tmp = sqrt(Float64(0.0069444444444443885 / Float64(x * x)));
	else
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -3.2e+70)
		tmp = sqrt((0.0069444444444443885 / (x * x)));
	else
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -3.2e+70], N[Sqrt[N[(0.0069444444444443885 / N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.2000000000000002e70

    1. Initial program 88.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. Taylor expanded in z around 0 8.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt3.8%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      2. sqrt-unprod36.7%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x} \cdot \frac{0.083333333333333}{x}}} \]
      3. frac-times36.7%

        \[\leadsto \sqrt{\color{blue}{\frac{0.083333333333333 \cdot 0.083333333333333}{x \cdot x}}} \]
      4. metadata-eval36.7%

        \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
    8. Applied egg-rr36.7%

      \[\leadsto \color{blue}{\sqrt{\frac{0.0069444444444443885}{x \cdot x}}} \]

    if -3.2000000000000002e70 < z

    1. Initial program 95.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. Taylor expanded in z around 0 62.8%

      \[\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 simplification57.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \]

Alternative 13: 57.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -6.6e+70)
   (sqrt (/ 0.0069444444444443885 (* x x)))
   (+
    (- (* (+ x -0.5) (log x)) (+ x -0.91893853320467))
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -6.6e+70) {
		tmp = sqrt((0.0069444444444443885 / (x * x)));
	} else {
		tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-6.6d+70)) then
        tmp = sqrt((0.0069444444444443885d0 / (x * x)))
    else
        tmp = (((x + (-0.5d0)) * log(x)) - (x + (-0.91893853320467d0))) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -6.6e+70) {
		tmp = Math.sqrt((0.0069444444444443885 / (x * x)));
	} else {
		tmp = (((x + -0.5) * Math.log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -6.6e+70:
		tmp = math.sqrt((0.0069444444444443885 / (x * x)))
	else:
		tmp = (((x + -0.5) * math.log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -6.6e+70)
		tmp = sqrt(Float64(0.0069444444444443885 / Float64(x * x)));
	else
		tmp = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - Float64(x + -0.91893853320467)) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -6.6e+70)
		tmp = sqrt((0.0069444444444443885 / (x * x)));
	else
		tmp = (((x + -0.5) * log(x)) - (x + -0.91893853320467)) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -6.6e+70], N[Sqrt[N[(0.0069444444444443885 / N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[(N[(N[(x + -0.5), $MachinePrecision] * N[Log[x], $MachinePrecision]), $MachinePrecision] - N[(x + -0.91893853320467), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.60000000000000033e70

    1. Initial program 88.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. Taylor expanded in z around 0 8.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt3.8%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      2. sqrt-unprod36.7%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x} \cdot \frac{0.083333333333333}{x}}} \]
      3. frac-times36.7%

        \[\leadsto \sqrt{\color{blue}{\frac{0.083333333333333 \cdot 0.083333333333333}{x \cdot x}}} \]
      4. metadata-eval36.7%

        \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
    8. Applied egg-rr36.7%

      \[\leadsto \color{blue}{\sqrt{\frac{0.0069444444444443885}{x \cdot x}}} \]

    if -6.60000000000000033e70 < z

    1. Initial program 95.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. Taylor expanded in z around 0 62.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.6 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right) + \frac{0.083333333333333}{x}\\ \end{array} \]

Alternative 14: 56.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot 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 (<= z -1.75e+70)
   (sqrt (/ 0.0069444444444443885 (* x x)))
   (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.75e+70) {
		tmp = sqrt((0.0069444444444443885 / (x * 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 (z <= (-1.75d+70)) then
        tmp = sqrt((0.0069444444444443885d0 / (x * 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 (z <= -1.75e+70) {
		tmp = Math.sqrt((0.0069444444444443885 / (x * x)));
	} else {
		tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.75e+70:
		tmp = math.sqrt((0.0069444444444443885 / (x * x)))
	else:
		tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.75e+70)
		tmp = sqrt(Float64(0.0069444444444443885 / Float64(x * 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 (z <= -1.75e+70)
		tmp = sqrt((0.0069444444444443885 / (x * x)));
	else
		tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.75e+70], N[Sqrt[N[(0.0069444444444443885 / N[(x * x), $MachinePrecision]), $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}\;z \leq -1.75 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot 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 z < -1.75000000000000001e70

    1. Initial program 88.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. Taylor expanded in z around 0 8.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt3.8%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      2. sqrt-unprod36.7%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x} \cdot \frac{0.083333333333333}{x}}} \]
      3. frac-times36.7%

        \[\leadsto \sqrt{\color{blue}{\frac{0.083333333333333 \cdot 0.083333333333333}{x \cdot x}}} \]
      4. metadata-eval36.7%

        \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
    8. Applied egg-rr36.7%

      \[\leadsto \color{blue}{\sqrt{\frac{0.0069444444444443885}{x \cdot x}}} \]

    if -1.75000000000000001e70 < z

    1. Initial program 95.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. Taylor expanded in z around 0 62.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+70}:\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \]

Alternative 15: 30.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+32} \lor \neg \left(z \leq 10^{-83}\right):\\
\;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.083333333333333}{x} + 2.91893853320467\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.41999999999999992e32 or 1e-83 < z

    1. Initial program 89.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt5.1%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      2. sqrt-unprod21.4%

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x} \cdot \frac{0.083333333333333}{x}}} \]
      3. frac-times21.4%

        \[\leadsto \sqrt{\color{blue}{\frac{0.083333333333333 \cdot 0.083333333333333}{x \cdot x}}} \]
      4. metadata-eval21.4%

        \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
    8. Applied egg-rr21.4%

      \[\leadsto \color{blue}{\sqrt{\frac{0.0069444444444443885}{x \cdot x}}} \]

    if -1.41999999999999992e32 < z < 1e-83

    1. Initial program 99.5%

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

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

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

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

        \[\leadsto \left(\left(\color{blue}{\log x \cdot \left(x + -0.5\right)} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      4. *-un-lft-identity92.4%

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

        \[\leadsto \left(\color{blue}{\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(-x, 1, x \cdot 1\right)\right)} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      7. sqrt-unprod56.1%

        \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      8. sqr-neg56.1%

        \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\sqrt{\color{blue}{x \cdot x}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      9. sqrt-unprod60.7%

        \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{x} \cdot \sqrt{x}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      10. add-sqr-sqrt60.7%

        \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{x}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    4. Applied egg-rr60.7%

      \[\leadsto \left(\color{blue}{\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right)} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    5. Step-by-step derivation
      1. fma-udef60.7%

        \[\leadsto \left(\left(\color{blue}{\left(\log x \cdot \left(x + -0.5\right) + \left(-x \cdot 1\right)\right)} + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      2. *-rgt-identity60.7%

        \[\leadsto \left(\left(\left(\log x \cdot \left(x + -0.5\right) + \left(-\color{blue}{x}\right)\right) + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      3. sub-neg60.7%

        \[\leadsto \left(\left(\color{blue}{\left(\log x \cdot \left(x + -0.5\right) - x\right)} + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
      4. fma-udef60.7%

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\frac{\left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{3} - {x}^{3}\right) \cdot \left(x - x\right) + \left(\left(\log x \cdot \left(x + -0.5\right)\right) \cdot \left(\log x \cdot \left(x + -0.5\right)\right) + \left(x \cdot x + \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - x \cdot x\right)}{\left(\left(\log x \cdot \left(x + -0.5\right)\right) \cdot \left(\log x \cdot \left(x + -0.5\right)\right) + \left(x \cdot x + \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot \left(x - x\right)}} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    8. Applied egg-rr0.0%

      \[\leadsto \left(\color{blue}{\frac{\left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{3} - {x}^{3}\right) \cdot 0 + \left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{2} + \mathsf{fma}\left(x, x, \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot 0}{\left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{2} + \mathsf{fma}\left(x, x, \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot 0}} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    9. Simplified48.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.42 \cdot 10^{+32} \lor \neg \left(z \leq 10^{-83}\right):\\ \;\;\;\;\sqrt{\frac{0.0069444444444443885}{x \cdot x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x} + 2.91893853320467\\ \end{array} \]

Alternative 16: 23.7% accurate, 24.6× speedup?

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

\\
\frac{0.083333333333333}{x} + 2.91893853320467
\end{array}
Derivation
  1. Initial program 93.8%

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

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

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

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

      \[\leadsto \left(\left(\color{blue}{\log x \cdot \left(x + -0.5\right)} - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    4. *-un-lft-identity52.6%

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

      \[\leadsto \left(\color{blue}{\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(-x, 1, x \cdot 1\right)\right)} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    6. add-sqr-sqrt0.0%

      \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    7. sqrt-unprod29.7%

      \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    8. sqr-neg29.7%

      \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\sqrt{\color{blue}{x \cdot x}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    9. sqrt-unprod32.2%

      \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{\sqrt{x} \cdot \sqrt{x}}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    10. add-sqr-sqrt32.2%

      \[\leadsto \left(\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(\color{blue}{x}, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
  4. Applied egg-rr32.2%

    \[\leadsto \left(\color{blue}{\left(\mathsf{fma}\left(\log x, x + -0.5, -x \cdot 1\right) + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right)} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
  5. Step-by-step derivation
    1. fma-udef32.2%

      \[\leadsto \left(\left(\color{blue}{\left(\log x \cdot \left(x + -0.5\right) + \left(-x \cdot 1\right)\right)} + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    2. *-rgt-identity32.2%

      \[\leadsto \left(\left(\left(\log x \cdot \left(x + -0.5\right) + \left(-\color{blue}{x}\right)\right) + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    3. sub-neg32.2%

      \[\leadsto \left(\left(\color{blue}{\left(\log x \cdot \left(x + -0.5\right) - x\right)} + \mathsf{fma}\left(x, 1, x \cdot 1\right)\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
    4. fma-udef32.2%

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

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{3} - {x}^{3}\right) \cdot \left(x - x\right) + \left(\left(\log x \cdot \left(x + -0.5\right)\right) \cdot \left(\log x \cdot \left(x + -0.5\right)\right) + \left(x \cdot x + \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot \left(x \cdot x - x \cdot x\right)}{\left(\left(\log x \cdot \left(x + -0.5\right)\right) \cdot \left(\log x \cdot \left(x + -0.5\right)\right) + \left(x \cdot x + \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot \left(x - x\right)}} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
  8. Applied egg-rr0.0%

    \[\leadsto \left(\color{blue}{\frac{\left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{3} - {x}^{3}\right) \cdot 0 + \left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{2} + \mathsf{fma}\left(x, x, \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot 0}{\left({\left(\log x \cdot \left(x + -0.5\right)\right)}^{2} + \mathsf{fma}\left(x, x, \left(\log x \cdot \left(x + -0.5\right)\right) \cdot x\right)\right) \cdot 0}} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
  9. Simplified24.5%

    \[\leadsto \left(\color{blue}{2} + 0.91893853320467\right) + \frac{0.083333333333333}{x} \]
  10. Final simplification24.5%

    \[\leadsto \frac{0.083333333333333}{x} + 2.91893853320467 \]

Alternative 17: 23.1% accurate, 41.0× speedup?

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

\\
\frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  7. Final simplification24.0%

    \[\leadsto \frac{0.083333333333333}{x} \]

Developer target: 98.6% 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 2023290 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

  :herbie-target
  (+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))

  (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))