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

Percentage Accurate: 93.8% → 99.0%
Time: 15.9s
Alternatives: 11
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 11 alternatives:

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

Initial Program: 93.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if 1.50000000000000007e92 < x

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in z around inf 81.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}} \]
    4. Step-by-step derivation
      1. associate-/l*87.5%

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

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

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

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

Alternative 2: 83.4% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;z \leq 4.3 \cdot 10^{+49}:\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\

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

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5e20 or 5.99999999999999937e104 < z

    1. Initial program 83.0%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 83.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}} \]
    4. Taylor expanded in x around 0 72.7%

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

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

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

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

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

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

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

    if -4.5e20 < z < 1.15e-21

    1. Initial program 99.5%

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

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

    if 1.15e-21 < z < 4.2999999999999999e49

    1. Initial program 99.7%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 73.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot {z}^{2}}}{x} \]
      2. associate-*r/73.7%

        \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]
    9. Simplified73.7%

      \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]

    if 4.2999999999999999e49 < z < 5.99999999999999937e104

    1. Initial program 91.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. Add Preprocessing
    3. Taylor expanded in z around 0 68.2%

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

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

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

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

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

        \[\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} \]
      5. metadata-eval91.2%

        \[\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} \]
      6. +-commutative91.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+20}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right) + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{-21}:\\ \;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq 4.3 \cdot 10^{+49}:\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+104}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(z \cdot \frac{0.0007936500793651 + y}{x}\right) + \left(0.91893853320467 + \log x \cdot -0.5\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 98.7% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

Alternative 4: 99.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

    if 6.60000000000000034e91 < x

    1. Initial program 81.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. Add Preprocessing
    3. Taylor expanded in z around inf 81.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}} \]
    4. Step-by-step derivation
      1. associate-/l*87.5%

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

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

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

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

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

Alternative 5: 98.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.6%

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

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

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

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

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

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

        \[\leadsto \left(\left(x + \color{blue}{-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} \]
      7. fma-undefine99.6%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-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} \]
    7. Simplified99.6%

      \[\leadsto \color{blue}{\left(-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 5.6999999999999997e-11 < x

    1. Initial program 87.1%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 86.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}} \]
    4. Step-by-step derivation
      1. associate-/l*90.4%

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

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

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

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

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

Alternative 6: 93.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(\log x + -1\right)\\ \mathbf{if}\;x \leq 8.5 \cdot 10^{+221}:\\ \;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{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 8.5e+221)
     (+
      (/
       (+
        0.083333333333333
        (* z (- (* z (+ 0.0007936500793651 y)) 0.0027777777777778)))
       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 <= 8.5e+221) {
		tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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 <= 8.5d+221) then
        tmp = ((0.083333333333333d0 + (z * ((z * (0.0007936500793651d0 + y)) - 0.0027777777777778d0))) / 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 <= 8.5e+221) {
		tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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 <= 8.5e+221:
		tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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 <= 8.5e+221)
		tmp = Float64(Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(0.0007936500793651 + y)) - 0.0027777777777778))) / 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 <= 8.5e+221)
		tmp = ((0.083333333333333 + (z * ((z * (0.0007936500793651 + y)) - 0.0027777777777778))) / 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, 8.5e+221], N[(N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(0.0007936500793651 + y), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $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 8.5 \cdot 10^{+221}:\\
\;\;\;\;\frac{0.083333333333333 + z \cdot \left(z \cdot \left(0.0007936500793651 + y\right) - 0.0027777777777778\right)}{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.5000000000000004e221

    1. Initial program 97.0%

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

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

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

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

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

        \[\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} \]
      5. metadata-eval96.1%

        \[\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} \]
      6. +-commutative96.1%

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

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

    if 8.5000000000000004e221 < x

    1. Initial program 71.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. Add Preprocessing
    3. Taylor expanded in z around 0 91.2%

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

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

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

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

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

        \[\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} \]
      5. metadata-eval71.2%

        \[\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} \]
      6. +-commutative71.2%

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

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

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

Alternative 7: 83.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-21}\right):\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.8e19 or 1.15e-21 < z

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in z around inf 84.6%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot {z}^{2}}}{x} \]
      2. associate-*r/71.3%

        \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]
    9. Simplified71.3%

      \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]

    if -3.8e19 < z < 1.15e-21

    1. Initial program 99.5%

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

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

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

