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

Percentage Accurate: 94.0% → 99.2%
Time: 21.0s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 94.0% accurate, 1.0× speedup?

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

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

Alternative 1: 99.2% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

        \[\leadsto \left(\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} \]
      3. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e85 < x

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\color{blue}{\frac{\log x}{\frac{x \cdot x + \left(-0.5 \cdot -0.5 - x \cdot -0.5\right)}{{x}^{3} - {0.5}^{3}}}} - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
      11. *-un-lft-identity99.7%

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

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

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

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

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

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

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

    if 3.8e55 < x

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_0 + z \cdot \frac{z}{\frac{x}{y + 0.0007936500793651}}\\


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

    1. Initial program 99.7%

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

    if 1.76e8 < x

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 92.2% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.2%

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

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

        \[\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} \]
      3. sub-neg99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999993e143 < x

    1. Initial program 85.7%

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

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

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

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

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

Alternative 5: 99.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.8%

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

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

    if 0.28999999999999998 < x

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 61.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\ \mathbf{if}\;z \leq -1.65 \cdot 10^{+114}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+65}:\\ \;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \log \left(\frac{1}{x}\right)\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+132} \lor \neg \left(z \leq 4.8 \cdot 10^{+210}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (/ 0.083333333333333 x) (* x (- -1.0 (log1p (+ x -1.0)))))))
   (if (<= z -1.65e+114)
     t_0
     (if (<= z 1.15e+65)
       (+ (/ 0.083333333333333 x) (* x (- -1.0 (log (/ 1.0 x)))))
       (if (or (<= z 4.5e+132) (not (<= z 4.8e+210)))
         t_0
         (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
	double t_0 = (0.083333333333333 / x) + (x * (-1.0 - log1p((x + -1.0))));
	double tmp;
	if (z <= -1.65e+114) {
		tmp = t_0;
	} else if (z <= 1.15e+65) {
		tmp = (0.083333333333333 / x) + (x * (-1.0 - log((1.0 / x))));
	} else if ((z <= 4.5e+132) || !(z <= 4.8e+210)) {
		tmp = t_0;
	} else {
		tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = (0.083333333333333 / x) + (x * (-1.0 - Math.log1p((x + -1.0))));
	double tmp;
	if (z <= -1.65e+114) {
		tmp = t_0;
	} else if (z <= 1.15e+65) {
		tmp = (0.083333333333333 / x) + (x * (-1.0 - Math.log((1.0 / x))));
	} else if ((z <= 4.5e+132) || !(z <= 4.8e+210)) {
		tmp = t_0;
	} else {
		tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (0.083333333333333 / x) + (x * (-1.0 - math.log1p((x + -1.0))))
	tmp = 0
	if z <= -1.65e+114:
		tmp = t_0
	elif z <= 1.15e+65:
		tmp = (0.083333333333333 / x) + (x * (-1.0 - math.log((1.0 / x))))
	elif (z <= 4.5e+132) or not (z <= 4.8e+210):
		tmp = t_0
	else:
		tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log1p(Float64(x + -1.0)))))
	tmp = 0.0
	if (z <= -1.65e+114)
		tmp = t_0;
	elseif (z <= 1.15e+65)
		tmp = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log(Float64(1.0 / x)))));
	elseif ((z <= 4.5e+132) || !(z <= 4.8e+210))
		tmp = t_0;
	else
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+114], t$95$0, If[LessEqual[z, 1.15e+65], N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.5e+132], N[Not[LessEqual[z, 4.8e+210]], $MachinePrecision]], t$95$0, N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+114}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+65}:\\
\;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \log \left(\frac{1}{x}\right)\right)\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+132} \lor \neg \left(z \leq 4.8 \cdot 10^{+210}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.65e114 or 1.15e65 < z < 4.49999999999999972e132 or 4.79999999999999977e210 < z

    1. Initial program 95.3%

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

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

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

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

        \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}\right)\right)} - 1\right) + \frac{0.083333333333333}{x} \]
      3. sqrt-unprod3.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      4. log-rec3.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      5. log-rec3.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      6. sqr-neg3.0%

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

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      8. add-sqr-sqrt43.8%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\log x}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      9. expm1-udef43.8%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log x} - 1}\right) - 1\right) + \frac{0.083333333333333}{x} \]
      10. add-exp-log43.8%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\color{blue}{x} - 1\right) - 1\right) + \frac{0.083333333333333}{x} \]
    5. Applied egg-rr43.8%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\mathsf{log1p}\left(x - 1\right)} - 1\right) + \frac{0.083333333333333}{x} \]

    if -1.65e114 < z < 1.15e65

    1. Initial program 98.3%

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

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

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

    if 4.49999999999999972e132 < z < 4.79999999999999977e210

    1. Initial program 78.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+114}:\\ \;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+65}:\\ \;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \log \left(\frac{1}{x}\right)\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+132} \lor \neg \left(z \leq 4.8 \cdot 10^{+210}\right):\\ \;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \]

