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

Percentage Accurate: 94.1% → 99.4%
Time: 14.7s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 94.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 99.7%

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x}} \]
      2. clear-numN/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{1}{\frac{x}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}}} \]
      3. lower-/.f64N/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{1}{\frac{x}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}}} \]
      4. lower-/.f6499.7

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\color{blue}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}}} \]
      6. lift-*.f64N/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\color{blue}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z} + \frac{83333333333333}{1000000000000000}}} \]
      7. *-commutativeN/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\color{blue}{z \cdot \left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right)} + \frac{83333333333333}{1000000000000000}}} \]
      8. lower-fma.f6499.7

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}} \]
      10. sub-negN/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}} \]
      11. lift-*.f64N/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      12. lower-fma.f64N/A

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}} \]
      13. metadata-eval99.7

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

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

      \[\leadsto \color{blue}{\left(\frac{91893853320467}{100000000000000} + \frac{-1}{2} \cdot \log x\right)} + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000}\right)} + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      2. remove-double-negN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log x\right)\right)\right)\right)} + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      3. log-recN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \left(\mathsf{neg}\left(\color{blue}{\log \left(\frac{1}{x}\right)}\right)\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      4. mul-1-negN/A

        \[\leadsto \left(\frac{-1}{2} \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      5. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, -1 \cdot \log \left(\frac{1}{x}\right), \frac{91893853320467}{100000000000000}\right)} + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)}, \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      7. log-recN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right), \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      8. remove-double-negN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\log x}, \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \frac{-13888888888889}{5000000000000000}\right), \frac{83333333333333}{1000000000000000}\right)}} \]
      9. lower-log.f6499.7

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

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

    if 1.90000000000000001e-48 < x

    1. Initial program 90.9%

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

      \[\leadsto \color{blue}{\left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \left(z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) - \frac{13888888888889}{5000000000000000} \cdot \frac{1}{x}\right) + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right)\right) - x} \]
    4. Applied rewrites99.7%

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

Alternative 2: 87.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\\ t_1 := t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+44}:\\ \;\;\;\;z \cdot \frac{z \cdot y}{x}\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;t\_0 + \frac{1}{x \cdot 12.000000000000048}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot \left(z \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x)))
        (t_1
         (+
          t_0
          (/
           (+
            0.083333333333333
            (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
           x))))
   (if (<= t_1 -2e+44)
     (* z (/ (* z y) x))
     (if (<= t_1 5e+306)
       (+ t_0 (/ 1.0 (* x 12.000000000000048)))
       (* (+ (/ y x) (/ 0.0007936500793651 x)) (* z z))))))
double code(double x, double y, double z) {
	double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	double t_1 = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	double tmp;
	if (t_1 <= -2e+44) {
		tmp = z * ((z * y) / x);
	} else if (t_1 <= 5e+306) {
		tmp = t_0 + (1.0 / (x * 12.000000000000048));
	} else {
		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * 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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)
    t_1 = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
    if (t_1 <= (-2d+44)) then
        tmp = z * ((z * y) / x)
    else if (t_1 <= 5d+306) then
        tmp = t_0 + (1.0d0 / (x * 12.000000000000048d0))
    else
        tmp = ((y / x) + (0.0007936500793651d0 / x)) * (z * z)
    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 t_1 = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	double tmp;
	if (t_1 <= -2e+44) {
		tmp = z * ((z * y) / x);
	} else if (t_1 <= 5e+306) {
		tmp = t_0 + (1.0 / (x * 12.000000000000048));
	} else {
		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
	t_1 = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)
	tmp = 0
	if t_1 <= -2e+44:
		tmp = z * ((z * y) / x)
	elif t_1 <= 5e+306:
		tmp = t_0 + (1.0 / (x * 12.000000000000048))
	else:
		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z)
	return tmp
