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

Percentage Accurate: 94.4% → 99.3%
Time: 15.3s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 94.4% accurate, 1.0× speedup?

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

\\
\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}
\end{array}

Alternative 1: 99.3% accurate, 0.3× speedup?

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

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

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


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

    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. remove-double-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\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}{\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]

    if 8.4999999999999998e64 < x

    1. Initial program 87.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 87.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*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. Step-by-step derivation
      1. associate-/r/90.5%

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := \left(x + -0.5\right) \cdot \log x - x\\
\mathbf{if}\;x \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\frac{0.8444480278083504 - {t_0}^{2}}{0.91893853320467 - t_0} + \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 \frac{z}{\frac{x}{z}}\\


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

    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. +-commutative99.7%

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

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

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

        \[\leadsto \frac{0.8444480278083504 - \color{blue}{{\left(\left(x - 0.5\right) \cdot \log x - x\right)}^{2}}}{0.91893853320467 - \left(\left(x - 0.5\right) \cdot \log x - x\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      5. sub-neg99.7%

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

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

        \[\leadsto \frac{0.8444480278083504 - {\left(\color{blue}{\log x \cdot \left(x + -0.5\right)} - x\right)}^{2}}{0.91893853320467 - \left(\left(x - 0.5\right) \cdot \log x - x\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      8. sub-neg99.7%

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

        \[\leadsto \frac{0.8444480278083504 - {\left(\log x \cdot \left(x + -0.5\right) - x\right)}^{2}}{0.91893853320467 - \left(\left(x + \color{blue}{-0.5}\right) \cdot \log x - x\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      10. *-commutative99.7%

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

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

    if 2e17 < x

    1. Initial program 89.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 89.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*91.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. unpow291.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. Simplified91.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. Step-by-step derivation
      1. associate-/r/92.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2 \cdot 10^{+17}:\\ \;\;\;\;\frac{0.8444480278083504 - {\left(\left(x + -0.5\right) \cdot \log x - x\right)}^{2}}{0.91893853320467 - \left(\left(x + -0.5\right) \cdot \log x - x\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 \frac{z}{\frac{x}{z}}\\ \end{array} \]

Alternative 3: 99.6% 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 4 \cdot 10^{+16}:\\ \;\;\;\;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 \frac{z}{\frac{x}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= x 4e+16)
     (+
      t_0
      (/
       (+
        0.083333333333333
        (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
       x))
     (+ t_0 (* (+ y 0.0007936500793651) (/ z (/ x z)))))))
double code(double x, double y, double z) {
	double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (x <= 4e+16) {
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	} else {
		tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
	}
	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 <= 4d+16) then
        tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
    else
        tmp = t_0 + ((y + 0.0007936500793651d0) * (z / (x / z)))
    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 <= 4e+16) {
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	} else {
		tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if x <= 4e+16:
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)
	else:
		tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)))
	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 <= 4e+16)
		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(x / z))));
	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 <= 4e+16)
		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	else
		tmp = t_0 + ((y + 0.0007936500793651) * (z / (x / z)));
	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, 4e+16], 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[(x / z), $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 4 \cdot 10^{+16}:\\
\;\;\;\;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 \frac{z}{\frac{x}{z}}\\


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

    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 4e16 < x

    1. Initial program 89.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 89.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*91.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. unpow291.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. Simplified91.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. Step-by-step derivation
      1. associate-/r/92.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 4 \cdot 10^{+16}:\\ \;\;\;\;\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 \frac{z}{\frac{x}{z}}\\ \end{array} \]

Alternative 4: 86.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;z \leq -3.8 \cdot 10^{-22}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.95 \cdot 10^{-40}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+42}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.89999999999999987e101 or 3.00000000000000029e42 < z

    1. Initial program 86.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 inf 86.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*89.1%

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

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

      \[\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 x around 0 80.6%

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

    if -2.89999999999999987e101 < z < -3.80000000000000023e-22 or 1.9499999999999999e-40 < z < 3.00000000000000029e42

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000023e-22 < z < 1.9499999999999999e-40

    1. Initial program 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.9 \cdot 10^{+101}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-22}:\\ \;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-40}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+42}:\\ \;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{y}{\frac{x}{z \cdot z}}\\ \mathbf{else}:\\ \;\;\;\;\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{z \cdot z}{\frac{x}{y + 0.0007936500793651}}\\ \end{array} \]