Alternative 8: 82.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-21}\right):\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -1.9e+19) (not (<= z 1.15e-21)))
   (* (+ 0.0007936500793651 y) (/ (pow z 2.0) x))
   (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.9e+19) || !(z <= 1.15e-21)) {
		tmp = (0.0007936500793651 + y) * (pow(z, 2.0) / x);
	} else {
		tmp = (x * (log(x) + -1.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) :: tmp
    if ((z <= (-1.9d+19)) .or. (.not. (z <= 1.15d-21))) then
        tmp = (0.0007936500793651d0 + y) * ((z ** 2.0d0) / x)
    else
        tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.9e+19) || !(z <= 1.15e-21)) {
		tmp = (0.0007936500793651 + y) * (Math.pow(z, 2.0) / x);
	} else {
		tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -1.9e+19) or not (z <= 1.15e-21):
		tmp = (0.0007936500793651 + y) * (math.pow(z, 2.0) / x)
	else:
		tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -1.9e+19) || !(z <= 1.15e-21))
		tmp = Float64(Float64(0.0007936500793651 + y) * Float64((z ^ 2.0) / x));
	else
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -1.9e+19) || ~((z <= 1.15e-21)))
		tmp = (0.0007936500793651 + y) * ((z ^ 2.0) / x);
	else
		tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.9e+19], N[Not[LessEqual[z, 1.15e-21]], $MachinePrecision]], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-21}\right):\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9e19 or 1.15e-21 < z

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in z around inf 84.6%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot {z}^{2}}}{x} \]
      2. associate-*r/71.3%

        \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]
    9. Simplified71.3%

      \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]

    if -1.9e19 < z < 1.15e-21

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\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} \]
      5. metadata-eval97.9%

        \[\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} \]
      6. +-commutative97.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+19} \lor \neg \left(z \leq 1.15 \cdot 10^{-21}\right):\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 60.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-60}\right):\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -1.05e-25) (not (<= z 5.4e-60)))
   (* (+ 0.0007936500793651 y) (/ (pow z 2.0) x))
   (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.05e-25) || !(z <= 5.4e-60)) {
		tmp = (0.0007936500793651 + y) * (pow(z, 2.0) / x);
	} else {
		tmp = 0.083333333333333 / x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-1.05d-25)) .or. (.not. (z <= 5.4d-60))) then
        tmp = (0.0007936500793651d0 + y) * ((z ** 2.0d0) / x)
    else
        tmp = 0.083333333333333d0 / x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -1.05e-25) || !(z <= 5.4e-60)) {
		tmp = (0.0007936500793651 + y) * (Math.pow(z, 2.0) / x);
	} else {
		tmp = 0.083333333333333 / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -1.05e-25) or not (z <= 5.4e-60):
		tmp = (0.0007936500793651 + y) * (math.pow(z, 2.0) / x)
	else:
		tmp = 0.083333333333333 / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -1.05e-25) || !(z <= 5.4e-60))
		tmp = Float64(Float64(0.0007936500793651 + y) * Float64((z ^ 2.0) / x));
	else
		tmp = Float64(0.083333333333333 / x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -1.05e-25) || ~((z <= 5.4e-60)))
		tmp = (0.0007936500793651 + y) * ((z ^ 2.0) / x);
	else
		tmp = 0.083333333333333 / x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.05e-25], N[Not[LessEqual[z, 5.4e-60]], $MachinePrecision]], N[(N[(0.0007936500793651 + y), $MachinePrecision] * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-60}\right):\\
\;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.05000000000000001e-25 or 5.40000000000000001e-60 < z

    1. Initial program 87.6%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 63.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\left(0.0007936500793651 + y\right) \cdot {z}^{2}}}{x} \]
      2. associate-*r/65.5%

        \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]
    9. Simplified65.5%

      \[\leadsto \color{blue}{\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}} \]

    if -1.05000000000000001e-25 < z < 5.40000000000000001e-60

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\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} \]
      5. metadata-eval97.6%

        \[\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} \]
      6. +-commutative97.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{-25} \lor \neg \left(z \leq 5.4 \cdot 10^{-60}\right):\\ \;\;\;\;\left(0.0007936500793651 + y\right) \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 50.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-25} \lor \neg \left(z \leq 2 \cdot 10^{-59}\right):\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -2.1e-25) (not (<= z 2e-59)))
   (* y (/ (pow z 2.0) x))
   (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.1e-25) || !(z <= 2e-59)) {
		tmp = y * (pow(z, 2.0) / x);
	} else {
		tmp = 0.083333333333333 / x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-2.1d-25)) .or. (.not. (z <= 2d-59))) then
        tmp = y * ((z ** 2.0d0) / x)
    else
        tmp = 0.083333333333333d0 / x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.1e-25) || !(z <= 2e-59)) {
		tmp = y * (Math.pow(z, 2.0) / x);
	} else {
		tmp = 0.083333333333333 / x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -2.1e-25) or not (z <= 2e-59):
		tmp = y * (math.pow(z, 2.0) / x)
	else:
		tmp = 0.083333333333333 / x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -2.1e-25) || !(z <= 2e-59))
		tmp = Float64(y * Float64((z ^ 2.0) / x));
	else
		tmp = Float64(0.083333333333333 / x);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -2.1e-25) || ~((z <= 2e-59)))
		tmp = y * ((z ^ 2.0) / x);
	else
		tmp = 0.083333333333333 / x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.1e-25], N[Not[LessEqual[z, 2e-59]], $MachinePrecision]], N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(0.083333333333333 / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-25} \lor \neg \left(z \leq 2 \cdot 10^{-59}\right):\\
\;\;\;\;y \cdot \frac{{z}^{2}}{x}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.10000000000000002e-25 or 2.0000000000000001e-59 < z

    1. Initial program 87.6%

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

      \[\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}} \]
    4. Taylor expanded in x around 0 63.4%

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
    8. Step-by-step derivation
      1. associate-/l*51.8%

        \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]
    9. Simplified51.8%

      \[\leadsto \color{blue}{y \cdot \frac{{z}^{2}}{x}} \]

    if -2.10000000000000002e-25 < z < 2.0000000000000001e-59

    1. Initial program 99.5%

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

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

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

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

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

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

        \[\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} \]
      5. metadata-eval97.6%

        \[\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} \]
      6. +-commutative97.6%

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

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

      \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification50.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-25} \lor \neg \left(z \leq 2 \cdot 10^{-59}\right):\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 23.8% accurate, 41.0× speedup?

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

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

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

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

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

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

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

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

      \[\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} \]
    5. metadata-eval92.0%

      \[\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} \]
    6. +-commutative92.0%

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

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

    \[\leadsto \color{blue}{\frac{0.083333333333333}{x}} \]
  8. Add Preprocessing

Developer target: 98.5% 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 2024089 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
  :precision binary64

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

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