Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

Percentage Accurate: 99.8% → 99.9%
Time: 8.3s
Alternatives: 11
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 11 alternatives:

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

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

\\
\left(x + \mathsf{fma}\left(-0.5 - y, \log y, y\right)\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. Add Preprocessing

Alternative 2: 88.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00045:\\
\;\;\;\;y - \mathsf{fma}\left(0.5 + y, \log y, z\right)\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4999999999999999e-4

    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 x around 0

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

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

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

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

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

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

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

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

    if -4.4999999999999999e-4 < z < 2e110

    1. Initial program 99.7%

      \[\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. flip--N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\frac{1}{2} + y\right) \cdot \log y}\right)\right) + \left(x + y\right) \]
      5. 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) \]
      6. 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)} \]
      7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e110 < z

    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}{x - \left(z + \frac{1}{2} \cdot \log y\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

        \[\leadsto \left(x - \color{blue}{\log y \cdot \frac{1}{2}}\right) - z \]
      5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

Alternative 3: 69.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -57000000 \lor \neg \left(x \leq 21000\right):\\ \;\;\;\;\left(\left(-x\right) \cdot -1 + y\right) - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, -z\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -57000000.0) (not (<= x 21000.0)))
   (- (+ (* (- x) -1.0) y) z)
   (fma -0.5 (log y) (- z))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -57000000.0) || !(x <= 21000.0)) {
		tmp = ((-x * -1.0) + y) - z;
	} else {
		tmp = fma(-0.5, log(y), -z);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if ((x <= -57000000.0) || !(x <= 21000.0))
		tmp = Float64(Float64(Float64(Float64(-x) * -1.0) + y) - z);
	else
		tmp = fma(-0.5, log(y), Float64(-z));
	end
	return tmp
end
code[x_, y_, z_] := If[Or[LessEqual[x, -57000000.0], N[Not[LessEqual[x, 21000.0]], $MachinePrecision]], N[(N[(N[((-x) * -1.0), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision], N[(-0.5 * N[Log[y], $MachinePrecision] + (-z)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -57000000 \lor \neg \left(x \leq 21000\right):\\
\;\;\;\;\left(\left(-x\right) \cdot -1 + y\right) - z\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, -z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.7e7 or 21000 < x

    1. Initial program 99.9%

      \[\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 \left(\left(x - \color{blue}{\left(y + \frac{1}{2}\right) \cdot \log y}\right) + y\right) - z \]
      2. *-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(x - \frac{\log y}{\frac{1}{\color{blue}{y + \frac{1}{2}}}}\right) + y\right) - z \]
      11. lower-/.f6499.8

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

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

        \[\leadsto \left(\left(x - \frac{\log y}{\frac{1}{\color{blue}{\frac{1}{2} + y}}}\right) + y\right) - z \]
      14. lower-+.f6499.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(-x\right) \cdot -1 + y\right) - z \]

      if -5.7e7 < x < 21000

      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 x around 0

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 99.3% accurate, 1.0× speedup?

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

        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}{x - \left(z + \frac{1}{2} \cdot \log y\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

            \[\leadsto \left(x - \color{blue}{\log y \cdot \frac{1}{2}}\right) - z \]
          5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

        if 2.85000000000000004e-8 < 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. 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.7

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

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

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

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

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

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

      Alternative 5: 89.5% accurate, 1.0× speedup?

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

        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}{x - \left(z + \frac{1}{2} \cdot \log y\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

            \[\leadsto \left(x - \color{blue}{\log y \cdot \frac{1}{2}}\right) - z \]
          5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

        if 1e10 < 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 x around 0

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

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

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

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

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

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

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

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

      Alternative 6: 89.4% accurate, 1.0× speedup?

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

        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}{x - \left(z + \frac{1}{2} \cdot \log y\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

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

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

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

            \[\leadsto \left(x - \color{blue}{\log y \cdot \frac{1}{2}}\right) - z \]
          5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

        if 7.4e10 < 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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\left(x - \color{blue}{\frac{\log y}{\frac{1}{0.5 + y}}}\right) + y\right) - z \]
        5. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(-1 \cdot y - \color{blue}{\frac{1}{2} \cdot \left(\frac{1}{y} \cdot y\right)}, \log y, y\right) - z \]
          14. lft-mult-inverseN/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{-1}{2} - y}, \log y, y\right) - z \]
          22. lower-log.f6488.7

            \[\leadsto \mathsf{fma}\left(-0.5 - y, \color{blue}{\log y}, y\right) - z \]
        7. Applied rewrites88.7%

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

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

            \[\leadsto \mathsf{fma}\left(-y, \log \color{blue}{y}, y\right) - z \]
        10. Recombined 2 regimes into one program.
        11. Add Preprocessing

        Alternative 7: 84.1% accurate, 1.0× speedup?

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

          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 0

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

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

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

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

              \[\leadsto \left(x - \color{blue}{\log y \cdot \frac{1}{2}}\right) - z \]
            5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

          if 1.59999999999999993e112 < 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 x around 0

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

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

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

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

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

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

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

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

            \[\leadsto y - \log y \cdot \color{blue}{\left(\frac{1}{2} + y\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites75.9%

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

          Alternative 8: 84.1% accurate, 1.0× speedup?

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

            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 0

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

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

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

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

                \[\leadsto \left(x - \color{blue}{\log y \cdot \frac{1}{2}}\right) - z \]
              5. cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

            if 1.59999999999999993e112 < 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 x around 0

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

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

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

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

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

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

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

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

              \[\leadsto y - -1 \cdot \color{blue}{\left(y \cdot \log \left(\frac{1}{y}\right)\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites75.9%

                \[\leadsto y - \log y \cdot \color{blue}{y} \]
            8. Recombined 2 regimes into one program.
            9. Add Preprocessing

            Alternative 9: 71.6% accurate, 1.0× speedup?

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

              1. Initial program 99.9%

                \[\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 \left(\left(x - \color{blue}{\left(y + \frac{1}{2}\right) \cdot \log y}\right) + y\right) - z \]
                2. *-commutativeN/A

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(x - \frac{\log y}{\frac{1}{\color{blue}{y + \frac{1}{2}}}}\right) + y\right) - z \]
                11. lower-/.f64100.0

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

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

                  \[\leadsto \left(\left(x - \frac{\log y}{\frac{1}{\color{blue}{\frac{1}{2} + y}}}\right) + y\right) - z \]
                14. lower-+.f64100.0

                  \[\leadsto \left(\left(x - \frac{\log y}{\frac{1}{\color{blue}{0.5 + y}}}\right) + y\right) - z \]
              4. Applied rewrites100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\left(-x\right) \cdot -1 + y\right) - z \]

                if 9.00000000000000049e77 < 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.f6471.7

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

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

              Alternative 10: 57.7% accurate, 8.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 11: 30.0% 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.f6431.9

                    \[\leadsto \color{blue}{-z} \]
                5. Applied rewrites31.9%

                  \[\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 2024324 
                (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))