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

Percentage Accurate: 93.5% → 98.2%
Time: 20.2s
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: 93.5% 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: 98.2% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295

    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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 81.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. add-sqr-sqrt81.7%

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

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

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

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

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

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

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

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

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

Alternative 2: 98.1% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295

    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. Step-by-step derivation
      1. +-commutative99.6%

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 81.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. add-sqr-sqrt81.7%

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

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

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

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

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

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

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

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

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

Alternative 3: 98.1% accurate, 0.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295

    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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 81.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. add-sqr-sqrt81.7%

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 1.99999999999999996e296

    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. Step-by-step derivation
      1. associate-+l+99.6%

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999996e296 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 81.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 81.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}} \]
    3. Step-by-step derivation
      1. associate-/l*87.2%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z) < 3.9999999999999999e295

    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. Taylor expanded in x around 0 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999999e295 < (*.f64 (-.f64 (*.f64 (+.f64 y 7936500793651/10000000000000000) z) 13888888888889/5000000000000000) z)

    1. Initial program 81.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 inf 81.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}} \]
    3. Step-by-step derivation
      1. associate-/l*87.4%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 99.7%

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

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

        \[\leadsto \left(\left(\left(x + \color{blue}{-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} \]
      3. *-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} \]
      4. flip-+99.7%

        \[\leadsto \left(\left(\log x \cdot \color{blue}{\frac{x \cdot x - -0.5 \cdot -0.5}{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} \]
      5. associate-*r/99.7%

        \[\leadsto \left(\left(\color{blue}{\frac{\log x \cdot \left(x \cdot x - -0.5 \cdot -0.5\right)}{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} \]
      6. fma-neg99.7%

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

        \[\leadsto \left(\left(\frac{\log x \cdot \mathsf{fma}\left(x, x, -\color{blue}{0.25}\right)}{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} \]
      8. metadata-eval99.7%

        \[\leadsto \left(\left(\frac{\log x \cdot \mathsf{fma}\left(x, x, \color{blue}{-0.25}\right)}{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} \]
      9. sub-neg99.7%

        \[\leadsto \left(\left(\frac{\log x \cdot \mathsf{fma}\left(x, x, -0.25\right)}{\color{blue}{x + \left(--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. metadata-eval99.7%

        \[\leadsto \left(\left(\frac{\log x \cdot \mathsf{fma}\left(x, x, -0.25\right)}{x + \color{blue}{0.5}} - 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 \cdot \mathsf{fma}\left(x, x, -0.25\right)}{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} \]
    4. Step-by-step derivation
      1. associate-/l*99.7%

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

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

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

        \[\leadsto \left(\frac{\log x}{\color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, x, -0.25\right)}{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} \]
      3. metadata-eval99.7%

        \[\leadsto \left(\frac{\log x}{\frac{1}{\frac{\mathsf{fma}\left(x, x, \color{blue}{-0.25}\right)}{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. metadata-eval99.7%

        \[\leadsto \left(\frac{\log x}{\frac{1}{\frac{\mathsf{fma}\left(x, x, -\color{blue}{-0.5 \cdot -0.5}\right)}{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} \]
      5. fma-neg99.7%

        \[\leadsto \left(\frac{\log x}{\frac{1}{\frac{\color{blue}{x \cdot x - -0.5 \cdot -0.5}}{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} \]
      6. *-un-lft-identity99.7%

        \[\leadsto \left(\frac{\log x}{\frac{1}{\frac{x \cdot x - -0.5 \cdot -0.5}{\color{blue}{1 \cdot 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} \]
      7. fma-def99.7%

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

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

        \[\leadsto \left(\frac{\log x}{\frac{1}{\frac{x \cdot x - -0.5 \cdot -0.5}{\color{blue}{1 \cdot 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} \]
      10. *-un-lft-identity99.7%

        \[\leadsto \left(\frac{\log x}{\frac{1}{\frac{x \cdot x - -0.5 \cdot -0.5}{\color{blue}{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} \]
      11. flip-+99.7%

        \[\leadsto \left(\frac{\log x}{\frac{1}{\color{blue}{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} \]
    7. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\left(\frac{\log x}{\frac{1}{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} \]

    if 5.8e6 < x

    1. Initial program 89.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 89.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}} \]
    3. Step-by-step derivation
      1. associate-/l*92.6%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 73.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\left(x + -0.5\right) \cdot \log x - x\right) + \left(0.91893853320467 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\right)\\ \mathbf{if}\;z \leq -7.6 \cdot 10^{+84}:\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\ \;\;\;\;\frac{y \cdot {z}^{2}}{x}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{1}{z} \cdot \frac{x}{z}} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (+
          (- (* (+ x -0.5) (log x)) x)
          (+
           0.91893853320467
           (/ (+ 0.083333333333333 (* z -0.0027777777777778)) x)))))
   (if (<= z -7.6e+84)
     (* y (/ (pow z 2.0) x))
     (if (<= z -8.8e-18)
       t_0
       (if (<= z -2.15e-24)
         (/ (* y (pow z 2.0)) x)
         (if (<= z 1.15e+114)
           t_0
           (+
            (/ y (* (/ 1.0 z) (/ x z)))
            (+ 0.91893853320467 (* -0.5 (log x))))))))))
double code(double x, double y, double z) {
	double t_0 = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x));
	double tmp;
	if (z <= -7.6e+84) {
		tmp = y * (pow(z, 2.0) / x);
	} else if (z <= -8.8e-18) {
		tmp = t_0;
	} else if (z <= -2.15e-24) {
		tmp = (y * pow(z, 2.0)) / x;
	} else if (z <= 1.15e+114) {
		tmp = t_0;
	} else {
		tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * log(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 + ((0.083333333333333d0 + (z * (-0.0027777777777778d0))) / x))
    if (z <= (-7.6d+84)) then
        tmp = y * ((z ** 2.0d0) / x)
    else if (z <= (-8.8d-18)) then
        tmp = t_0
    else if (z <= (-2.15d-24)) then
        tmp = (y * (z ** 2.0d0)) / x
    else if (z <= 1.15d+114) then
        tmp = t_0
    else
        tmp = (y / ((1.0d0 / z) * (x / z))) + (0.91893853320467d0 + ((-0.5d0) * log(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 + ((0.083333333333333 + (z * -0.0027777777777778)) / x));
	double tmp;
	if (z <= -7.6e+84) {
		tmp = y * (Math.pow(z, 2.0) / x);
	} else if (z <= -8.8e-18) {
		tmp = t_0;
	} else if (z <= -2.15e-24) {
		tmp = (y * Math.pow(z, 2.0)) / x;
	} else if (z <= 1.15e+114) {
		tmp = t_0;
	} else {
		tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * Math.log(x)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (((x + -0.5) * math.log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x))
	tmp = 0
	if z <= -7.6e+84:
		tmp = y * (math.pow(z, 2.0) / x)
	elif z <= -8.8e-18:
		tmp = t_0
	elif z <= -2.15e-24:
		tmp = (y * math.pow(z, 2.0)) / x
	elif z <= 1.15e+114:
		tmp = t_0
	else:
		tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * math.log(x)))
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(Float64(x + -0.5) * log(x)) - x) + Float64(0.91893853320467 + Float64(Float64(0.083333333333333 + Float64(z * -0.0027777777777778)) / x)))
	tmp = 0.0
	if (z <= -7.6e+84)
		tmp = Float64(y * Float64((z ^ 2.0) / x));
	elseif (z <= -8.8e-18)
		tmp = t_0;
	elseif (z <= -2.15e-24)
		tmp = Float64(Float64(y * (z ^ 2.0)) / x);
	elseif (z <= 1.15e+114)
		tmp = t_0;
	else
		tmp = Float64(Float64(y / Float64(Float64(1.0 / z) * Float64(x / z))) + Float64(0.91893853320467 + Float64(-0.5 * log(x))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (((x + -0.5) * log(x)) - x) + (0.91893853320467 + ((0.083333333333333 + (z * -0.0027777777777778)) / x));
	tmp = 0.0;
	if (z <= -7.6e+84)
		tmp = y * ((z ^ 2.0) / x);
	elseif (z <= -8.8e-18)
		tmp = t_0;
	elseif (z <= -2.15e-24)
		tmp = (y * (z ^ 2.0)) / x;
	elseif (z <= 1.15e+114)
		tmp = t_0;
	else
		tmp = (y / ((1.0 / z) * (x / z))) + (0.91893853320467 + (-0.5 * log(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] + N[(0.91893853320467 + N[(N[(0.083333333333333 + N[(z * -0.0027777777777778), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.6e+84], N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.8e-18], t$95$0, If[LessEqual[z, -2.15e-24], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 1.15e+114], t$95$0, N[(N[(y / N[(N[(1.0 / z), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.91893853320467 + N[(-0.5 * N[Log[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8.8 \cdot 10^{-18}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.6000000000000002e84

    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. Taylor expanded in y around inf 68.4%

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

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

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

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

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

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

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

    if -7.6000000000000002e84 < z < -8.7999999999999994e-18 or -2.1500000000000002e-24 < z < 1.15e114

    1. Initial program 97.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. Step-by-step derivation
      1. associate-+l+97.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.7999999999999994e-18 < z < -2.1500000000000002e-24

    1. Initial program 98.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 y around inf 99.4%

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

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

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

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

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

    if 1.15e114 < 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. Taylor expanded in y around inf 59.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.6 \cdot 10^{+84}:\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-18}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - x\right) + \left(0.91893853320467 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\right)\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\ \;\;\;\;\frac{y \cdot {z}^{2}}{x}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+114}:\\ \;\;\;\;\left(\left(x + -0.5\right) \cdot \log x - x\right) + \left(0.91893853320467 + \frac{0.083333333333333 + z \cdot -0.0027777777777778}{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{1}{z} \cdot \frac{x}{z}} + \left(0.91893853320467 + -0.5 \cdot \log x\right)\\ \end{array} \]

Alternative 8: 99.5% 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 6800000:\\ \;\;\;\;t_0 + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0 + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))))
   (if (<= x 6800000.0)
     (+
      t_0
      (/
       (+
        (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778))
        0.083333333333333)
       x))
     (+ t_0 (* (+ y 0.0007936500793651) (* z (/ z x)))))))
double code(double x, double y, double z) {
	double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double tmp;
	if (x <= 6800000.0) {
		tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    if (x <= 6800000.0d0) then
        tmp = t_0 + (((z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0)) + 0.083333333333333d0) / x)
    else
        tmp = t_0 + ((y + 0.0007936500793651d0) * (z * (z / x)))
    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 <= 6800000.0) {
		tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	} else {
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	tmp = 0
	if x <= 6800000.0:
		tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x)
	else:
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)))
	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 <= 6800000.0)
		tmp = Float64(t_0 + Float64(Float64(Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x));
	else
		tmp = Float64(t_0 + Float64(Float64(y + 0.0007936500793651) * Float64(z * Float64(z / x))));
	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 <= 6800000.0)
		tmp = t_0 + (((z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778)) + 0.083333333333333) / x);
	else
		tmp = t_0 + ((y + 0.0007936500793651) * (z * (z / x)));
	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, 6800000.0], N[(t$95$0 + N[(N[(N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(y + 0.0007936500793651), $MachinePrecision] * N[(z * N[(z / x), $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 6800000:\\
\;\;\;\;t_0 + \frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x}\\

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


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

    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 6.8e6 < x

    1. Initial program 89.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 89.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}} \]
    3. Step-by-step derivation
      1. associate-/l*92.6%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 6800000:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\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) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]

Alternative 9: 72.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y \cdot \frac{{z}^{2}}{x}\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+83}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\ \;\;\;\;\frac{y \cdot {z}^{2}}{x}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+121}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* y (/ (pow z 2.0) x))))
   (if (<= z -4.5e+83)
     t_0
     (if (<= z -6.6e-18)
       (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x))
       (if (<= z -2.15e-24)
         (/ (* y (pow z 2.0)) x)
         (if (<= z 2.2e+121)
           (+
            (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
            (/ 0.083333333333333 x))
           t_0))))))
double code(double x, double y, double z) {
	double t_0 = y * (pow(z, 2.0) / x);
	double tmp;
	if (z <= -4.5e+83) {
		tmp = t_0;
	} else if (z <= -6.6e-18) {
		tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	} else if (z <= -2.15e-24) {
		tmp = (y * pow(z, 2.0)) / x;
	} else if (z <= 2.2e+121) {
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (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 = y * ((z ** 2.0d0) / x)
    if (z <= (-4.5d+83)) then
        tmp = t_0
    else if (z <= (-6.6d-18)) then
        tmp = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
    else if (z <= (-2.15d-24)) then
        tmp = (y * (z ** 2.0d0)) / x
    else if (z <= 2.2d+121) then
        tmp = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + (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 = y * (Math.pow(z, 2.0) / x);
	double tmp;
	if (z <= -4.5e+83) {
		tmp = t_0;
	} else if (z <= -6.6e-18) {
		tmp = (x * (Math.log(x) + -1.0)) + (0.083333333333333 / x);
	} else if (z <= -2.15e-24) {
		tmp = (y * Math.pow(z, 2.0)) / x;
	} else if (z <= 2.2e+121) {
		tmp = (0.91893853320467 + ((Math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y * (math.pow(z, 2.0) / x)
	tmp = 0
	if z <= -4.5e+83:
		tmp = t_0
	elif z <= -6.6e-18:
		tmp = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
	elif z <= -2.15e-24:
		tmp = (y * math.pow(z, 2.0)) / x
	elif z <= 2.2e+121:
		tmp = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(y * Float64((z ^ 2.0) / x))
	tmp = 0.0
	if (z <= -4.5e+83)
		tmp = t_0;
	elseif (z <= -6.6e-18)
		tmp = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x));
	elseif (z <= -2.15e-24)
		tmp = Float64(Float64(y * (z ^ 2.0)) / x);
	elseif (z <= 2.2e+121)
		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(0.083333333333333 / x));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y * ((z ^ 2.0) / x);
	tmp = 0.0;
	if (z <= -4.5e+83)
		tmp = t_0;
	elseif (z <= -6.6e-18)
		tmp = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	elseif (z <= -2.15e-24)
		tmp = (y * (z ^ 2.0)) / x;
	elseif (z <= 2.2e+121)
		tmp = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + (0.083333333333333 / x);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+83], t$95$0, If[LessEqual[z, -6.6e-18], N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.15e-24], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 2.2e+121], 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], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y \cdot \frac{{z}^{2}}{x}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+83}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.4999999999999999e83 or 2.20000000000000001e121 < z

    1. Initial program 89.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. Taylor expanded in y around inf 65.3%

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

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

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

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

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

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

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

    if -4.4999999999999999e83 < z < -6.6000000000000003e-18

    1. Initial program 91.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 60.7%

      \[\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 60.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. sub-neg60.9%

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

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

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

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

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

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

    if -6.6000000000000003e-18 < z < -2.1500000000000002e-24

    1. Initial program 98.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 y around inf 99.4%

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

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

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

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

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

    if -2.1500000000000002e-24 < z < 2.20000000000000001e121

    1. Initial program 98.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 0 83.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+83}:\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\ \;\;\;\;\frac{y \cdot {z}^{2}}{x}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+121}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \end{array} \]

Alternative 10: 95.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.8 \cdot 10^{+185}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\


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

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

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

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

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

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

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

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

      \[\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 5.79999999999999976e185 < x

    1. Initial program 84.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. Taylor expanded in y around inf 83.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 5.8 \cdot 10^{+185}:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{y}{\frac{1}{z} \cdot \frac{x}{z}}\\ \end{array} \]

Alternative 11: 98.7% accurate, 1.0× speedup?

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

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

      \[\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 3.1e-4 < x

    1. Initial program 89.8%

      \[\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x} \]
    2. Taylor expanded in z around inf 88.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. associate-/l*92.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 0.00031:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right)\\ \end{array} \]

Alternative 12: 92.5% accurate, 1.0× speedup?

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

\\
\frac{z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right) + 0.083333333333333}{x} + x \cdot \left(\log x + -1\right)
\end{array}
Derivation
  1. Initial program 95.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 x around inf 93.7%

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

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

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

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

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

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

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

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

Alternative 13: 71.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ t_1 := y \cdot \frac{{z}^{2}}{x}\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+84}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\ \;\;\;\;\frac{y \cdot {z}^{2}}{x}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+120}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (* x (+ (log x) -1.0)) (/ 0.083333333333333 x)))
        (t_1 (* y (/ (pow z 2.0) x))))
   (if (<= z -7.2e+84)
     t_1
     (if (<= z -6.6e-18)
       t_0
       (if (<= z -2.15e-24)
         (/ (* y (pow z 2.0)) x)
         (if (<= z 8.5e+120) t_0 t_1))))))
double code(double x, double y, double z) {
	double t_0 = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	double t_1 = y * (pow(z, 2.0) / x);
	double tmp;
	if (z <= -7.2e+84) {
		tmp = t_1;
	} else if (z <= -6.6e-18) {
		tmp = t_0;
	} else if (z <= -2.15e-24) {
		tmp = (y * pow(z, 2.0)) / x;
	} else if (z <= 8.5e+120) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = (x * (log(x) + (-1.0d0))) + (0.083333333333333d0 / x)
    t_1 = y * ((z ** 2.0d0) / x)
    if (z <= (-7.2d+84)) then
        tmp = t_1
    else if (z <= (-6.6d-18)) then
        tmp = t_0
    else if (z <= (-2.15d-24)) then
        tmp = (y * (z ** 2.0d0)) / x
    else if (z <= 8.5d+120) then
        tmp = t_0
    else
        tmp = t_1
    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)) + (0.083333333333333 / x);
	double t_1 = y * (Math.pow(z, 2.0) / x);
	double tmp;
	if (z <= -7.2e+84) {
		tmp = t_1;
	} else if (z <= -6.6e-18) {
		tmp = t_0;
	} else if (z <= -2.15e-24) {
		tmp = (y * Math.pow(z, 2.0)) / x;
	} else if (z <= 8.5e+120) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x * (math.log(x) + -1.0)) + (0.083333333333333 / x)
	t_1 = y * (math.pow(z, 2.0) / x)
	tmp = 0
	if z <= -7.2e+84:
		tmp = t_1
	elif z <= -6.6e-18:
		tmp = t_0
	elif z <= -2.15e-24:
		tmp = (y * math.pow(z, 2.0)) / x
	elif z <= 8.5e+120:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x * Float64(log(x) + -1.0)) + Float64(0.083333333333333 / x))
	t_1 = Float64(y * Float64((z ^ 2.0) / x))
	tmp = 0.0
	if (z <= -7.2e+84)
		tmp = t_1;
	elseif (z <= -6.6e-18)
		tmp = t_0;
	elseif (z <= -2.15e-24)
		tmp = Float64(Float64(y * (z ^ 2.0)) / x);
	elseif (z <= 8.5e+120)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x * (log(x) + -1.0)) + (0.083333333333333 / x);
	t_1 = y * ((z ^ 2.0) / x);
	tmp = 0.0;
	if (z <= -7.2e+84)
		tmp = t_1;
	elseif (z <= -6.6e-18)
		tmp = t_0;
	elseif (z <= -2.15e-24)
		tmp = (y * (z ^ 2.0)) / x;
	elseif (z <= 8.5e+120)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[(N[Log[x], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(N[Power[z, 2.0], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+84], t$95$1, If[LessEqual[z, -6.6e-18], t$95$0, If[LessEqual[z, -2.15e-24], N[(N[(y * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[z, 8.5e+120], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\
t_1 := y \cdot \frac{{z}^{2}}{x}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+84}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\
\;\;\;\;\frac{y \cdot {z}^{2}}{x}\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+120}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.1999999999999999e84 or 8.50000000000000026e120 < z

    1. Initial program 89.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. Taylor expanded in y around inf 65.3%

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

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

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

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

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

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

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

    if -7.1999999999999999e84 < z < -6.6000000000000003e-18 or -2.1500000000000002e-24 < z < 8.50000000000000026e120

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

      \[\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 78.6%

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

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

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

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

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

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

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

    if -6.6000000000000003e-18 < z < -2.1500000000000002e-24

    1. Initial program 98.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 y around inf 99.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+84}:\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-18}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-24}:\\ \;\;\;\;\frac{y \cdot {z}^{2}}{x}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+120}:\\ \;\;\;\;x \cdot \left(\log x + -1\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \end{array} \]

Alternative 14: 48.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{-86} \lor \neg \left(z \leq 2.25 \cdot 10^{-12}\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.05e-86) (not (<= z 2.25e-12)))
   (* y (/ (pow z 2.0) x))
   (/ 0.083333333333333 x)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -2.05e-86) || !(z <= 2.25e-12)) {
		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.05d-86)) .or. (.not. (z <= 2.25d-12))) 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.05e-86) || !(z <= 2.25e-12)) {
		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.05e-86) or not (z <= 2.25e-12):
		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.05e-86) || !(z <= 2.25e-12))
		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.05e-86) || ~((z <= 2.25e-12)))
		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.05e-86], N[Not[LessEqual[z, 2.25e-12]], $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.05 \cdot 10^{-86} \lor \neg \left(z \leq 2.25 \cdot 10^{-12}\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.0499999999999999e-86 or 2.2499999999999999e-12 < z

    1. Initial program 92.3%

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

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

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

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

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

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

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

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

    if -2.0499999999999999e-86 < z < 2.2499999999999999e-12

    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. Taylor expanded in z around 0 98.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 95.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{-86} \lor \neg \left(z \leq 2.25 \cdot 10^{-12}\right):\\ \;\;\;\;y \cdot \frac{{z}^{2}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.083333333333333}{x}\\ \end{array} \]

Alternative 15: 23.2% accurate, 41.0× speedup?

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

\\
\frac{0.083333333333333}{x}
\end{array}
Derivation
  1. Initial program 95.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.8%

    \[\leadsto \left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \color{blue}{\frac{0.083333333333333}{x}} \]
  3. Taylor expanded in x around inf 54.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. sub-neg54.5%

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

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

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

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

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

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

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

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

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