Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

Percentage Accurate: 99.8% → 99.8%
Time: 8.2s
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.8% 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: 68.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 \cdot x + y\right) - z\\ t_1 := \left(\left(x - \left(0.5 + y\right) \cdot \log y\right) + y\right) - z\\ \mathbf{if}\;t\_1 \leq -40000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 500:\\ \;\;\;\;\log y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ (* 1.0 x) y) z))
        (t_1 (- (+ (- x (* (+ 0.5 y) (log y))) y) z)))
   (if (<= t_1 -40000000000.0) t_0 (if (<= t_1 500.0) (* (log y) -0.5) t_0))))
double code(double x, double y, double z) {
	double t_0 = ((1.0 * x) + y) - z;
	double t_1 = ((x - ((0.5 + y) * log(y))) + y) - z;
	double tmp;
	if (t_1 <= -40000000000.0) {
		tmp = t_0;
	} else if (t_1 <= 500.0) {
		tmp = log(y) * -0.5;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = ((1.0d0 * x) + y) - z
    t_1 = ((x - ((0.5d0 + y) * log(y))) + y) - z
    if (t_1 <= (-40000000000.0d0)) then
        tmp = t_0
    else if (t_1 <= 500.0d0) then
        tmp = log(y) * (-0.5d0)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((1.0 * x) + y) - z;
	double t_1 = ((x - ((0.5 + y) * Math.log(y))) + y) - z;
	double tmp;
	if (t_1 <= -40000000000.0) {
		tmp = t_0;
	} else if (t_1 <= 500.0) {
		tmp = Math.log(y) * -0.5;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((1.0 * x) + y) - z
	t_1 = ((x - ((0.5 + y) * math.log(y))) + y) - z
	tmp = 0
	if t_1 <= -40000000000.0:
		tmp = t_0
	elif t_1 <= 500.0:
		tmp = math.log(y) * -0.5
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(1.0 * x) + y) - z)
	t_1 = Float64(Float64(Float64(x - Float64(Float64(0.5 + y) * log(y))) + y) - z)
	tmp = 0.0
	if (t_1 <= -40000000000.0)
		tmp = t_0;
	elseif (t_1 <= 500.0)
		tmp = Float64(log(y) * -0.5);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((1.0 * x) + y) - z;
	t_1 = ((x - ((0.5 + y) * log(y))) + y) - z;
	tmp = 0.0;
	if (t_1 <= -40000000000.0)
		tmp = t_0;
	elseif (t_1 <= 500.0)
		tmp = log(y) * -0.5;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(1.0 * x), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x - N[(N[(0.5 + y), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[t$95$1, -40000000000.0], t$95$0, If[LessEqual[t$95$1, 500.0], N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(1 \cdot x + y\right) - z\\
t_1 := \left(\left(x - \left(0.5 + y\right) \cdot \log y\right) + y\right) - z\\
\mathbf{if}\;t\_1 \leq -40000000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 500:\\
\;\;\;\;\log y \cdot -0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) z) < -4e10 or 500 < (-.f64 (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) 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. 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}{x \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)} + y\right) - z \]
    6. 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.f6487.5

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

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

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

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

      if -4e10 < (-.f64 (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) z) < 500

      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.9

          \[\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.9

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

        \[\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}{y - \left(z + \log y \cdot \left(\frac{1}{2} + y\right)\right)} \]
      6. 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.3

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

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

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

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

          \[\leadsto \frac{-1}{2} \cdot \log y \]
        3. Step-by-step derivation
          1. Applied rewrites97.2%

            \[\leadsto -0.5 \cdot \log y \]
        4. Recombined 2 regimes into one program.
        5. Final simplification69.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\left(x - \left(0.5 + y\right) \cdot \log y\right) + y\right) - z \leq -40000000000:\\ \;\;\;\;\left(1 \cdot x + y\right) - z\\ \mathbf{elif}\;\left(\left(x - \left(0.5 + y\right) \cdot \log y\right) + y\right) - z \leq 500:\\ \;\;\;\;\log y \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;\left(1 \cdot x + y\right) - z\\ \end{array} \]
        6. Add Preprocessing

        Alternative 3: 99.3% accurate, 1.0× speedup?

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

          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.f64100.0

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

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

          if 2.2499999999999999e-4 < y

          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. 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.5

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.000225:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-y, \log y, y\right) + x\right) - z\\ \end{array} \]
        5. Add Preprocessing

        Alternative 4: 69.7% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 \cdot x + y\right) - z\\ \mathbf{if}\;z \leq -3800000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 320:\\ \;\;\;\;\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) y) z)))
           (if (<= z -3800000000.0) t_0 (if (<= z 320.0) (fma -0.5 (log y) x) t_0))))
        double code(double x, double y, double z) {
        	double t_0 = ((1.0 * x) + y) - z;
        	double tmp;
        	if (z <= -3800000000.0) {
        		tmp = t_0;
        	} else if (z <= 320.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) + y) - z)
        	tmp = 0.0
        	if (z <= -3800000000.0)
        		tmp = t_0;
        	elseif (z <= 320.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] + y), $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[z, -3800000000.0], t$95$0, If[LessEqual[z, 320.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 + y\right) - z\\
        \mathbf{if}\;z \leq -3800000000:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;z \leq 320:\\
        \;\;\;\;\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 < -3.8e9 or 320 < z

          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.9

              \[\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.9

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

            \[\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}{x \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)} + y\right) - z \]
          6. 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.f6490.9

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

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

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

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

            if -3.8e9 < z < 320

            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. lift-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 5: 90.0% accurate, 1.0× speedup?

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

              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.f6498.8

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

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

              if 2.1e50 < 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 \color{blue}{\left(\left(x - \left(y + \frac{1}{2}\right) \cdot \log y\right) + y\right)} - z \]
                3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 6: 89.9% accurate, 1.0× speedup?

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

              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.f6498.8

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

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

              if 2.1e50 < 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 \color{blue}{\left(\left(x - \left(y + \frac{1}{2}\right) \cdot \log y\right) + y\right)} - z \]
                3. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(y + x\right) - \log y \cdot \color{blue}{y} \]
                2. Step-by-step derivation
                  1. Applied rewrites86.5%

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

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

                Alternative 7: 84.3% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 7.2 \cdot 10^{+96}:\\ \;\;\;\;\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 7.2e+96) (- (fma -0.5 (log y) x) z) (- y (* (log y) y))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= 7.2e+96) {
                		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 <= 7.2e+96)
                		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, 7.2e+96], 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 7.2 \cdot 10^{+96}:\\
                \;\;\;\;\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 < 7.20000000000000026e96

                  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}{\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.f6493.4

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

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

                  if 7.20000000000000026e96 < 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.6

                      \[\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.6

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

                    \[\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}{y - \left(z + \log y \cdot \left(\frac{1}{2} + y\right)\right)} \]
                  6. 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.f6483.4

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

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

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

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

                  Alternative 8: 70.8% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.05 \cdot 10^{+67}:\\ \;\;\;\;\left(1 \cdot x + y\right) - z\\ \mathbf{else}:\\ \;\;\;\;y - \log y \cdot y\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (<= y 1.05e+67) (- (+ (* 1.0 x) y) z) (- y (* (log y) y))))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (y <= 1.05e+67) {
                  		tmp = ((1.0 * x) + y) - z;
                  	} else {
                  		tmp = y - (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 <= 1.05d+67) then
                          tmp = ((1.0d0 * x) + y) - z
                      else
                          tmp = y - (log(y) * y)
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (y <= 1.05e+67) {
                  		tmp = ((1.0 * x) + y) - z;
                  	} else {
                  		tmp = y - (Math.log(y) * y);
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if y <= 1.05e+67:
                  		tmp = ((1.0 * x) + y) - z
                  	else:
                  		tmp = y - (math.log(y) * y)
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (y <= 1.05e+67)
                  		tmp = Float64(Float64(Float64(1.0 * x) + y) - z);
                  	else
                  		tmp = Float64(y - Float64(log(y) * y));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (y <= 1.05e+67)
                  		tmp = ((1.0 * x) + y) - z;
                  	else
                  		tmp = y - (log(y) * y);
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[y, 1.05e+67], N[(N[(N[(1.0 * x), $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision], N[(y - N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq 1.05 \cdot 10^{+67}:\\
                  \;\;\;\;\left(1 \cdot x + y\right) - z\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;y - \log y \cdot y\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if y < 1.0500000000000001e67

                    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.9

                        \[\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.9

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

                      \[\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}{x \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)} + y\right) - z \]
                    6. 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.2

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

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

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

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

                      if 1.0500000000000001e67 < 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.6

                          \[\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.6

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

                        \[\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}{y - \left(z + \log y \cdot \left(\frac{1}{2} + y\right)\right)} \]
                      6. 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.f6483.0

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

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

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

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

                      Alternative 9: 70.8% accurate, 1.0× speedup?

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

                        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.9

                            \[\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.9

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

                          \[\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}{x \cdot \left(1 + -1 \cdot \frac{\log y \cdot \left(\frac{1}{2} + y\right)}{x}\right)} + y\right) - z \]
                        6. 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.2

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

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

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

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

                          if 1.0500000000000001e67 < 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.f6470.5

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

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

                        Alternative 10: 56.8% accurate, 9.8× speedup?

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

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

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

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

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

                          Alternative 11: 29.9% 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.f6429.8

                              \[\leadsto \color{blue}{-z} \]
                          5. Applied rewrites29.8%

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