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

Percentage Accurate: 94.2% → 99.6%
Time: 33.1s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 94.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. div-inv99.6%

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

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

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

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

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

      \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right) \cdot \frac{1}{x}} \]
    5. Step-by-step derivation
      1. remove-double-div99.6%

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

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

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

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

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

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

    if 1.62000000000000003e-21 < x

    1. Initial program 89.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l-89.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-neg89.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-eval89.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. *-commutative89.8%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval89.8%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.6% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. 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. *-commutative99.7%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval99.7%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr99.7%

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

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

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

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

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

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

    if 1.99999999999999992e28 < x

    1. Initial program 87.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l-87.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-neg87.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-eval87.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. *-commutative87.7%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval87.7%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

    if 1.99999999999999983e29 < x

    1. Initial program 87.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l-87.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-neg87.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-eval87.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. *-commutative87.7%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval87.7%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. 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. *-commutative99.7%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval99.7%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr99.7%

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

    if 1.99999999999999992e28 < x

    1. Initial program 87.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+l-87.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-neg87.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-eval87.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. *-commutative87.7%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval87.7%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-24} \lor \neg \left(z \leq 1.7 \cdot 10^{-32}\right):\\
\;\;\;\;\left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + y \cdot \left(z \cdot \frac{z}{x}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.50000000000000029e-24 or 1.69999999999999989e-32 < z

    1. Initial program 90.6%

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

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

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

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

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval90.6%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr90.6%

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

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

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

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

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \left(x + -0.91893853320467\right)\right) + y \cdot \color{blue}{\left(z \cdot \frac{z}{x}\right)} \]
    9. Applied egg-rr74.3%

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

    if -9.50000000000000029e-24 < z < 1.69999999999999989e-32

    1. Initial program 99.5%

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

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

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

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

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

        \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      2. add-sqr-sqrt94.7%

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

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

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

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

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

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

Alternative 6: 99.1% accurate, 1.0× speedup?

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

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


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

    1. Initial program 99.7%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. 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. *-commutative99.7%

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval99.7%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr99.7%

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

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

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

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

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

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

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

    if 225 < x

    1. Initial program 89.1%

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

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

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

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

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval89.1%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 96.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 98.6%

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

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

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

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

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

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

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

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

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

    if 9.80000000000000003e110 < x

    1. Initial program 85.0%

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

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

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

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

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval85.0%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr85.0%

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

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

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

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

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

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

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

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

Alternative 8: 98.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

    if 225 < x

    1. Initial program 89.1%

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

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

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

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

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

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
      6. metadata-eval89.1%

        \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    4. Applied egg-rr89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.3% 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 94.5%

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

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

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

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

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

      \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
    6. metadata-eval94.5%

      \[\leadsto \left(\log x \cdot \left(x + -0.5\right) - \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} \]
  4. Applied egg-rr94.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.2% accurate, 1.1× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right)} + \frac{0.083333333333333}{x} \]
  5. Step-by-step derivation
    1. sub-neg53.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-neg53.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-rec53.6%

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

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

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

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

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

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

Developer target: 98.7% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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