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

Percentage Accurate: 93.8% → 95.4%
Time: 40.4s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 93.8% 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: 95.4% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.79999999999999996e223 < x

    1. Initial program 83.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. Taylor expanded in y around 0 85.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \mathsf{fma}\left(\log x, x + -0.5, \frac{z}{\frac{x}{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}}\right)\right)\right) - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.1%

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

Alternative 2: 95.3% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

    if 4.0000000000000002e222 < x

    1. Initial program 83.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. Taylor expanded in y around 0 85.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \mathsf{fma}\left(\log x, x + -0.5, \frac{z}{\frac{x}{\mathsf{fma}\left(0.0007936500793651, z, -0.0027777777777778\right)}}\right)\right)\right) - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.1%

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

Alternative 3: 95.3% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\frac{0.083333333333333}{x} + \left(t\_0 + \frac{z}{x} \cdot \mathsf{fma}\left(z, 0.0007936500793651, -0.0027777777777778\right)\right)\right)\right) - x\\


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

    1. Initial program 98.4%

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

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

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

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

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

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

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

    if 5.0000000000000002e220 < x

    1. Initial program 83.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. Taylor expanded in y around 0 85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

    if 8.5e26 < x

    1. Initial program 92.1%

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

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

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

Alternative 5: 88.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

    if 6.50000000000000022e26 < x

    1. Initial program 92.1%

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

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

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

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

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

        \[\leadsto \left(\left(x \cdot \left(-\color{blue}{\left(-\log x\right)}\right) - x\right) + 0.91893853320467\right) + \frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x} \]
      4. remove-double-neg87.6%

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

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

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

Alternative 6: 93.8% accurate, 1.0× speedup?

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

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

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

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

Alternative 7: 93.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

    \[\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} \]
  5. Final simplification96.3%

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

Alternative 8: 84.1% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.49999999999999976e34 < x

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

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

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

Alternative 9: 84.1% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9000000000000001e34 < x

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) \]
    5. Simplified81.0%

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

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

Alternative 10: 61.7% accurate, 9.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(x + -0.5, \log x, 0.91893853320467 - x\right) + \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(y + 0.0007936500793651, z, -0.0027777777777778\right), 0.083333333333333\right)}{x}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. +-commutative96.4%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{x}} \]
  8. Final simplification62.9%

    \[\leadsto \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x} \]
  9. Add Preprocessing

Alternative 11: 28.8% accurate, 11.2× speedup?

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

\\
-0.0027777777777778 \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x}
\end{array}
Derivation
  1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-0.0027777777777778 \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x}} \]
  8. Final simplification32.5%

    \[\leadsto -0.0027777777777778 \cdot \frac{z}{x} + 0.083333333333333 \cdot \frac{1}{x} \]
  9. Add Preprocessing

Alternative 12: 46.3% accurate, 11.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333 + z \cdot \left(0.0007936500793651 \cdot z - 0.0027777777777778\right)}{x}} \]
  7. Final simplification48.9%

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

Alternative 13: 28.8% accurate, 17.6× speedup?

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

\\
\frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}
\end{array}
Derivation
  1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{0.083333333333333 + \color{blue}{-0.0027777777777778 \cdot z}}{x} \]
  8. Final simplification32.2%

    \[\leadsto \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x} \]
  9. Add Preprocessing

Alternative 14: 23.2% accurate, 41.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{0.083333333333333}}{x} \]
  8. Final simplification26.4%

    \[\leadsto \frac{0.083333333333333}{x} \]
  9. 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 2024034 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

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

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