Alternative 5: 92.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{-23} \lor \neg \left(z \leq 2.65 \cdot 10^{-40}\right):\\ \;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{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 (or (<= z -7.4e-23) (not (<= z 2.65e-40)))
   (+
    (+ 0.91893853320467 (* x (+ (log x) -1.0)))
    (* (+ y 0.0007936500793651) (/ (* z z) x)))
   (+
    (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -7.4e-23) || !(z <= 2.65e-40)) {
		tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / 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 <= (-7.4d-23)) .or. (.not. (z <= 2.65d-40))) then
        tmp = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + ((y + 0.0007936500793651d0) * ((z * z) / 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 <= -7.4e-23) || !(z <= 2.65e-40)) {
		tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / 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 <= -7.4e-23) or not (z <= 2.65e-40):
		tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / 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 <= -7.4e-23) || !(z <= 2.65e-40))
		tmp = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(Float64(y + 0.0007936500793651) * Float64(Float64(z * z) / 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 <= -7.4e-23) || ~((z <= 2.65e-40)))
		tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + ((y + 0.0007936500793651) * ((z * z) / x));
	else
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -7.4e-23], N[Not[LessEqual[z, 2.65e-40]], $MachinePrecision]], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] / 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 -7.4 \cdot 10^{-23} \lor \neg \left(z \leq 2.65 \cdot 10^{-40}\right):\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{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 < -7.4000000000000005e-23 or 2.6500000000000001e-40 < z

    1. Initial program 89.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 x around inf 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.4000000000000005e-23 < z < 2.6500000000000001e-40

    1. Initial program 99.4%

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

      \[\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 simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{-23} \lor \neg \left(z \leq 2.65 \cdot 10^{-40}\right):\\ \;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{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 6: 94.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := 0.91893853320467 + x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -400 \lor \neg \left(z \leq 0.116\right):\\
\;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -400 or 0.116000000000000006 < 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 x around inf 89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -400 < z < 0.116000000000000006

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot \left(\log x + -1\right) + 0.91893853320467\right) + \frac{\color{blue}{{z}^{2} \cdot y} + 0.083333333333333}{x} \]
      2. unpow296.8%

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

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

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

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

Alternative 7: 95.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 7 \cdot 10^{+159}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \left(y + 0.0007936500793651\right) \cdot \frac{z \cdot z}{x}\\

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


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

    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 0 98.8%

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

    if 0.0015 < x < 6.9999999999999999e159

    1. Initial program 95.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 x around inf 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999999e159 < x

    1. Initial program 82.6%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Taylor expanded in z around inf 82.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*84.1%

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

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

      \[\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 0 85.7%

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

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

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

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

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

Alternative 8: 99.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0015:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \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) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\


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

    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 0 98.8%

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

    if 0.0015 < x

    1. Initial program 89.6%

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

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

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

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

      \[\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. Step-by-step derivation
      1. associate-/r/91.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.0015:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} + \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) + \left(y + 0.0007936500793651\right) \cdot \frac{z}{\frac{x}{z}}\\ \end{array} \]

Alternative 9: 82.8% accurate, 1.0× speedup?

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

\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 < -2.99999999999999976e70 or 7.20000000000000007e-31 < z

    1. Initial program 88.6%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Taylor expanded in z around inf 87.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*89.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. unpow289.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. Simplified89.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 x around 0 75.6%

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

    if -2.99999999999999976e70 < z < 7.20000000000000007e-31

    1. Initial program 99.4%

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

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

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