Alternative 7: 62.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\ \mathbf{if}\;z \leq -1.25 \cdot 10^{+114}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+69}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+132} \lor \neg \left(z \leq 1.9 \cdot 10^{+210}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (/ 0.083333333333333 x) (* x (- -1.0 (log1p (+ x -1.0)))))))
   (if (<= z -1.25e+114)
     t_0
     (if (<= z 2.3e+69)
       (+
        (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
        (/ 0.083333333333333 x))
       (if (or (<= z 5.6e+132) (not (<= z 1.9e+210)))
         t_0
         (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))))))
double code(double x, double y, double z) {
	double t_0 = (0.083333333333333 / x) + (x * (-1.0 - log1p((x + -1.0))));
	double tmp;
	if (z <= -1.25e+114) {
		tmp = t_0;
	} else if (z <= 2.3e+69) {
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	} else if ((z <= 5.6e+132) || !(z <= 1.9e+210)) {
		tmp = t_0;
	} else {
		tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	}
	return tmp;
}
public static double code(double x, double y, double z) {
	double t_0 = (0.083333333333333 / x) + (x * (-1.0 - Math.log1p((x + -1.0))));
	double tmp;
	if (z <= -1.25e+114) {
		tmp = t_0;
	} else if (z <= 2.3e+69) {
		tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	} else if ((z <= 5.6e+132) || !(z <= 1.9e+210)) {
		tmp = t_0;
	} else {
		tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (0.083333333333333 / x) + (x * (-1.0 - math.log1p((x + -1.0))))
	tmp = 0
	if z <= -1.25e+114:
		tmp = t_0
	elif z <= 2.3e+69:
		tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x)
	elif (z <= 5.6e+132) or not (z <= 1.9e+210):
		tmp = t_0
	else:
		tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(0.083333333333333 / x) + Float64(x * Float64(-1.0 - log1p(Float64(x + -1.0)))))
	tmp = 0.0
	if (z <= -1.25e+114)
		tmp = t_0;
	elseif (z <= 2.3e+69)
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x));
	elseif ((z <= 5.6e+132) || !(z <= 1.9e+210))
		tmp = t_0;
	else
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.083333333333333 / x), $MachinePrecision] + N[(x * N[(-1.0 - N[Log[1 + N[(x + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+114], t$95$0, If[LessEqual[z, 2.3e+69], N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 5.6e+132], N[Not[LessEqual[z, 1.9e+210]], $MachinePrecision]], t$95$0, N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+114}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+132} \lor \neg \left(z \leq 1.9 \cdot 10^{+210}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.25e114 or 2.30000000000000017e69 < z < 5.5999999999999998e132 or 1.90000000000000014e210 < z

    1. Initial program 95.3%

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

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

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

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

        \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}\right)\right)} - 1\right) + \frac{0.083333333333333}{x} \]
      3. sqrt-unprod3.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      4. log-rec3.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      5. log-rec3.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      6. sqr-neg3.0%

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

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      8. add-sqr-sqrt43.8%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\log x}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      9. expm1-udef43.8%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log x} - 1}\right) - 1\right) + \frac{0.083333333333333}{x} \]
      10. add-exp-log43.8%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\color{blue}{x} - 1\right) - 1\right) + \frac{0.083333333333333}{x} \]
    5. Applied egg-rr43.8%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\mathsf{log1p}\left(x - 1\right)} - 1\right) + \frac{0.083333333333333}{x} \]

    if -1.25e114 < z < 2.30000000000000017e69

    1. Initial program 98.3%

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

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

    if 5.5999999999999998e132 < z < 1.90000000000000014e210

    1. Initial program 78.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+114}:\\ \;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+69}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{+132} \lor \neg \left(z \leq 1.9 \cdot 10^{+210}\right):\\ \;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \]

