Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

Percentage Accurate: 99.8% → 99.9%
Time: 8.7s
Alternatives: 12
Speedup: 1.0×

Specification

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

\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\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: 99.8% accurate, 1.0× speedup?

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

\\
\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\mathsf{fma}\left(-0.5 - y, \log y, y\right) + x\right) - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ (fma (- -0.5 y) (log y) y) x) z))
double code(double x, double y, double z) {
	return (fma((-0.5 - y), log(y), y) + x) - z;
}
function code(x, y, z)
	return Float64(Float64(fma(Float64(-0.5 - y), log(y), y) + x) - z)
end
code[x_, y_, z_] := N[(N[(N[(N[(-0.5 - y), $MachinePrecision] * N[Log[y], $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision]
\begin{array}{l}

\\
\left(\mathsf{fma}\left(-0.5 - y, \log y, y\right) + x\right) - z
\end{array}
Derivation
  1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\left(\left(x - \left(y + \frac{1}{2}\right) \cdot \log y\right) + y\right)} - z \]
    2. lift--.f64N/A

      \[\leadsto \left(\color{blue}{\left(x - \left(y + \frac{1}{2}\right) \cdot \log y\right)} + y\right) - z \]
    3. sub-negN/A

      \[\leadsto \left(\color{blue}{\left(x + \left(\mathsf{neg}\left(\left(y + \frac{1}{2}\right) \cdot \log y\right)\right)\right)} + y\right) - z \]
    4. associate-+l+N/A

      \[\leadsto \color{blue}{\left(x + \left(\left(\mathsf{neg}\left(\left(y + \frac{1}{2}\right) \cdot \log y\right)\right) + y\right)\right)} - z \]
    5. lower-+.f64N/A

      \[\leadsto \color{blue}{\left(x + \left(\left(\mathsf{neg}\left(\left(y + \frac{1}{2}\right) \cdot \log y\right)\right) + y\right)\right)} - z \]
    6. lift-*.f64N/A

      \[\leadsto \left(x + \left(\left(\mathsf{neg}\left(\color{blue}{\left(y + \frac{1}{2}\right) \cdot \log y}\right)\right) + y\right)\right) - z \]
    7. distribute-lft-neg-inN/A

      \[\leadsto \left(x + \left(\color{blue}{\left(\mathsf{neg}\left(\left(y + \frac{1}{2}\right)\right)\right) \cdot \log y} + y\right)\right) - z \]
    8. lower-fma.f64N/A

      \[\leadsto \left(x + \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(y + \frac{1}{2}\right)\right), \log y, y\right)}\right) - z \]
    9. lift-+.f64N/A

      \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(y + \frac{1}{2}\right)}\right), \log y, y\right)\right) - z \]
    10. +-commutativeN/A

      \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right)}\right), \log y, y\right)\right) - z \]
    11. distribute-neg-inN/A

      \[\leadsto \left(x + \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, y\right)\right) - z \]
    12. unsub-negN/A

      \[\leadsto \left(x + \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) - y}, \log y, y\right)\right) - z \]
    13. lower--.f64N/A

      \[\leadsto \left(x + \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) - y}, \log y, y\right)\right) - z \]
    14. metadata-eval99.8

      \[\leadsto \left(x + \mathsf{fma}\left(\color{blue}{-0.5} - y, \log y, y\right)\right) - z \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\left(x + \mathsf{fma}\left(-0.5 - y, \log y, y\right)\right)} - z \]
  5. Final simplification99.8%

    \[\leadsto \left(\mathsf{fma}\left(-0.5 - y, \log y, y\right) + x\right) - z \]
  6. Add Preprocessing

Alternative 2: 89.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.8 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(\log y, -0.5 - y, y\right) + x\\