function code(x, y, z)
	t_0 = Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x))
	t_1 = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x))
	tmp = 0.0
	if (t_1 <= -2e+44)
		tmp = Float64(z * Float64(Float64(z * y) / x));
	elseif (t_1 <= 5e+306)
		tmp = Float64(t_0 + Float64(1.0 / Float64(x * 12.000000000000048)));
	else
		tmp = Float64(Float64(Float64(y / x) + Float64(0.0007936500793651 / x)) * Float64(z * z));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
	t_1 = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
	tmp = 0.0;
	if (t_1 <= -2e+44)
		tmp = z * ((z * y) / x);
	elseif (t_1 <= 5e+306)
		tmp = t_0 + (1.0 / (x * 12.000000000000048));
	else
		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z);
	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]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+44], N[(z * N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+306], N[(t$95$0 + N[(1.0 / N[(x * 12.000000000000048), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+306}:\\
\;\;\;\;t\_0 + \frac{1}{x \cdot 12.000000000000048}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -2.0000000000000002e44

    1. Initial program 90.8%

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

      \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
      3. unpow2N/A

        \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
      5. *-commutativeN/A

        \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
      7. *-commutativeN/A

        \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
      8. lower-*.f6490.7

        \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
    5. Applied rewrites90.7%

      \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
    6. Step-by-step derivation
      1. Applied rewrites94.5%

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

      if -2.0000000000000002e44 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.99999999999999993e306

      1. Initial program 99.5%

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

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x}} \]
        2. clear-numN/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{1}{\frac{x}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}}} \]
        3. lower-/.f64N/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{\frac{1}{\frac{x}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}}} \]
        4. lower-/.f6499.5

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

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\color{blue}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}}} \]
        6. lift-*.f64N/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\color{blue}{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z} + \frac{83333333333333}{1000000000000000}}} \]
        7. *-commutativeN/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\color{blue}{z \cdot \left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right)} + \frac{83333333333333}{1000000000000000}}} \]
        8. lower-fma.f6499.5

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

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}} \]
        10. sub-negN/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}} \]
        11. lift-*.f64N/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z} + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right), \frac{83333333333333}{1000000000000000}\right)}} \]
        12. lower-fma.f64N/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\frac{x}{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(y + \frac{7936500793651}{10000000000000000}, z, \mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}} \]
        13. metadata-eval99.5

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

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

        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\color{blue}{\frac{1000000000000000}{83333333333333} \cdot x}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{1}{\color{blue}{x \cdot \frac{1000000000000000}{83333333333333}}} \]
        2. lower-*.f6488.4

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

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

      if 4.99999999999999993e306 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

      1. Initial program 83.6%

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

        \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot {z}^{2}} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot {z}^{2}} \]
        3. lower-+.f64N/A

          \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \cdot {z}^{2} \]
        4. associate-*r/N/A

          \[\leadsto \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot 1}{x}} + \frac{y}{x}\right) \cdot {z}^{2} \]
        5. metadata-evalN/A

          \[\leadsto \left(\frac{\color{blue}{\frac{7936500793651}{10000000000000000}}}{x} + \frac{y}{x}\right) \cdot {z}^{2} \]
        6. lower-/.f64N/A

          \[\leadsto \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \cdot {z}^{2} \]
        7. lower-/.f64N/A

          \[\leadsto \left(\frac{\frac{7936500793651}{10000000000000000}}{x} + \color{blue}{\frac{y}{x}}\right) \cdot {z}^{2} \]
        8. unpow2N/A

          \[\leadsto \left(\frac{\frac{7936500793651}{10000000000000000}}{x} + \frac{y}{x}\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
        9. lower-*.f6486.2

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

        \[\leadsto \color{blue}{\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification88.6%

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

    Alternative 3: 87.5% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+44}:\\ \;\;\;\;z \cdot \frac{z \cdot y}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x} - x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot \left(z \cdot z\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0
             (+
              (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
              (/
               (+
                0.083333333333333
                (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
               x))))
       (if (<= t_0 -2e+44)
         (* z (/ (* z y) x))
         (if (<= t_0 5e+306)
           (+
            0.91893853320467
            (fma (log x) (+ x -0.5) (- (/ 0.083333333333333 x) x)))
           (* (+ (/ y x) (/ 0.0007936500793651 x)) (* z z))))))
    double code(double x, double y, double z) {
    	double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
    	double tmp;
    	if (t_0 <= -2e+44) {
    		tmp = z * ((z * y) / x);
    	} else if (t_0 <= 5e+306) {
    		tmp = 0.91893853320467 + fma(log(x), (x + -0.5), ((0.083333333333333 / x) - x));
    	} else {
    		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z);
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x))
    	tmp = 0.0
    	if (t_0 <= -2e+44)
    		tmp = Float64(z * Float64(Float64(z * y) / x));
    	elseif (t_0 <= 5e+306)
    		tmp = Float64(0.91893853320467 + fma(log(x), Float64(x + -0.5), Float64(Float64(0.083333333333333 / x) - x)));
    	else
    		tmp = Float64(Float64(Float64(y / x) + Float64(0.0007936500793651 / x)) * Float64(z * z));
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+44], N[(z * N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(0.91893853320467 + N[(N[Log[x], $MachinePrecision] * N[(x + -0.5), $MachinePrecision] + N[(N[(0.083333333333333 / x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
    \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+44}:\\
    \;\;\;\;z \cdot \frac{z \cdot y}{x}\\
    
    \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
    \;\;\;\;0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \frac{0.083333333333333}{x} - x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot \left(z \cdot z\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -2.0000000000000002e44

      1. Initial program 90.8%

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

        \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
        2. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
        3. unpow2N/A

          \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
        4. associate-*l*N/A

          \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
        5. *-commutativeN/A

          \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
        7. *-commutativeN/A

          \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
        8. lower-*.f6490.7

          \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
      5. Applied rewrites90.7%

        \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
      6. Step-by-step derivation
        1. Applied rewrites94.5%

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

        if -2.0000000000000002e44 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.99999999999999993e306

        1. Initial program 99.5%

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

          \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
          2. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
          3. unpow2N/A

            \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
          4. associate-*l*N/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
          5. *-commutativeN/A

            \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
          7. *-commutativeN/A

            \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
          8. lower-*.f645.1

            \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
        5. Applied rewrites5.1%

          \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
        6. Step-by-step derivation
          1. Applied rewrites4.7%

            \[\leadsto \left(z \cdot z\right) \cdot \color{blue}{\frac{y}{x}} \]
          2. Taylor expanded in z around 0

            \[\leadsto \color{blue}{\left(\frac{91893853320467}{100000000000000} + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right)\right) - x} \]
          3. Step-by-step derivation
            1. associate--l+N/A

              \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000} + \left(\left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right) - x\right)} \]
            2. lower-+.f64N/A

              \[\leadsto \color{blue}{\frac{91893853320467}{100000000000000} + \left(\left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} + \log x \cdot \left(x - \frac{1}{2}\right)\right) - x\right)} \]
            3. +-commutativeN/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \left(\color{blue}{\left(\log x \cdot \left(x - \frac{1}{2}\right) + \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x}\right)} - x\right) \]
            4. associate--l+N/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\left(\log x \cdot \left(x - \frac{1}{2}\right) + \left(\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right)\right)} \]
            5. lower-fma.f64N/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \color{blue}{\mathsf{fma}\left(\log x, x - \frac{1}{2}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right)} \]
            6. lower-log.f64N/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\color{blue}{\log x}, x - \frac{1}{2}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right) \]
            7. sub-negN/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\log x, \color{blue}{x + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right) \]
            8. metadata-evalN/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\log x, x + \color{blue}{\frac{-1}{2}}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right) \]
            9. lower-+.f64N/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\log x, \color{blue}{x + \frac{-1}{2}}, \frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x\right) \]
            10. lower--.f64N/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\log x, x + \frac{-1}{2}, \color{blue}{\frac{83333333333333}{1000000000000000} \cdot \frac{1}{x} - x}\right) \]
            11. associate-*r/N/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\log x, x + \frac{-1}{2}, \color{blue}{\frac{\frac{83333333333333}{1000000000000000} \cdot 1}{x}} - x\right) \]
            12. metadata-evalN/A

              \[\leadsto \frac{91893853320467}{100000000000000} + \mathsf{fma}\left(\log x, x + \frac{-1}{2}, \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} - x\right) \]
            13. lower-/.f6488.4

              \[\leadsto 0.91893853320467 + \mathsf{fma}\left(\log x, x + -0.5, \color{blue}{\frac{0.083333333333333}{x}} - x\right) \]
          4. Applied rewrites88.4%

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

          if 4.99999999999999993e306 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

          1. Initial program 83.6%

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

            \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot {z}^{2}} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot {z}^{2}} \]
            3. lower-+.f64N/A

              \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \cdot {z}^{2} \]
            4. associate-*r/N/A

              \[\leadsto \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot 1}{x}} + \frac{y}{x}\right) \cdot {z}^{2} \]
            5. metadata-evalN/A

              \[\leadsto \left(\frac{\color{blue}{\frac{7936500793651}{10000000000000000}}}{x} + \frac{y}{x}\right) \cdot {z}^{2} \]
            6. lower-/.f64N/A

              \[\leadsto \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \cdot {z}^{2} \]
            7. lower-/.f64N/A

              \[\leadsto \left(\frac{\frac{7936500793651}{10000000000000000}}{x} + \color{blue}{\frac{y}{x}}\right) \cdot {z}^{2} \]
            8. unpow2N/A

              \[\leadsto \left(\frac{\frac{7936500793651}{10000000000000000}}{x} + \frac{y}{x}\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
            9. lower-*.f6486.2

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

            \[\leadsto \color{blue}{\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)} \]
        7. Recombined 3 regimes into one program.
        8. Final simplification88.6%

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

        Alternative 4: 86.4% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+44}:\\ \;\;\;\;z \cdot \frac{z \cdot y}{x}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\ \;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot \left(z \cdot z\right)\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0
                 (+
                  (+ 0.91893853320467 (- (* (log x) (- x 0.5)) x))
                  (/
                   (+
                    0.083333333333333
                    (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
                   x))))
           (if (<= t_0 -2e+44)
             (* z (/ (* z y) x))
             (if (<= t_0 5e+306)
               (+ (+ 0.91893853320467 (- (* x (log x)) x)) (/ 0.083333333333333 x))
               (* (+ (/ y x) (/ 0.0007936500793651 x)) (* z z))))))
        double code(double x, double y, double z) {
        	double t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
        	double tmp;
        	if (t_0 <= -2e+44) {
        		tmp = z * ((z * y) / x);
        	} else if (t_0 <= 5e+306) {
        		tmp = (0.91893853320467 + ((x * log(x)) - x)) + (0.083333333333333 / x);
        	} else {
        		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * 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) :: t_0
            real(8) :: tmp
            t_0 = (0.91893853320467d0 + ((log(x) * (x - 0.5d0)) - x)) + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
            if (t_0 <= (-2d+44)) then
                tmp = z * ((z * y) / x)
            else if (t_0 <= 5d+306) then
                tmp = (0.91893853320467d0 + ((x * log(x)) - x)) + (0.083333333333333d0 / x)
            else
                tmp = ((y / x) + (0.0007936500793651d0 / x)) * (z * z)
            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)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
        	double tmp;
        	if (t_0 <= -2e+44) {
        		tmp = z * ((z * y) / x);
        	} else if (t_0 <= 5e+306) {
        		tmp = (0.91893853320467 + ((x * Math.log(x)) - x)) + (0.083333333333333 / x);
        	} else {
        		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z);
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	t_0 = (0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)
        	tmp = 0
        	if t_0 <= -2e+44:
        		tmp = z * ((z * y) / x)
        	elif t_0 <= 5e+306:
        		tmp = (0.91893853320467 + ((x * math.log(x)) - x)) + (0.083333333333333 / x)
        	else:
        		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z)
        	return tmp
        
        function code(x, y, z)
        	t_0 = Float64(Float64(0.91893853320467 + Float64(Float64(log(x) * Float64(x - 0.5)) - x)) + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x))
        	tmp = 0.0
        	if (t_0 <= -2e+44)
        		tmp = Float64(z * Float64(Float64(z * y) / x));
        	elseif (t_0 <= 5e+306)
        		tmp = Float64(Float64(0.91893853320467 + Float64(Float64(x * log(x)) - x)) + Float64(0.083333333333333 / x));
        	else
        		tmp = Float64(Float64(Float64(y / x) + Float64(0.0007936500793651 / x)) * Float64(z * z));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	t_0 = (0.91893853320467 + ((log(x) * (x - 0.5)) - x)) + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
        	tmp = 0.0;
        	if (t_0 <= -2e+44)
        		tmp = z * ((z * y) / x);
        	elseif (t_0 <= 5e+306)
        		tmp = (0.91893853320467 + ((x * log(x)) - x)) + (0.083333333333333 / x);
        	else
        		tmp = ((y / x) + (0.0007936500793651 / x)) * (z * z);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[(0.91893853320467 + N[(N[(N[Log[x], $MachinePrecision] * N[(x - 0.5), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+44], N[(z * N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+306], N[(N[(0.91893853320467 + N[(N[(x * N[Log[x], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] + N[(0.083333333333333 / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / x), $MachinePrecision] + N[(0.0007936500793651 / x), $MachinePrecision]), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left(0.91893853320467 + \left(\log x \cdot \left(x - 0.5\right) - x\right)\right) + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+44}:\\
        \;\;\;\;z \cdot \frac{z \cdot y}{x}\\
        
        \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+306}:\\
        \;\;\;\;\left(0.91893853320467 + \left(x \cdot \log x - x\right)\right) + \frac{0.083333333333333}{x}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\frac{y}{x} + \frac{0.0007936500793651}{x}\right) \cdot \left(z \cdot z\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < -2.0000000000000002e44

          1. Initial program 90.8%

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

            \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
            2. *-commutativeN/A

              \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
            3. unpow2N/A

              \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
            4. associate-*l*N/A

              \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
            5. *-commutativeN/A

              \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
            7. *-commutativeN/A

              \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
            8. lower-*.f6490.7

              \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
          5. Applied rewrites90.7%

            \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
          6. Step-by-step derivation
            1. Applied rewrites94.5%

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

            if -2.0000000000000002e44 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x)) < 4.99999999999999993e306

            1. Initial program 99.5%

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

              \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\color{blue}{\frac{83333333333333}{1000000000000000}}}{x} \]
            4. Step-by-step derivation
              1. Applied rewrites88.4%

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

                \[\leadsto \left(\left(\color{blue}{-1 \cdot \left(x \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
              3. Step-by-step derivation
                1. mul-1-negN/A

                  \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(x \cdot \log \left(\frac{1}{x}\right)\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                2. distribute-rgt-neg-inN/A

                  \[\leadsto \left(\left(\color{blue}{x \cdot \left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                3. mul-1-negN/A

                  \[\leadsto \left(\left(x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                4. lower-*.f64N/A

                  \[\leadsto \left(\left(\color{blue}{x \cdot \left(-1 \cdot \log \left(\frac{1}{x}\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                5. mul-1-negN/A

                  \[\leadsto \left(\left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                6. log-recN/A

                  \[\leadsto \left(\left(x \cdot \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right) - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                7. remove-double-negN/A

                  \[\leadsto \left(\left(x \cdot \color{blue}{\log x} - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{\frac{83333333333333}{1000000000000000}}{x} \]
                8. lower-log.f6486.9

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

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

              if 4.99999999999999993e306 < (+.f64 (+.f64 (-.f64 (*.f64 (-.f64 x #s(literal 1/2 binary64)) (log.f64 x)) x) #s(literal 91893853320467/100000000000000 binary64)) (/.f64 (+.f64 (*.f64 (-.f64 (*.f64 (+.f64 y #s(literal 7936500793651/10000000000000000 binary64)) z) #s(literal 13888888888889/5000000000000000 binary64)) z) #s(literal 83333333333333/1000000000000000 binary64)) x))

              1. Initial program 83.6%

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

                \[\leadsto \color{blue}{{z}^{2} \cdot \left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot {z}^{2}} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right) \cdot {z}^{2}} \]
                3. lower-+.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{7936500793651}{10000000000000000} \cdot \frac{1}{x} + \frac{y}{x}\right)} \cdot {z}^{2} \]
                4. associate-*r/N/A

                  \[\leadsto \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000} \cdot 1}{x}} + \frac{y}{x}\right) \cdot {z}^{2} \]
                5. metadata-evalN/A

                  \[\leadsto \left(\frac{\color{blue}{\frac{7936500793651}{10000000000000000}}}{x} + \frac{y}{x}\right) \cdot {z}^{2} \]
                6. lower-/.f64N/A

                  \[\leadsto \left(\color{blue}{\frac{\frac{7936500793651}{10000000000000000}}{x}} + \frac{y}{x}\right) \cdot {z}^{2} \]
                7. lower-/.f64N/A

                  \[\leadsto \left(\frac{\frac{7936500793651}{10000000000000000}}{x} + \color{blue}{\frac{y}{x}}\right) \cdot {z}^{2} \]
                8. unpow2N/A

                  \[\leadsto \left(\frac{\frac{7936500793651}{10000000000000000}}{x} + \frac{y}{x}\right) \cdot \color{blue}{\left(z \cdot z\right)} \]
                9. lower-*.f6486.2

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

                \[\leadsto \color{blue}{\left(\frac{0.0007936500793651}{x} + \frac{y}{x}\right) \cdot \left(z \cdot z\right)} \]
            5. Recombined 3 regimes into one program.
            6. Final simplification87.6%

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

            Alternative 5: 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 430:\\ \;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{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 430.0)
                 (+
                  t_0
                  (/
                   (+
                    0.083333333333333
                    (* z (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
                   x))
                 (+ t_0 (* z (* z (/ (+ y 0.0007936500793651) x)))))))
            double code(double x, double y, double z) {
            	double t_0 = 0.91893853320467 + ((log(x) * (x - 0.5)) - x);
            	double tmp;
            	if (x <= 430.0) {
            		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
            	} else {
            		tmp = t_0 + (z * (z * ((y + 0.0007936500793651) / 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 <= 430.0d0) then
                    tmp = t_0 + ((0.083333333333333d0 + (z * ((z * (y + 0.0007936500793651d0)) - 0.0027777777777778d0))) / x)
                else
                    tmp = t_0 + (z * (z * ((y + 0.0007936500793651d0) / 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 <= 430.0) {
            		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
            	} else {
            		tmp = t_0 + (z * (z * ((y + 0.0007936500793651) / x)));
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	t_0 = 0.91893853320467 + ((math.log(x) * (x - 0.5)) - x)
            	tmp = 0
            	if x <= 430.0:
            		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x)
            	else:
            		tmp = t_0 + (z * (z * ((y + 0.0007936500793651) / 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 <= 430.0)
            		tmp = Float64(t_0 + Float64(Float64(0.083333333333333 + Float64(z * Float64(Float64(z * Float64(y + 0.0007936500793651)) - 0.0027777777777778))) / x));
            	else
            		tmp = Float64(t_0 + Float64(z * Float64(z * Float64(Float64(y + 0.0007936500793651) / 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 <= 430.0)
            		tmp = t_0 + ((0.083333333333333 + (z * ((z * (y + 0.0007936500793651)) - 0.0027777777777778))) / x);
            	else
            		tmp = t_0 + (z * (z * ((y + 0.0007936500793651) / 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, 430.0], N[(t$95$0 + N[(N[(0.083333333333333 + N[(z * N[(N[(z * N[(y + 0.0007936500793651), $MachinePrecision]), $MachinePrecision] - 0.0027777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(z * N[(z * N[(N[(y + 0.0007936500793651), $MachinePrecision] / 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 430:\\
            \;\;\;\;t\_0 + \frac{0.083333333333333 + z \cdot \left(z \cdot \left(y + 0.0007936500793651\right) - 0.0027777777777778\right)}{x}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0 + z \cdot \left(z \cdot \frac{y + 0.0007936500793651}{x}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < 430

              1. Initial program 99.7%

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

              if 430 < x

              1. Initial program 89.6%

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

                \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{y \cdot \left(\frac{\frac{83333333333333}{1000000000000000}}{x \cdot y} + \left(\frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x \cdot y} + \frac{{z}^{2}}{x}\right)\right)} \]
              4. Applied rewrites92.9%

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

                \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \mathsf{fma}\left(y, \frac{{z}^{2}}{\color{blue}{x}}, \frac{\frac{83333333333333}{1000000000000000}}{x}\right) \]
              6. Step-by-step derivation
                1. Applied rewrites86.0%

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

                  \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{y \cdot \left({z}^{2} \cdot \left(1 + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{y}\right)\right)}{\color{blue}{x}} \]
                3. Step-by-step derivation
                  1. Applied rewrites99.6%

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

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

                Alternative 6: 99.6% accurate, 1.0× speedup?

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

                  1. Initial program 99.7%

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

                    \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + \left(x \cdot \left(\frac{91893853320467}{100000000000000} + \left(\frac{-1}{2} \cdot \log x + x \cdot \left(\log x - 1\right)\right)\right) + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)\right)}{x}} \]
                  4. Applied rewrites99.7%

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

                  if 3e15 < x

                  1. Initial program 89.2%

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

                    \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{y \cdot \left(\frac{\frac{83333333333333}{1000000000000000}}{x \cdot y} + \left(\frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x \cdot y} + \frac{{z}^{2}}{x}\right)\right)} \]
                  4. Applied rewrites92.6%

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

                    \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \mathsf{fma}\left(y, \frac{{z}^{2}}{\color{blue}{x}}, \frac{\frac{83333333333333}{1000000000000000}}{x}\right) \]
                  6. Step-by-step derivation
                    1. Applied rewrites86.9%

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

                      \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{y \cdot \left({z}^{2} \cdot \left(1 + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{y}\right)\right)}{\color{blue}{x}} \]
                    3. Step-by-step derivation
                      1. Applied rewrites99.6%

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

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

                    Alternative 7: 99.1% accurate, 1.0× speedup?

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

                      1. Initial program 99.7%

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

                        \[\leadsto \color{blue}{\left(\frac{91893853320467}{100000000000000} + \frac{-1}{2} \cdot \log x\right)} + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \log x + \frac{91893853320467}{100000000000000}\right)} + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        2. *-commutativeN/A

                          \[\leadsto \left(\color{blue}{\log x \cdot \frac{-1}{2}} + \frac{91893853320467}{100000000000000}\right) + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        3. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\log x, \frac{-1}{2}, \frac{91893853320467}{100000000000000}\right)} + \frac{\left(\left(y + \frac{7936500793651}{10000000000000000}\right) \cdot z - \frac{13888888888889}{5000000000000000}\right) \cdot z + \frac{83333333333333}{1000000000000000}}{x} \]
                        4. lower-log.f6499.7

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

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

                      if 1.9999999999999999e-7 < x

                      1. Initial program 90.1%

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

                        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \color{blue}{y \cdot \left(\frac{\frac{83333333333333}{1000000000000000}}{x \cdot y} + \left(\frac{z \cdot \left(\frac{7936500793651}{10000000000000000} \cdot z - \frac{13888888888889}{5000000000000000}\right)}{x \cdot y} + \frac{{z}^{2}}{x}\right)\right)} \]
                      4. Applied rewrites93.2%

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

                        \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \mathsf{fma}\left(y, \frac{{z}^{2}}{\color{blue}{x}}, \frac{\frac{83333333333333}{1000000000000000}}{x}\right) \]
                      6. Step-by-step derivation
                        1. Applied rewrites85.2%

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

                          \[\leadsto \left(\left(\left(x - \frac{1}{2}\right) \cdot \log x - x\right) + \frac{91893853320467}{100000000000000}\right) + \frac{y \cdot \left({z}^{2} \cdot \left(1 + \frac{7936500793651}{10000000000000000} \cdot \frac{1}{y}\right)\right)}{\color{blue}{x}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites98.7%

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

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

                        Alternative 8: 84.1% accurate, 1.3× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 2.8 \cdot 10^{+38}:\\ \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, \log x, -x\right)\\ \end{array} \end{array} \]
                        (FPCore (x y z)
                         :precision binary64
                         (if (<= x 2.8e+38)
                           (/
                            (fma
                             z
                             (fma z (+ y 0.0007936500793651) -0.0027777777777778)
                             0.083333333333333)
                            x)
                           (fma x (log x) (- x))))
                        double code(double x, double y, double z) {
                        	double tmp;
                        	if (x <= 2.8e+38) {
                        		tmp = fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
                        	} else {
                        		tmp = fma(x, log(x), -x);
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z)
                        	tmp = 0.0
                        	if (x <= 2.8e+38)
                        		tmp = Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x);
                        	else
                        		tmp = fma(x, log(x), Float64(-x));
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_] := If[LessEqual[x, 2.8e+38], N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision], N[(x * N[Log[x], $MachinePrecision] + (-x)), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq 2.8 \cdot 10^{+38}:\\
                        \;\;\;\;\frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(x, \log x, -x\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < 2.8e38

                          1. Initial program 99.7%

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

                            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
                            2. +-commutativeN/A

                              \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
                            3. lower-fma.f64N/A

                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
                            4. sub-negN/A

                              \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                            5. metadata-evalN/A

                              \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                            6. lower-fma.f64N/A

                              \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} + y, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                            7. lower-+.f6494.3

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

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

                          if 2.8e38 < x

                          1. Initial program 87.7%

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

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

                              \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \log \left(\frac{1}{x}\right) + \left(\mathsf{neg}\left(1\right)\right)\right)} \]
                            2. mul-1-negN/A

                              \[\leadsto x \cdot \left(\color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{x}\right)\right)\right)} + \left(\mathsf{neg}\left(1\right)\right)\right) \]
                            3. log-recN/A

                              \[\leadsto x \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\log x\right)\right)}\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right) \]
                            4. remove-double-negN/A

                              \[\leadsto x \cdot \left(\color{blue}{\log x} + \left(\mathsf{neg}\left(1\right)\right)\right) \]
                            5. metadata-evalN/A

                              \[\leadsto x \cdot \left(\log x + \color{blue}{-1}\right) \]
                            6. distribute-lft-inN/A

                              \[\leadsto \color{blue}{x \cdot \log x + x \cdot -1} \]
                            7. *-commutativeN/A

                              \[\leadsto x \cdot \log x + \color{blue}{-1 \cdot x} \]
                            8. neg-mul-1N/A

                              \[\leadsto x \cdot \log x + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                            9. lower-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log x, \mathsf{neg}\left(x\right)\right)} \]
                            10. lower-log.f64N/A

                              \[\leadsto \mathsf{fma}\left(x, \color{blue}{\log x}, \mathsf{neg}\left(x\right)\right) \]
                            11. lower-neg.f6475.0

                              \[\leadsto \mathsf{fma}\left(x, \log x, \color{blue}{-x}\right) \]
                          5. Applied rewrites75.0%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(x, \log x, -x\right)} \]
                        3. Recombined 2 regimes into one program.
                        4. Final simplification85.6%

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

                        Alternative 9: 63.7% accurate, 5.5× speedup?

                        \[\begin{array}{l} \\ \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x} \end{array} \]
                        (FPCore (x y z)
                         :precision binary64
                         (/
                          (fma
                           z
                           (fma z (+ y 0.0007936500793651) -0.0027777777777778)
                           0.083333333333333)
                          x))
                        double code(double x, double y, double z) {
                        	return fma(z, fma(z, (y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x;
                        }
                        
                        function code(x, y, z)
                        	return Float64(fma(z, fma(z, Float64(y + 0.0007936500793651), -0.0027777777777778), 0.083333333333333) / x)
                        end
                        
                        code[x_, y_, z_] := N[(N[(z * N[(z * N[(y + 0.0007936500793651), $MachinePrecision] + -0.0027777777777778), $MachinePrecision] + 0.083333333333333), $MachinePrecision] / x), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x}
                        \end{array}
                        
                        Derivation
                        1. Initial program 94.3%

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

                          \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{83333333333333}{1000000000000000} + z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right)}{x}} \]
                          2. +-commutativeN/A

                            \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}\right) + \frac{83333333333333}{1000000000000000}}}{x} \]
                          3. lower-fma.f64N/A

                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) - \frac{13888888888889}{5000000000000000}, \frac{83333333333333}{1000000000000000}\right)}}{x} \]
                          4. sub-negN/A

                            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \left(\mathsf{neg}\left(\frac{13888888888889}{5000000000000000}\right)\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                          5. metadata-evalN/A

                            \[\leadsto \frac{\mathsf{fma}\left(z, z \cdot \left(\frac{7936500793651}{10000000000000000} + y\right) + \color{blue}{\frac{-13888888888889}{5000000000000000}}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                          6. lower-fma.f64N/A

                            \[\leadsto \frac{\mathsf{fma}\left(z, \color{blue}{\mathsf{fma}\left(z, \frac{7936500793651}{10000000000000000} + y, \frac{-13888888888889}{5000000000000000}\right)}, \frac{83333333333333}{1000000000000000}\right)}{x} \]
                          7. lower-+.f6461.7

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

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

                          \[\leadsto \frac{\mathsf{fma}\left(z, \mathsf{fma}\left(z, y + 0.0007936500793651, -0.0027777777777778\right), 0.083333333333333\right)}{x} \]
                        7. Add Preprocessing

                        Alternative 10: 33.1% accurate, 6.7× speedup?

                        \[\begin{array}{l} \\ y \cdot \frac{z \cdot z}{x} \end{array} \]
                        (FPCore (x y z) :precision binary64 (* y (/ (* z z) x)))
                        double code(double x, double y, double z) {
                        	return y * ((z * z) / x);
                        }
                        
                        real(8) function code(x, y, z)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            code = y * ((z * z) / x)
                        end function
                        
                        public static double code(double x, double y, double z) {
                        	return y * ((z * z) / x);
                        }
                        
                        def code(x, y, z):
                        	return y * ((z * z) / x)
                        
                        function code(x, y, z)
                        	return Float64(y * Float64(Float64(z * z) / x))
                        end
                        
                        function tmp = code(x, y, z)
                        	tmp = y * ((z * z) / x);
                        end
                        
                        code[x_, y_, z_] := N[(y * N[(N[(z * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        y \cdot \frac{z \cdot z}{x}
                        \end{array}
                        
                        Derivation
                        1. Initial program 94.3%

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

                          \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                          2. *-commutativeN/A

                            \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
                          3. unpow2N/A

                            \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
                          4. associate-*l*N/A

                            \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
                          5. *-commutativeN/A

                            \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
                          6. lower-*.f64N/A

                            \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
                          7. *-commutativeN/A

                            \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
                          8. lower-*.f6425.9

                            \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
                        5. Applied rewrites25.9%

                          \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
                        6. Step-by-step derivation
                          1. Applied rewrites27.0%

                            \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{\frac{z}{x}} \]
                          2. Step-by-step derivation
                            1. Applied rewrites29.1%

                              \[\leadsto \frac{z \cdot z}{x} \cdot \color{blue}{y} \]
                            2. Final simplification29.1%

                              \[\leadsto y \cdot \frac{z \cdot z}{x} \]
                            3. Add Preprocessing

                            Alternative 11: 30.8% accurate, 6.7× speedup?

                            \[\begin{array}{l} \\ \frac{y}{x} \cdot \left(z \cdot z\right) \end{array} \]
                            (FPCore (x y z) :precision binary64 (* (/ y x) (* z z)))
                            double code(double x, double y, double z) {
                            	return (y / x) * (z * z);
                            }
                            
                            real(8) function code(x, y, z)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                code = (y / x) * (z * z)
                            end function
                            
                            public static double code(double x, double y, double z) {
                            	return (y / x) * (z * z);
                            }
                            
                            def code(x, y, z):
                            	return (y / x) * (z * z)
                            
                            function code(x, y, z)
                            	return Float64(Float64(y / x) * Float64(z * z))
                            end
                            
                            function tmp = code(x, y, z)
                            	tmp = (y / x) * (z * z);
                            end
                            
                            code[x_, y_, z_] := N[(N[(y / x), $MachinePrecision] * N[(z * z), $MachinePrecision]), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{y}{x} \cdot \left(z \cdot z\right)
                            \end{array}
                            
                            Derivation
                            1. Initial program 94.3%

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

                              \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                              2. *-commutativeN/A

                                \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
                              3. unpow2N/A

                                \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
                              4. associate-*l*N/A

                                \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
                              5. *-commutativeN/A

                                \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
                              6. lower-*.f64N/A

                                \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
                              7. *-commutativeN/A

                                \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
                              8. lower-*.f6425.9

                                \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
                            5. Applied rewrites25.9%

                              \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
                            6. Step-by-step derivation
                              1. Applied rewrites28.1%

                                \[\leadsto \left(z \cdot z\right) \cdot \color{blue}{\frac{y}{x}} \]
                              2. Final simplification28.1%

                                \[\leadsto \frac{y}{x} \cdot \left(z \cdot z\right) \]
                              3. Add Preprocessing

                              Alternative 12: 31.1% accurate, 6.7× speedup?

                              \[\begin{array}{l} \\ \left(z \cdot y\right) \cdot \frac{z}{x} \end{array} \]
                              (FPCore (x y z) :precision binary64 (* (* z y) (/ z x)))
                              double code(double x, double y, double z) {
                              	return (z * y) * (z / x);
                              }
                              
                              real(8) function code(x, y, z)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8), intent (in) :: z
                                  code = (z * y) * (z / x)
                              end function
                              
                              public static double code(double x, double y, double z) {
                              	return (z * y) * (z / x);
                              }
                              
                              def code(x, y, z):
                              	return (z * y) * (z / x)
                              
                              function code(x, y, z)
                              	return Float64(Float64(z * y) * Float64(z / x))
                              end
                              
                              function tmp = code(x, y, z)
                              	tmp = (z * y) * (z / x);
                              end
                              
                              code[x_, y_, z_] := N[(N[(z * y), $MachinePrecision] * N[(z / x), $MachinePrecision]), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              \left(z \cdot y\right) \cdot \frac{z}{x}
                              \end{array}
                              
                              Derivation
                              1. Initial program 94.3%

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

                                \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                              4. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{y \cdot {z}^{2}}{x}} \]
                                2. *-commutativeN/A

                                  \[\leadsto \frac{\color{blue}{{z}^{2} \cdot y}}{x} \]
                                3. unpow2N/A

                                  \[\leadsto \frac{\color{blue}{\left(z \cdot z\right)} \cdot y}{x} \]
                                4. associate-*l*N/A

                                  \[\leadsto \frac{\color{blue}{z \cdot \left(z \cdot y\right)}}{x} \]
                                5. *-commutativeN/A

                                  \[\leadsto \frac{z \cdot \color{blue}{\left(y \cdot z\right)}}{x} \]
                                6. lower-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{z \cdot \left(y \cdot z\right)}}{x} \]
                                7. *-commutativeN/A

                                  \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
                                8. lower-*.f6425.9

                                  \[\leadsto \frac{z \cdot \color{blue}{\left(z \cdot y\right)}}{x} \]
                              5. Applied rewrites25.9%

                                \[\leadsto \color{blue}{\frac{z \cdot \left(z \cdot y\right)}{x}} \]
                              6. Step-by-step derivation
                                1. Applied rewrites27.0%

                                  \[\leadsto \left(z \cdot y\right) \cdot \color{blue}{\frac{z}{x}} \]
                                2. Add Preprocessing

                                Developer Target 1: 98.7% accurate, 0.9× 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 2024228 
                                (FPCore (x y z)
                                  :name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
                                  :precision binary64
                                
                                  :alt
                                  (! :herbie-platform default (+ (+ (+ (* (- x 1/2) (log x)) (- 91893853320467/100000000000000 x)) (/ 83333333333333/1000000000000000 x)) (* (/ z x) (- (* z (+ y 7936500793651/10000000000000000)) 13888888888889/5000000000000000))))
                                
                                  (+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))