Alternative 8: 60.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45 \cdot 10^{-267}:\\
\;\;\;\;\frac{0.083333333333333}{x} + x \cdot \left(-1 - \mathsf{log1p}\left(x + -1\right)\right)\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      5. log-rec24.9%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      6. sqr-neg24.9%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt{\color{blue}{\log x \cdot \log x}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      7. sqrt-unprod0.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      8. add-sqr-sqrt60.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\log x}\right)\right) - 1\right) + \frac{0.083333333333333}{x} \]
      9. expm1-udef60.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\color{blue}{e^{\log x} - 1}\right) - 1\right) + \frac{0.083333333333333}{x} \]
      10. add-exp-log60.0%

        \[\leadsto x \cdot \left(-1 \cdot \mathsf{log1p}\left(\color{blue}{x} - 1\right) - 1\right) + \frac{0.083333333333333}{x} \]
    5. Applied egg-rr60.0%

      \[\leadsto x \cdot \left(-1 \cdot \color{blue}{\mathsf{log1p}\left(x - 1\right)} - 1\right) + \frac{0.083333333333333}{x} \]

    if 1.45000000000000011e-267 < x

    1. Initial program 95.5%

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

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

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

        \[\leadsto \left(\color{blue}{\left(x + \left(-0.5\right)\right)} \cdot \log x - \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} \]
      4. metadata-eval95.5%

        \[\leadsto \left(\left(x + \color{blue}{-0.5}\right) \cdot \log x - \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-eval95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 55.8% accurate, 1.1× speedup?

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

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

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

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

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

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

Alternative 10: 55.8% accurate, 1.1× speedup?

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

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

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

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

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

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

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

Alternative 11: 35.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.5:\\
\;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\

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


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    6. Step-by-step derivation
      1. clear-num38.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{0.083333333333333}}} \]
      2. inv-pow38.0%

        \[\leadsto \color{blue}{{\left(\frac{x}{0.083333333333333}\right)}^{-1}} \]
      3. div-inv38.1%

        \[\leadsto {\color{blue}{\left(x \cdot \frac{1}{0.083333333333333}\right)}}^{-1} \]
      4. metadata-eval38.1%

        \[\leadsto {\left(x \cdot \color{blue}{12.000000000000048}\right)}^{-1} \]
    7. Applied egg-rr38.1%

      \[\leadsto \color{blue}{{\left(x \cdot 12.000000000000048\right)}^{-1}} \]

    if 2.5 < x

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right) - 1\right) + \color{blue}{\left(-0.083333333333333\right)} \cdot \frac{1}{x} \]
      11. cancel-sign-sub-inv72.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(\log x + -1\right) - \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
      22. metadata-eval72.6%

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

      \[\leadsto \color{blue}{x \cdot \left(\log x + -1\right) - x \cdot -0.083333333333333} \]
    6. Step-by-step derivation
      1. distribute-lft-out--27.9%

        \[\leadsto \color{blue}{x \cdot \left(\left(\log x + -1\right) - -0.083333333333333\right)} \]
      2. associate--l+27.9%

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

        \[\leadsto x \cdot \left(\log x + \color{blue}{-0.916666666666667}\right) \]
    7. Simplified27.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 2.5:\\ \;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -0.916666666666667\right)\\ \end{array} \]

Alternative 12: 27.1% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.88:\\
\;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\