Alternative 10: 60.3% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := 0.91893853320467 + x \cdot \left(\log x + -1\right)\\
\mathbf{if}\;z \leq -3.9 \cdot 10^{-22}:\\
\;\;\;\;t_0 + -0.0027777777777778 \cdot \frac{z}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.89999999999999998e-22

    1. Initial program 89.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 x around inf 89.2%

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

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

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

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

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

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

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

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

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

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

    if -3.89999999999999998e-22 < z

    1. Initial program 96.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 0 68.5%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 61.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+41}:\\ \;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + -0.0027777777777778 \cdot \frac{z}{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 -2.5e+41)
   (+
    (+ 0.91893853320467 (* x (+ (log x) -1.0)))
    (* -0.0027777777777778 (/ z x)))
   (+
    (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
    (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -2.5e+41) {
		tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (-0.0027777777777778 * (z / 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 <= (-2.5d+41)) then
        tmp = (0.91893853320467d0 + (x * (log(x) + (-1.0d0)))) + ((-0.0027777777777778d0) * (z / 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 <= -2.5e+41) {
		tmp = (0.91893853320467 + (x * (Math.log(x) + -1.0))) + (-0.0027777777777778 * (z / 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 <= -2.5e+41:
		tmp = (0.91893853320467 + (x * (math.log(x) + -1.0))) + (-0.0027777777777778 * (z / 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 <= -2.5e+41)
		tmp = Float64(Float64(0.91893853320467 + Float64(x * Float64(log(x) + -1.0))) + Float64(-0.0027777777777778 * Float64(z / 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 <= -2.5e+41)
		tmp = (0.91893853320467 + (x * (log(x) + -1.0))) + (-0.0027777777777778 * (z / 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, -2.5e+41], N[(N[(0.91893853320467 + N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.0027777777777778 * N[(z / 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 -2.5 \cdot 10^{+41}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + -0.0027777777777778 \cdot \frac{z}{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 < -2.50000000000000011e41

    1. Initial program 87.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 x around inf 87.5%

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000011e41 < z

    1. Initial program 96.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 0 67.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+41}:\\ \;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + -0.0027777777777778 \cdot \frac{z}{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 12: 61.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+41}:\\
\;\;\;\;\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + -0.0027777777777778 \cdot \frac{z}{x}\\

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


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

    1. Initial program 87.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 x around inf 87.5%

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000011e41 < z

    1. Initial program 96.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 0 67.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. associate-+l-67.6%

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

        \[\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-eval67.6%

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

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

        \[\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-eval67.6%

        \[\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-rr67.6%

      \[\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 simplification62.3%

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

Alternative 13: 55.8% accurate, 1.1× speedup?

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

\\
\left(0.91893853320467 + x \cdot \left(\log x + -1\right)\right) + \frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 94.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 57.5%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 22.3% accurate, 1.1× speedup?

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

\\
\left(0.91893853320467 + -0.5 \cdot \log x\right) + \frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 94.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 57.5%

    \[\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 0 19.5%

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

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

Alternative 15: 2.5% accurate, 1.2× speedup?

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

\\
0.91893853320467 - \log x \cdot 0.5
\end{array}
Derivation
  1. Initial program 94.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 57.5%

    \[\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 0 19.5%

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

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

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

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

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

      \[\leadsto 0.91893853320467 + \color{blue}{\left(-\log x\right)} \cdot 0.5 \]
    3. distribute-lft-neg-out2.5%

      \[\leadsto 0.91893853320467 + \color{blue}{\left(-\log x \cdot 0.5\right)} \]
    4. unsub-neg2.5%

      \[\leadsto \color{blue}{0.91893853320467 - \log x \cdot 0.5} \]
  8. Simplified2.5%

    \[\leadsto \color{blue}{0.91893853320467 - \log x \cdot 0.5} \]
  9. Final simplification2.5%

    \[\leadsto 0.91893853320467 - \log x \cdot 0.5 \]

Developer target: 98.7% accurate, 1.0× speedup?

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

\\
\left(\left(\left(x - 0.5\right) \cdot \log x + \left(0.91893853320467 - x\right)\right) + \frac{0.083333333333333}{x}\right) + \frac{z}{x} \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)
\end{array}

Reproduce

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