\mathbf{else}:\\
\;\;\;\;\left(1 - \log y\right) \cdot y - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 3.7999999999999999e28

    1. Initial program 100.0%

      \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

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

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

        \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
      3. distribute-lft-neg-inN/A

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
      6. lower-log.f6497.4

        \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
    5. Applied rewrites97.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

    if 3.7999999999999999e28 < y < 5.1000000000000001e132

    1. Initial program 99.6%

      \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
      4. distribute-lft-neg-inN/A

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right), \log y, x + y\right)} \]
      6. distribute-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, x + y\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right), \log y, x + y\right) \]
      8. unsub-negN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \color{blue}{\log y}, x + y\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \log y, \color{blue}{y + x}\right) \]
      12. lower-+.f6489.2

        \[\leadsto \mathsf{fma}\left(-0.5 - y, \log y, \color{blue}{y + x}\right) \]
    5. Applied rewrites89.2%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 - y, \log y, y + x\right)} \]
    6. Step-by-step derivation
      1. Applied rewrites89.2%

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

      if 5.1000000000000001e132 < y

      1. Initial program 99.5%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

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

          \[\leadsto \color{blue}{\left(1 - -1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot y} - z \]
        2. mul-1-negN/A

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

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

          \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y - z \]
        5. lower-*.f64N/A

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

          \[\leadsto \color{blue}{\left(1 - \log y\right)} \cdot y - z \]
        7. lower-log.f6494.3

          \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y - z \]
      5. Applied rewrites94.3%

        \[\leadsto \color{blue}{\left(1 - \log y\right) \cdot y} - z \]
    7. Recombined 3 regimes into one program.
    8. Add Preprocessing

    Alternative 3: 89.5% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.8 \cdot 10^{+28}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+132}:\\ \;\;\;\;\mathsf{fma}\left(-y, \log y, y + x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y - z\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 3.8e+28)
       (- (fma -0.5 (log y) x) z)
       (if (<= y 5.1e+132)
         (fma (- y) (log y) (+ y x))
         (- (* (- 1.0 (log y)) y) z))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 3.8e+28) {
    		tmp = fma(-0.5, log(y), x) - z;
    	} else if (y <= 5.1e+132) {
    		tmp = fma(-y, log(y), (y + x));
    	} else {
    		tmp = ((1.0 - log(y)) * y) - z;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 3.8e+28)
    		tmp = Float64(fma(-0.5, log(y), x) - z);
    	elseif (y <= 5.1e+132)
    		tmp = fma(Float64(-y), log(y), Float64(y + x));
    	else
    		tmp = Float64(Float64(Float64(1.0 - log(y)) * y) - z);
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 3.8e+28], N[(N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 5.1e+132], N[((-y) * N[Log[y], $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 3.8 \cdot 10^{+28}:\\
    \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\
    
    \mathbf{elif}\;y \leq 5.1 \cdot 10^{+132}:\\
    \;\;\;\;\mathsf{fma}\left(-y, \log y, y + x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 - \log y\right) \cdot y - z\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < 3.7999999999999999e28

      1. Initial program 100.0%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

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

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

          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
        3. distribute-lft-neg-inN/A

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
        6. lower-log.f6497.4

          \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
      5. Applied rewrites97.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

      if 3.7999999999999999e28 < y < 5.1000000000000001e132

      1. Initial program 99.6%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

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

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

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

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
        4. distribute-lft-neg-inN/A

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right), \log y, x + y\right)} \]
        6. distribute-neg-inN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, x + y\right) \]
        7. metadata-evalN/A

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right), \log y, x + y\right) \]
        8. unsub-negN/A

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \color{blue}{\log y}, x + y\right) \]
        11. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \log y, \color{blue}{y + x}\right) \]
        12. lower-+.f6489.2

          \[\leadsto \mathsf{fma}\left(-0.5 - y, \log y, \color{blue}{y + x}\right) \]
      5. Applied rewrites89.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 - y, \log y, y + x\right)} \]
      6. Taylor expanded in y around inf

        \[\leadsto \mathsf{fma}\left(-1 \cdot y, \log \color{blue}{y}, y + x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites89.2%

          \[\leadsto \mathsf{fma}\left(-y, \log \color{blue}{y}, y + x\right) \]

        if 5.1000000000000001e132 < y

        1. Initial program 99.5%

          \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

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

            \[\leadsto \color{blue}{\left(1 - -1 \cdot \log \left(\frac{1}{y}\right)\right) \cdot y} - z \]
          2. mul-1-negN/A

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

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

            \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y - z \]
          5. lower-*.f64N/A

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

            \[\leadsto \color{blue}{\left(1 - \log y\right)} \cdot y - z \]
          7. lower-log.f6494.3

            \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y - z \]
        5. Applied rewrites94.3%

          \[\leadsto \color{blue}{\left(1 - \log y\right) \cdot y} - z \]
      8. Recombined 3 regimes into one program.
      9. Add Preprocessing

      Alternative 4: 65.4% accurate, 1.0× speedup?

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

        1. Initial program 100.0%

          \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

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

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

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

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
          4. distribute-lft-neg-inN/A

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right), \log y, x + y\right)} \]
          6. distribute-neg-inN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, x + y\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right), \log y, x + y\right) \]
          8. unsub-negN/A

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \color{blue}{\log y}, x + y\right) \]
          11. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \log y, \color{blue}{y + x}\right) \]
          12. lower-+.f6472.1

            \[\leadsto \mathsf{fma}\left(-0.5 - y, \log y, \color{blue}{y + x}\right) \]
        5. Applied rewrites72.1%

          \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 - y, \log y, y + x\right)} \]
        6. Taylor expanded in y around 0

          \[\leadsto x + \color{blue}{\frac{-1}{2} \cdot \log y} \]
        7. Step-by-step derivation
          1. Applied rewrites72.1%

            \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) \]

          if 1.29999999999999998e-103 < y < 1.7000000000000001e30

          1. Initial program 99.9%

            \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
          2. Add Preprocessing
          3. Taylor expanded in y around inf

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

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

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

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

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

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

              \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
            7. lower-log.f6485.2

              \[\leadsto \left(\left(x - \color{blue}{\log y} \cdot y\right) + y\right) - z \]
          5. Applied rewrites85.2%

            \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
          6. Taylor expanded in x around inf

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

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

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

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

              \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)\right)} + 1\right) \cdot x + y\right) - z \]
            5. associate-/l*N/A

              \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\log y \cdot \frac{\frac{1}{2} + y}{x}}\right)\right) + 1\right) \cdot x + y\right) - z \]
            6. *-commutativeN/A

              \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} + y}{x} \cdot \log y}\right)\right) + 1\right) \cdot x + y\right) - z \]
            7. distribute-lft-neg-inN/A

              \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2} + y}{x}\right)\right) \cdot \log y} + 1\right) \cdot x + y\right) - z \]
            8. lower-fma.f64N/A

              \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\frac{\frac{1}{2} + y}{x}\right), \log y, 1\right)} \cdot x + y\right) - z \]
            9. distribute-neg-fracN/A

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

              \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right)}{x}}, \log y, 1\right) \cdot x + y\right) - z \]
            11. distribute-neg-inN/A

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

              \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right)}{x}, \log y, 1\right) \cdot x + y\right) - z \]
            13. unsub-negN/A

              \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2} - y}}{x}, \log y, 1\right) \cdot x + y\right) - z \]
            14. lower--.f64N/A

              \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2} - y}}{x}, \log y, 1\right) \cdot x + y\right) - z \]
            15. lower-log.f6499.9

              \[\leadsto \left(\mathsf{fma}\left(\frac{-0.5 - y}{x}, \color{blue}{\log y}, 1\right) \cdot x + y\right) - z \]
          8. Applied rewrites99.9%

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

            \[\leadsto \left(1 \cdot x + y\right) - z \]
          10. Step-by-step derivation
            1. Applied rewrites80.8%

              \[\leadsto \left(1 \cdot x + y\right) - z \]
            2. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \color{blue}{\left(1 \cdot x + y\right) - z} \]
              2. lift-+.f64N/A

                \[\leadsto \color{blue}{\left(1 \cdot x + y\right)} - z \]
              3. +-commutativeN/A

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

                \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
              5. lower-+.f64N/A

                \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
              6. lower--.f6480.8

                \[\leadsto y + \color{blue}{\left(1 \cdot x - z\right)} \]
            3. Applied rewrites80.8%

              \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]

            if 1.7000000000000001e30 < y

            1. Initial program 99.6%

              \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

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

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

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

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

                \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y \]
              5. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(1 - \log y\right) \cdot y} \]
              6. lower--.f64N/A

                \[\leadsto \color{blue}{\left(1 - \log y\right)} \cdot y \]
              7. lower-log.f6475.7

                \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y \]
            5. Applied rewrites75.7%

              \[\leadsto \color{blue}{\left(1 - \log y\right) \cdot y} \]
          11. Recombined 3 regimes into one program.
          12. Final simplification75.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.3 \cdot 10^{-103}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+30}:\\ \;\;\;\;\left(1 \cdot x - z\right) + y\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y\\ \end{array} \]
          13. Add Preprocessing

          Alternative 5: 99.3% accurate, 1.0× speedup?

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

            1. Initial program 100.0%

              \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

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

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

                \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
              3. distribute-lft-neg-inN/A

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
              6. lower-log.f6499.4

                \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
            5. Applied rewrites99.4%

              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

            if 0.28000000000000003 < y

            1. Initial program 99.6%

              \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

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

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

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

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

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

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

                \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
              7. lower-log.f6499.2

                \[\leadsto \left(\left(x - \color{blue}{\log y} \cdot y\right) + y\right) - z \]
            5. Applied rewrites99.2%

              \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
            6. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\left(\left(x - \log y \cdot y\right) + y\right)} - z \]
              2. lift--.f64N/A

                \[\leadsto \left(\color{blue}{\left(x - \log y \cdot y\right)} + y\right) - z \]
              3. associate-+l-N/A

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

                \[\leadsto \color{blue}{\left(x - \left(\log y \cdot y - y\right)\right)} - z \]
              5. lower--.f6499.2

                \[\leadsto \left(x - \color{blue}{\left(\log y \cdot y - y\right)}\right) - z \]
            7. Applied rewrites99.2%

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

          Alternative 6: 99.3% accurate, 1.0× speedup?

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

            1. Initial program 100.0%

              \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
            2. Add Preprocessing
            3. Taylor expanded in y around 0

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

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

                \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
              3. distribute-lft-neg-inN/A

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

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
              6. lower-log.f6499.4

                \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
            5. Applied rewrites99.4%

              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

            if 0.28000000000000003 < y

            1. Initial program 99.6%

              \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

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

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

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

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

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

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

                \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
              7. lower-log.f6499.2

                \[\leadsto \left(\left(x - \color{blue}{\log y} \cdot y\right) + y\right) - z \]
            5. Applied rewrites99.2%

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

          Alternative 7: 68.8% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 \cdot x - z\right) + y\\ \mathbf{if}\;z \leq -4.3 \cdot 10^{+23}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 540000000000:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (+ (- (* 1.0 x) z) y)))
             (if (<= z -4.3e+23)
               t_0
               (if (<= z 540000000000.0) (fma -0.5 (log y) x) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = ((1.0 * x) - z) + y;
          	double tmp;
          	if (z <= -4.3e+23) {
          		tmp = t_0;
          	} else if (z <= 540000000000.0) {
          		tmp = fma(-0.5, log(y), x);
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	t_0 = Float64(Float64(Float64(1.0 * x) - z) + y)
          	tmp = 0.0
          	if (z <= -4.3e+23)
          		tmp = t_0;
          	elseif (z <= 540000000000.0)
          		tmp = fma(-0.5, log(y), x);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 * x), $MachinePrecision] - z), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[z, -4.3e+23], t$95$0, If[LessEqual[z, 540000000000.0], N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \left(1 \cdot x - z\right) + y\\
          \mathbf{if}\;z \leq -4.3 \cdot 10^{+23}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;z \leq 540000000000:\\
          \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -4.2999999999999999e23 or 5.4e11 < z

            1. Initial program 99.8%

              \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
            2. Add Preprocessing
            3. Taylor expanded in y around inf

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

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

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

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

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

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

                \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
              7. lower-log.f6499.8

                \[\leadsto \left(\left(x - \color{blue}{\log y} \cdot y\right) + y\right) - z \]
            5. Applied rewrites99.8%

              \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
            6. Taylor expanded in x around inf

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

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

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

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

                \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)\right)} + 1\right) \cdot x + y\right) - z \]
              5. associate-/l*N/A

                \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\log y \cdot \frac{\frac{1}{2} + y}{x}}\right)\right) + 1\right) \cdot x + y\right) - z \]
              6. *-commutativeN/A

                \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} + y}{x} \cdot \log y}\right)\right) + 1\right) \cdot x + y\right) - z \]
              7. distribute-lft-neg-inN/A

                \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2} + y}{x}\right)\right) \cdot \log y} + 1\right) \cdot x + y\right) - z \]
              8. lower-fma.f64N/A

                \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\frac{\frac{1}{2} + y}{x}\right), \log y, 1\right)} \cdot x + y\right) - z \]
              9. distribute-neg-fracN/A

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

                \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right)}{x}}, \log y, 1\right) \cdot x + y\right) - z \]
              11. distribute-neg-inN/A

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

                \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right)}{x}, \log y, 1\right) \cdot x + y\right) - z \]
              13. unsub-negN/A

                \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2} - y}}{x}, \log y, 1\right) \cdot x + y\right) - z \]
              14. lower--.f64N/A

                \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2} - y}}{x}, \log y, 1\right) \cdot x + y\right) - z \]
              15. lower-log.f6482.5

                \[\leadsto \left(\mathsf{fma}\left(\frac{-0.5 - y}{x}, \color{blue}{\log y}, 1\right) \cdot x + y\right) - z \]
            8. Applied rewrites82.5%

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

              \[\leadsto \left(1 \cdot x + y\right) - z \]
            10. Step-by-step derivation
              1. Applied rewrites72.0%

                \[\leadsto \left(1 \cdot x + y\right) - z \]
              2. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \color{blue}{\left(1 \cdot x + y\right) - z} \]
                2. lift-+.f64N/A

                  \[\leadsto \color{blue}{\left(1 \cdot x + y\right)} - z \]
                3. +-commutativeN/A

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

                  \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
                5. lower-+.f64N/A

                  \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
                6. lower--.f6472.0

                  \[\leadsto y + \color{blue}{\left(1 \cdot x - z\right)} \]
              3. Applied rewrites72.0%

                \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]

              if -4.2999999999999999e23 < z < 5.4e11

              1. Initial program 99.7%

                \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
              2. Add Preprocessing
              3. Taylor expanded in z around 0

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

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

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

                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
                4. distribute-lft-neg-inN/A

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right), \log y, x + y\right)} \]
                6. distribute-neg-inN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, x + y\right) \]
                7. metadata-evalN/A

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right), \log y, x + y\right) \]
                8. unsub-negN/A

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \color{blue}{\log y}, x + y\right) \]
                11. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \log y, \color{blue}{y + x}\right) \]
                12. lower-+.f6498.4

                  \[\leadsto \mathsf{fma}\left(-0.5 - y, \log y, \color{blue}{y + x}\right) \]
              5. Applied rewrites98.4%

                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 - y, \log y, y + x\right)} \]
              6. Taylor expanded in y around 0

                \[\leadsto x + \color{blue}{\frac{-1}{2} \cdot \log y} \]
              7. Step-by-step derivation
                1. Applied rewrites53.9%

                  \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) \]
              8. Recombined 2 regimes into one program.
              9. Final simplification61.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{+23}:\\ \;\;\;\;\left(1 \cdot x - z\right) + y\\ \mathbf{elif}\;z \leq 540000000000:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 \cdot x - z\right) + y\\ \end{array} \]
              10. Add Preprocessing

              Alternative 8: 89.6% accurate, 1.0× speedup?

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

                1. Initial program 100.0%

                  \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                2. Add Preprocessing
                3. Taylor expanded in y around 0

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

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

                    \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
                  3. distribute-lft-neg-inN/A

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

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
                  6. lower-log.f6497.4

                    \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
                5. Applied rewrites97.4%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

                if 3.7999999999999999e28 < y

                1. Initial program 99.6%

                  \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

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

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

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

                    \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
                  4. distribute-lft-neg-inN/A

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right), \log y, x + y\right)} \]
                  6. distribute-neg-inN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, x + y\right) \]
                  7. metadata-evalN/A

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right), \log y, x + y\right) \]
                  8. unsub-negN/A

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \color{blue}{\log y}, x + y\right) \]
                  11. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \log y, \color{blue}{y + x}\right) \]
                  12. lower-+.f6487.9

                    \[\leadsto \mathsf{fma}\left(-0.5 - y, \log y, \color{blue}{y + x}\right) \]
                5. Applied rewrites87.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 - y, \log y, y + x\right)} \]
                6. Taylor expanded in y around inf

                  \[\leadsto \mathsf{fma}\left(-1 \cdot y, \log \color{blue}{y}, y + x\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites87.9%

                    \[\leadsto \mathsf{fma}\left(-y, \log \color{blue}{y}, y + x\right) \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 9: 89.5% accurate, 1.0× speedup?

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

                  1. Initial program 100.0%

                    \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                  2. Add Preprocessing
                  3. Taylor expanded in y around 0

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

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

                      \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
                    3. distribute-lft-neg-inN/A

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

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
                    6. lower-log.f6497.4

                      \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
                  5. Applied rewrites97.4%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

                  if 3.7999999999999999e28 < y

                  1. Initial program 99.6%

                    \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                  2. Add Preprocessing
                  3. Taylor expanded in z around 0

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

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

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

                      \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
                    4. distribute-lft-neg-inN/A

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right), \log y, x + y\right)} \]
                    6. distribute-neg-inN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) + \left(\mathsf{neg}\left(y\right)\right)}, \log y, x + y\right) \]
                    7. metadata-evalN/A

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right), \log y, x + y\right) \]
                    8. unsub-negN/A

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \color{blue}{\log y}, x + y\right) \]
                    11. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(\frac{-1}{2} - y, \log y, \color{blue}{y + x}\right) \]
                    12. lower-+.f6487.9

                      \[\leadsto \mathsf{fma}\left(-0.5 - y, \log y, \color{blue}{y + x}\right) \]
                  5. Applied rewrites87.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5 - y, \log y, y + x\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites87.8%

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

                      \[\leadsto \mathsf{fma}\left(\log y, -1 \cdot y, x\right) + y \]
                    3. Step-by-step derivation
                      1. Applied rewrites87.8%

                        \[\leadsto \mathsf{fma}\left(\log y, -y, x\right) + y \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 10: 80.8% accurate, 1.0× speedup?

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

                      1. Initial program 100.0%

                        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around 0

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

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

                          \[\leadsto \color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \log y\right)\right) + x\right)} - z \]
                        3. distribute-lft-neg-inN/A

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
                        6. lower-log.f6497.4

                          \[\leadsto \mathsf{fma}\left(-0.5, \color{blue}{\log y}, x\right) - z \]
                      5. Applied rewrites97.4%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \log y, x\right)} - z \]

                      if 1.7000000000000001e30 < y

                      1. Initial program 99.6%

                        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around inf

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

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

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

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

                          \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y \]
                        5. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(1 - \log y\right) \cdot y} \]
                        6. lower--.f64N/A

                          \[\leadsto \color{blue}{\left(1 - \log y\right)} \cdot y \]
                        7. lower-log.f6475.7

                          \[\leadsto \left(1 - \color{blue}{\log y}\right) \cdot y \]
                      5. Applied rewrites75.7%

                        \[\leadsto \color{blue}{\left(1 - \log y\right) \cdot y} \]
                    3. Recombined 2 regimes into one program.
                    4. Add Preprocessing

                    Alternative 11: 56.8% accurate, 9.8× speedup?

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

                      \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                    2. Add Preprocessing
                    3. Taylor expanded in y around inf

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

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

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

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

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

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

                        \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
                      7. lower-log.f6485.5

                        \[\leadsto \left(\left(x - \color{blue}{\log y} \cdot y\right) + y\right) - z \]
                    5. Applied rewrites85.5%

                      \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
                    6. Taylor expanded in x around inf

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

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

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

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

                        \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)\right)} + 1\right) \cdot x + y\right) - z \]
                      5. associate-/l*N/A

                        \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\log y \cdot \frac{\frac{1}{2} + y}{x}}\right)\right) + 1\right) \cdot x + y\right) - z \]
                      6. *-commutativeN/A

                        \[\leadsto \left(\left(\left(\mathsf{neg}\left(\color{blue}{\frac{\frac{1}{2} + y}{x} \cdot \log y}\right)\right) + 1\right) \cdot x + y\right) - z \]
                      7. distribute-lft-neg-inN/A

                        \[\leadsto \left(\left(\color{blue}{\left(\mathsf{neg}\left(\frac{\frac{1}{2} + y}{x}\right)\right) \cdot \log y} + 1\right) \cdot x + y\right) - z \]
                      8. lower-fma.f64N/A

                        \[\leadsto \left(\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(\frac{\frac{1}{2} + y}{x}\right), \log y, 1\right)} \cdot x + y\right) - z \]
                      9. distribute-neg-fracN/A

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

                        \[\leadsto \left(\mathsf{fma}\left(\color{blue}{\frac{\mathsf{neg}\left(\left(\frac{1}{2} + y\right)\right)}{x}}, \log y, 1\right) \cdot x + y\right) - z \]
                      11. distribute-neg-inN/A

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

                        \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2}} + \left(\mathsf{neg}\left(y\right)\right)}{x}, \log y, 1\right) \cdot x + y\right) - z \]
                      13. unsub-negN/A

                        \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2} - y}}{x}, \log y, 1\right) \cdot x + y\right) - z \]
                      14. lower--.f64N/A

                        \[\leadsto \left(\mathsf{fma}\left(\frac{\color{blue}{\frac{-1}{2} - y}}{x}, \log y, 1\right) \cdot x + y\right) - z \]
                      15. lower-log.f6484.9

                        \[\leadsto \left(\mathsf{fma}\left(\frac{-0.5 - y}{x}, \color{blue}{\log y}, 1\right) \cdot x + y\right) - z \]
                    8. Applied rewrites84.9%

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

                      \[\leadsto \left(1 \cdot x + y\right) - z \]
                    10. Step-by-step derivation
                      1. Applied rewrites47.1%

                        \[\leadsto \left(1 \cdot x + y\right) - z \]
                      2. Step-by-step derivation
                        1. lift--.f64N/A

                          \[\leadsto \color{blue}{\left(1 \cdot x + y\right) - z} \]
                        2. lift-+.f64N/A

                          \[\leadsto \color{blue}{\left(1 \cdot x + y\right)} - z \]
                        3. +-commutativeN/A

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

                          \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
                        5. lower-+.f64N/A

                          \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
                        6. lower--.f6447.1

                          \[\leadsto y + \color{blue}{\left(1 \cdot x - z\right)} \]
                      3. Applied rewrites47.1%

                        \[\leadsto \color{blue}{y + \left(1 \cdot x - z\right)} \]
                      4. Final simplification47.1%

                        \[\leadsto \left(1 \cdot x - z\right) + y \]
                      5. Add Preprocessing

                      Alternative 12: 29.8% accurate, 39.3× speedup?

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

                        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
                      2. Add Preprocessing
                      3. Taylor expanded in z around inf

                        \[\leadsto \color{blue}{-1 \cdot z} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left(z\right)} \]
                        2. lower-neg.f6424.0

                          \[\leadsto \color{blue}{-z} \]
                      5. Applied rewrites24.0%

                        \[\leadsto \color{blue}{-z} \]
                      6. Add Preprocessing

                      Developer Target 1: 99.8% accurate, 1.0× speedup?

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

                      Reproduce

                      ?
                      herbie shell --seed 2024270 
                      (FPCore (x y z)
                        :name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
                        :precision binary64
                      
                        :alt
                        (! :herbie-platform default (- (- (+ y x) z) (* (+ y 1/2) (log y))))
                      
                        (- (+ (- x (* (+ y 0.5) (log y))) y) z))