\mathbf{else}:\\
\;\;\;\;x \cdot 0.083333333333333\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    6. Step-by-step derivation
      1. clear-num38.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{x}{0.083333333333333}}} \]
      2. inv-pow38.0%

        \[\leadsto \color{blue}{{\left(\frac{x}{0.083333333333333}\right)}^{-1}} \]
      3. div-inv38.1%

        \[\leadsto {\color{blue}{\left(x \cdot \frac{1}{0.083333333333333}\right)}}^{-1} \]
      4. metadata-eval38.1%

        \[\leadsto {\left(x \cdot \color{blue}{12.000000000000048}\right)}^{-1} \]
    7. Applied egg-rr38.1%

      \[\leadsto \color{blue}{{\left(x \cdot 12.000000000000048\right)}^{-1}} \]

    if 0.880000000000000004 < x

    1. Initial program 91.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. fma-neg91.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    6. Step-by-step derivation
      1. frac-2neg3.2%

        \[\leadsto \color{blue}{\frac{-0.083333333333333}{-x}} \]
      2. div-inv3.2%

        \[\leadsto \color{blue}{\left(-0.083333333333333\right) \cdot \frac{1}{-x}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}} \]
      4. sqrt-unprod1.7%

        \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}} \]
      5. sqr-neg1.7%

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

        \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \]
      7. add-sqr-sqrt1.5%

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

        \[\leadsto \color{blue}{-0.083333333333333} \cdot \frac{1}{x} \]
    7. Applied egg-rr1.5%

      \[\leadsto \color{blue}{-0.083333333333333 \cdot \frac{1}{x}} \]
    8. Step-by-step derivation
      1. associate-*r/1.5%

        \[\leadsto \color{blue}{\frac{-0.083333333333333 \cdot 1}{x}} \]
      2. metadata-eval1.5%

        \[\leadsto \frac{\color{blue}{-0.083333333333333}}{x} \]
    9. Simplified1.5%

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

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

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

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

        \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
      5. metadata-eval3.0%

        \[\leadsto \sqrt{\frac{\color{blue}{0.083333333333333 \cdot 0.083333333333333}}{x \cdot x}} \]
      6. frac-times3.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      8. add-sqr-sqrt3.2%

        \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
      9. div-inv3.2%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
      10. *-commutative3.2%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
      11. add-exp-log3.2%

        \[\leadsto \color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333 \]
      12. add-sqr-sqrt0.0%

        \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333 \]
      13. sqrt-unprod10.9%

        \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333 \]
      14. log-rec10.9%

        \[\leadsto e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333 \]
      15. log-rec10.9%

        \[\leadsto e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot 0.083333333333333 \]
      16. sqr-neg10.9%

        \[\leadsto e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot 0.083333333333333 \]
      17. sqrt-unprod10.9%

        \[\leadsto e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot 0.083333333333333 \]
      18. add-sqr-sqrt10.9%

        \[\leadsto e^{\color{blue}{\log x}} \cdot 0.083333333333333 \]
      19. add-exp-log10.9%

        \[\leadsto \color{blue}{x} \cdot 0.083333333333333 \]
    11. Applied egg-rr10.9%

      \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.88:\\ \;\;\;\;{\left(x \cdot 12.000000000000048\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.083333333333333\\ \end{array} \]

Alternative 13: 27.0% accurate, 24.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 0.88:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.083333333333333\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x 0.88) (/ 0.083333333333333 x) (* x 0.083333333333333)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= 0.88) {
		tmp = 0.083333333333333 / x;
	} else {
		tmp = x * 0.083333333333333;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= 0.88d0) then
        tmp = 0.083333333333333d0 / x
    else
        tmp = x * 0.083333333333333d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= 0.88) {
		tmp = 0.083333333333333 / x;
	} else {
		tmp = x * 0.083333333333333;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= 0.88:
		tmp = 0.083333333333333 / x
	else:
		tmp = x * 0.083333333333333
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= 0.88)
		tmp = Float64(0.083333333333333 / x);
	else
		tmp = Float64(x * 0.083333333333333);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= 0.88)
		tmp = 0.083333333333333 / x;
	else
		tmp = x * 0.083333333333333;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, 0.88], N[(0.083333333333333 / x), $MachinePrecision], N[(x * 0.083333333333333), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.88:\\
\;\;\;\;\frac{0.083333333333333}{x}\\

\mathbf{else}:\\
\;\;\;\;x \cdot 0.083333333333333\\


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

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    if 0.880000000000000004 < x

    1. Initial program 91.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. fma-neg91.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    6. Step-by-step derivation
      1. frac-2neg3.2%

        \[\leadsto \color{blue}{\frac{-0.083333333333333}{-x}} \]
      2. div-inv3.2%

        \[\leadsto \color{blue}{\left(-0.083333333333333\right) \cdot \frac{1}{-x}} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}} \]
      4. sqrt-unprod1.7%

        \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}} \]
      5. sqr-neg1.7%

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

        \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \]
      7. add-sqr-sqrt1.5%

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

        \[\leadsto \color{blue}{-0.083333333333333} \cdot \frac{1}{x} \]
    7. Applied egg-rr1.5%

      \[\leadsto \color{blue}{-0.083333333333333 \cdot \frac{1}{x}} \]
    8. Step-by-step derivation
      1. associate-*r/1.5%

        \[\leadsto \color{blue}{\frac{-0.083333333333333 \cdot 1}{x}} \]
      2. metadata-eval1.5%

        \[\leadsto \frac{\color{blue}{-0.083333333333333}}{x} \]
    9. Simplified1.5%

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

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

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

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

        \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
      5. metadata-eval3.0%

        \[\leadsto \sqrt{\frac{\color{blue}{0.083333333333333 \cdot 0.083333333333333}}{x \cdot x}} \]
      6. frac-times3.0%

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

        \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
      8. add-sqr-sqrt3.2%

        \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
      9. div-inv3.2%

        \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
      10. *-commutative3.2%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
      11. add-exp-log3.2%

        \[\leadsto \color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333 \]
      12. add-sqr-sqrt0.0%

        \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333 \]
      13. sqrt-unprod10.9%

        \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333 \]
      14. log-rec10.9%

        \[\leadsto e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333 \]
      15. log-rec10.9%

        \[\leadsto e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot 0.083333333333333 \]
      16. sqr-neg10.9%

        \[\leadsto e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot 0.083333333333333 \]
      17. sqrt-unprod10.9%

        \[\leadsto e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot 0.083333333333333 \]
      18. add-sqr-sqrt10.9%

        \[\leadsto e^{\color{blue}{\log x}} \cdot 0.083333333333333 \]
      19. add-exp-log10.9%

        \[\leadsto \color{blue}{x} \cdot 0.083333333333333 \]
    11. Applied egg-rr10.9%

      \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.88:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot 0.083333333333333\\ \end{array} \]

