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

Percentage Accurate: 93.7% → 99.5%
Time: 13.9s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 93.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.5% accurate, 0.6× speedup?

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

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

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


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

    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 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.91893853320467 + \color{blue}{\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} \]
      11. associate--l+99.7%

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

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

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

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

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

    if 1.45e9 < x

    1. Initial program 83.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. associate-+l-83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 1.0× speedup?

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

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

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


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

    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 1.18e-4 < x

    1. Initial program 84.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. associate-+l-84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. associate-+l-99.7%

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

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

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

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

        \[\leadsto \left(\left(x + -0.5\right) \cdot \log x - \left(x + \color{blue}{-0.91893853320467}\right)\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}{\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Taylor expanded in x around 0 99.4%

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

    if 1.18e-4 < x

    1. Initial program 84.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. associate-+l-84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 93.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 97.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 96.6%

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

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

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

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

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

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

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

    if 4.9999999999999997e161 < x

    1. Initial program 73.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 0 85.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 85.6%

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

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

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

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

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

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

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

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

Alternative 5: 99.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. associate-+l-99.7%

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

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

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

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

        \[\leadsto \left(\left(x + -0.5\right) \cdot \log x - \left(x + \color{blue}{-0.91893853320467}\right)\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}{\left(\left(x + -0.5\right) \cdot \log x - \left(x + -0.91893853320467\right)\right)} + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    4. Taylor expanded in x around 0 99.4%

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

    if 1.18e-4 < x

    1. Initial program 84.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Step-by-step derivation
      1. associate-+l-84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 63.5% accurate, 1.1× speedup?

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

\\
\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Derivation
  1. Initial program 92.3%

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

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left({\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}}\right)}^{2} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) \]
    6. add-sqr-sqrt69.3%

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

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

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

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

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

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

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

Alternative 7: 62.6% accurate, 1.1× speedup?

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

\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Derivation
  1. Initial program 92.3%

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

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \left(-0.0027777777777778 \cdot \frac{z}{x} + \left({\left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sqrt{0.0007936500793651 \cdot \frac{1}{x} + \frac{y}{x}}\right)}^{2} + 0.083333333333333 \cdot \frac{1}{x}\right)\right) \]
    6. add-sqr-sqrt69.3%

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

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x} \]
  9. Step-by-step derivation
    1. sub-neg54.8%

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

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(\log x + -1\right)} + \frac{0.083333333333333 + -0.0027777777777778 \cdot z}{x} \]
  11. Final simplification61.3%

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

Alternative 8: 57.5% accurate, 1.1× speedup?

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

\\
x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 92.3%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 24.1% accurate, 41.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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 2023322 
(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)))