Alternative 14: 1.3% accurate, 41.0× speedup?

\[\begin{array}{l} \\ x \cdot -0.083333333333333 \end{array} \]
(FPCore (x y z) :precision binary64 (* x -0.083333333333333))
double code(double x, double y, double z) {
	return x * -0.083333333333333;
}
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.083333333333333d0)
end function
public static double code(double x, double y, double z) {
	return x * -0.083333333333333;
}
def code(x, y, z):
	return x * -0.083333333333333
function code(x, y, z)
	return Float64(x * -0.083333333333333)
end
function tmp = code(x, y, z)
	tmp = x * -0.083333333333333;
end
code[x_, y_, z_] := N[(x * -0.083333333333333), $MachinePrecision]
\begin{array}{l}

\\
x \cdot -0.083333333333333
\end{array}
Derivation
  1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  6. Step-by-step derivation
    1. frac-2neg22.1%

      \[\leadsto \color{blue}{\frac{-0.083333333333333}{-x}} \]
    2. div-inv22.1%

      \[\leadsto \color{blue}{\left(-0.083333333333333\right) \cdot \frac{1}{-x}} \]
    3. add-sqr-sqrt0.0%

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}} \]
    4. sqrt-unprod6.4%

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}} \]
    5. sqr-neg6.4%

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

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \]
    7. add-sqr-sqrt1.6%

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{x}} \]
    8. metadata-eval1.6%

      \[\leadsto \color{blue}{-0.083333333333333} \cdot \frac{1}{x} \]
  7. Applied egg-rr1.6%

    \[\leadsto \color{blue}{-0.083333333333333 \cdot \frac{1}{x}} \]
  8. Step-by-step derivation
    1. associate-*r/1.6%

      \[\leadsto \color{blue}{\frac{-0.083333333333333 \cdot 1}{x}} \]
    2. metadata-eval1.6%

      \[\leadsto \frac{\color{blue}{-0.083333333333333}}{x} \]
  9. Simplified1.6%

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

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

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

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

      \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
    5. metadata-eval25.7%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
    8. add-sqr-sqrt22.1%

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    9. expm1-log1p-u20.5%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.083333333333333}{x}\right)\right)} \]
    10. expm1-udef20.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0.083333333333333}{x}\right)} - 1} \]
  11. Applied egg-rr1.0%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(x \cdot -0.083333333333333\right)} - 1} \]
  12. Step-by-step derivation
    1. expm1-def0.9%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x \cdot -0.083333333333333\right)\right)} \]
    2. expm1-log1p1.2%

      \[\leadsto \color{blue}{x \cdot -0.083333333333333} \]
  13. Simplified1.2%

    \[\leadsto \color{blue}{x \cdot -0.083333333333333} \]
  14. Final simplification1.2%

    \[\leadsto x \cdot -0.083333333333333 \]

Alternative 15: 6.5% accurate, 41.0× speedup?

\[\begin{array}{l} \\ x \cdot 0.083333333333333 \end{array} \]
(FPCore (x y z) :precision binary64 (* x 0.083333333333333))
double code(double x, double y, double z) {
	return x * 0.083333333333333;
}
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.083333333333333d0
end function
public static double code(double x, double y, double z) {
	return x * 0.083333333333333;
}
def code(x, y, z):
	return x * 0.083333333333333
function code(x, y, z)
	return Float64(x * 0.083333333333333)
end
function tmp = code(x, y, z)
	tmp = x * 0.083333333333333;
end
code[x_, y_, z_] := N[(x * 0.083333333333333), $MachinePrecision]
\begin{array}{l}

\\
x \cdot 0.083333333333333
\end{array}
Derivation
  1. Initial program 96.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  6. Step-by-step derivation
    1. frac-2neg22.1%

      \[\leadsto \color{blue}{\frac{-0.083333333333333}{-x}} \]
    2. div-inv22.1%

      \[\leadsto \color{blue}{\left(-0.083333333333333\right) \cdot \frac{1}{-x}} \]
    3. add-sqr-sqrt0.0%

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{-x} \cdot \sqrt{-x}}} \]
    4. sqrt-unprod6.4%

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{\left(-x\right) \cdot \left(-x\right)}}} \]
    5. sqr-neg6.4%

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

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{\sqrt{x} \cdot \sqrt{x}}} \]
    7. add-sqr-sqrt1.6%

      \[\leadsto \left(-0.083333333333333\right) \cdot \frac{1}{\color{blue}{x}} \]
    8. metadata-eval1.6%

      \[\leadsto \color{blue}{-0.083333333333333} \cdot \frac{1}{x} \]
  7. Applied egg-rr1.6%

    \[\leadsto \color{blue}{-0.083333333333333 \cdot \frac{1}{x}} \]
  8. Step-by-step derivation
    1. associate-*r/1.6%

      \[\leadsto \color{blue}{\frac{-0.083333333333333 \cdot 1}{x}} \]
    2. metadata-eval1.6%

      \[\leadsto \frac{\color{blue}{-0.083333333333333}}{x} \]
  9. Simplified1.6%

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

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

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

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

      \[\leadsto \sqrt{\frac{\color{blue}{0.0069444444444443885}}{x \cdot x}} \]
    5. metadata-eval25.7%

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{0.083333333333333}{x}} \cdot \sqrt{\frac{0.083333333333333}{x}}} \]
    8. add-sqr-sqrt22.1%

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
    9. div-inv22.1%

      \[\leadsto \color{blue}{0.083333333333333 \cdot \frac{1}{x}} \]
    10. *-commutative22.1%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot 0.083333333333333} \]
    11. add-exp-log20.5%

      \[\leadsto \color{blue}{e^{\log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333 \]
    12. add-sqr-sqrt18.7%

      \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right)} \cdot \sqrt{\log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333 \]
    13. sqrt-unprod24.0%

      \[\leadsto e^{\color{blue}{\sqrt{\log \left(\frac{1}{x}\right) \cdot \log \left(\frac{1}{x}\right)}}} \cdot 0.083333333333333 \]
    14. log-rec24.0%

      \[\leadsto e^{\sqrt{\color{blue}{\left(-\log x\right)} \cdot \log \left(\frac{1}{x}\right)}} \cdot 0.083333333333333 \]
    15. log-rec24.0%

      \[\leadsto e^{\sqrt{\left(-\log x\right) \cdot \color{blue}{\left(-\log x\right)}}} \cdot 0.083333333333333 \]
    16. sqr-neg24.0%

      \[\leadsto e^{\sqrt{\color{blue}{\log x \cdot \log x}}} \cdot 0.083333333333333 \]
    17. sqrt-unprod5.0%

      \[\leadsto e^{\color{blue}{\sqrt{\log x} \cdot \sqrt{\log x}}} \cdot 0.083333333333333 \]
    18. add-sqr-sqrt6.4%

      \[\leadsto e^{\color{blue}{\log x}} \cdot 0.083333333333333 \]
    19. add-exp-log6.4%

      \[\leadsto \color{blue}{x} \cdot 0.083333333333333 \]
  11. Applied egg-rr6.4%

    \[\leadsto \color{blue}{x \cdot 0.083333333333333} \]
  12. Final simplification6.4%

    \[\leadsto x \cdot 0.083333333333333 \]

Developer target: 98.6% accurate, 1.0× speedup?

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

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

Reproduce

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