Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

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

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 73.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x - \left(y + 0.5\right) \cdot \log y\right) + y\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+166}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y\\ \mathbf{elif}\;t\_0 \leq -6 \cdot 10^{+44}:\\ \;\;\;\;\left({\left({x}^{-1}\right)}^{-1} + y\right) - z\\ \mathbf{elif}\;t\_0 \leq -5 \cdot 10^{+16}:\\ \;\;\;\;y - \log y \cdot y\\ \mathbf{elif}\;t\_0 \leq 341.25:\\ \;\;\;\;-0.5 \cdot \log y - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (- x (* (+ y 0.5) (log y))) y)))
   (if (<= t_0 -2e+166)
     (* (- 1.0 (log y)) y)
     (if (<= t_0 -6e+44)
       (- (+ (pow (pow x -1.0) -1.0) y) z)
       (if (<= t_0 -5e+16)
         (- y (* (log y) y))
         (if (<= t_0 341.25) (- (* -0.5 (log y)) z) (fma (/ (- z) x) x x)))))))
double code(double x, double y, double z) {
	double t_0 = (x - ((y + 0.5) * log(y))) + y;
	double tmp;
	if (t_0 <= -2e+166) {
		tmp = (1.0 - log(y)) * y;
	} else if (t_0 <= -6e+44) {
		tmp = (pow(pow(x, -1.0), -1.0) + y) - z;
	} else if (t_0 <= -5e+16) {
		tmp = y - (log(y) * y);
	} else if (t_0 <= 341.25) {
		tmp = (-0.5 * log(y)) - z;
	} else {
		tmp = fma((-z / x), x, x);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y)
	tmp = 0.0
	if (t_0 <= -2e+166)
		tmp = Float64(Float64(1.0 - log(y)) * y);
	elseif (t_0 <= -6e+44)
		tmp = Float64(Float64(((x ^ -1.0) ^ -1.0) + y) - z);
	elseif (t_0 <= -5e+16)
		tmp = Float64(y - Float64(log(y) * y));
	elseif (t_0 <= 341.25)
		tmp = Float64(Float64(-0.5 * log(y)) - z);
	else
		tmp = fma(Float64(Float64(-z) / x), x, x);
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+166], N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$0, -6e+44], N[(N[(N[Power[N[Power[x, -1.0], $MachinePrecision], -1.0], $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[t$95$0, -5e+16], N[(y - N[(N[Log[y], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 341.25], N[(N[(-0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[((-z) / x), $MachinePrecision] * x + x), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x - \left(y + 0.5\right) \cdot \log y\right) + y\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+166}:\\
\;\;\;\;\left(1 - \log y\right) \cdot y\\

\mathbf{elif}\;t\_0 \leq -6 \cdot 10^{+44}:\\
\;\;\;\;\left({\left({x}^{-1}\right)}^{-1} + y\right) - z\\

\mathbf{elif}\;t\_0 \leq -5 \cdot 10^{+16}:\\
\;\;\;\;y - \log y \cdot y\\

\mathbf{elif}\;t\_0 \leq 341.25:\\
\;\;\;\;-0.5 \cdot \log y - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -1.99999999999999988e166

    1. Initial program 99.7%

      \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
    2. Add Preprocessing
    3. Taylor expanded in 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.f6476.4

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

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

    if -1.99999999999999988e166 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -5.99999999999999974e44

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{\color{blue}{\frac{1}{x}}} + y\right) - z \]
    6. Step-by-step derivation
      1. lower-/.f6458.7

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

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

    if -5.99999999999999974e44 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -5e16

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y - \log y \cdot \color{blue}{y} \]

      if -5e16 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < 341.25

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -0.5 \cdot \log y - \color{blue}{z} \]

        if 341.25 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y)

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{z}{x}, x, x\right) \]
        7. Step-by-step derivation
          1. Applied rewrites98.9%

            \[\leadsto \mathsf{fma}\left(\frac{-z}{x}, x, x\right) \]
        8. Recombined 5 regimes into one program.
        9. Final simplification82.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq -2 \cdot 10^{+166}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y\\ \mathbf{elif}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq -6 \cdot 10^{+44}:\\ \;\;\;\;\left({\left({x}^{-1}\right)}^{-1} + y\right) - z\\ \mathbf{elif}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq -5 \cdot 10^{+16}:\\ \;\;\;\;y - \log y \cdot y\\ \mathbf{elif}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq 341.25:\\ \;\;\;\;-0.5 \cdot \log y - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \end{array} \]
        10. Add Preprocessing

        Alternative 3: 73.1% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x - \left(y + 0.5\right) \cdot \log y\right) + y\\ t_1 := \left(1 - \log y\right) \cdot y\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq -6 \cdot 10^{+44}:\\ \;\;\;\;\left({\left({x}^{-1}\right)}^{-1} + y\right) - z\\ \mathbf{elif}\;t\_0 \leq -5 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 341.25:\\ \;\;\;\;-0.5 \cdot \log y - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (+ (- x (* (+ y 0.5) (log y))) y)) (t_1 (* (- 1.0 (log y)) y)))
           (if (<= t_0 -2e+166)
             t_1
             (if (<= t_0 -6e+44)
               (- (+ (pow (pow x -1.0) -1.0) y) z)
               (if (<= t_0 -5e+16)
                 t_1
                 (if (<= t_0 341.25) (- (* -0.5 (log y)) z) (fma (/ (- z) x) x x)))))))
        double code(double x, double y, double z) {
        	double t_0 = (x - ((y + 0.5) * log(y))) + y;
        	double t_1 = (1.0 - log(y)) * y;
        	double tmp;
        	if (t_0 <= -2e+166) {
        		tmp = t_1;
        	} else if (t_0 <= -6e+44) {
        		tmp = (pow(pow(x, -1.0), -1.0) + y) - z;
        	} else if (t_0 <= -5e+16) {
        		tmp = t_1;
        	} else if (t_0 <= 341.25) {
        		tmp = (-0.5 * log(y)) - z;
        	} else {
        		tmp = fma((-z / x), x, x);
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	t_0 = Float64(Float64(x - Float64(Float64(y + 0.5) * log(y))) + y)
        	t_1 = Float64(Float64(1.0 - log(y)) * y)
        	tmp = 0.0
        	if (t_0 <= -2e+166)
        		tmp = t_1;
        	elseif (t_0 <= -6e+44)
        		tmp = Float64(Float64(((x ^ -1.0) ^ -1.0) + y) - z);
        	elseif (t_0 <= -5e+16)
        		tmp = t_1;
        	elseif (t_0 <= 341.25)
        		tmp = Float64(Float64(-0.5 * log(y)) - z);
        	else
        		tmp = fma(Float64(Float64(-z) / x), x, x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x - N[(N[(y + 0.5), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+166], t$95$1, If[LessEqual[t$95$0, -6e+44], N[(N[(N[Power[N[Power[x, -1.0], $MachinePrecision], -1.0], $MachinePrecision] + y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[t$95$0, -5e+16], t$95$1, If[LessEqual[t$95$0, 341.25], N[(N[(-0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[((-z) / x), $MachinePrecision] * x + x), $MachinePrecision]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left(x - \left(y + 0.5\right) \cdot \log y\right) + y\\
        t_1 := \left(1 - \log y\right) \cdot y\\
        \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+166}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_0 \leq -6 \cdot 10^{+44}:\\
        \;\;\;\;\left({\left({x}^{-1}\right)}^{-1} + y\right) - z\\
        
        \mathbf{elif}\;t\_0 \leq -5 \cdot 10^{+16}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t\_0 \leq 341.25:\\
        \;\;\;\;-0.5 \cdot \log y - z\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -1.99999999999999988e166 or -5.99999999999999974e44 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -5e16

          1. Initial program 99.7%

            \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
          2. Add Preprocessing
          3. Taylor expanded in 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.f6474.6

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

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

          if -1.99999999999999988e166 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < -5.99999999999999974e44

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{1}{\color{blue}{\frac{1}{x}}} + y\right) - z \]
          6. Step-by-step derivation
            1. lower-/.f6458.7

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

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

          if -5e16 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y) < 341.25

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

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

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

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

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

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

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

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

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

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

              \[\leadsto -0.5 \cdot \log y - \color{blue}{z} \]

            if 341.25 < (+.f64 (-.f64 x (*.f64 (+.f64 y #s(literal 1/2 binary64)) (log.f64 y))) y)

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{z}{x}, x, x\right) \]
            7. Step-by-step derivation
              1. Applied rewrites98.9%

                \[\leadsto \mathsf{fma}\left(\frac{-z}{x}, x, x\right) \]
            8. Recombined 4 regimes into one program.
            9. Final simplification82.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq -2 \cdot 10^{+166}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y\\ \mathbf{elif}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq -6 \cdot 10^{+44}:\\ \;\;\;\;\left({\left({x}^{-1}\right)}^{-1} + y\right) - z\\ \mathbf{elif}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq -5 \cdot 10^{+16}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y\\ \mathbf{elif}\;\left(x - \left(y + 0.5\right) \cdot \log y\right) + y \leq 341.25:\\ \;\;\;\;-0.5 \cdot \log y - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \end{array} \]
            10. Add Preprocessing

            Alternative 4: 57.2% accurate, 0.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{1}{\color{blue}{\frac{1}{x}}} + y\right) - z \]
            6. Step-by-step derivation
              1. lower-/.f6451.8

                \[\leadsto \left(\frac{1}{\color{blue}{\frac{1}{x}}} + y\right) - z \]
            7. Applied rewrites51.8%

              \[\leadsto \left(\frac{1}{\color{blue}{\frac{1}{x}}} + y\right) - z \]
            8. Final simplification51.8%

              \[\leadsto \left({\left({x}^{-1}\right)}^{-1} + y\right) - z \]
            9. Add Preprocessing

            Alternative 5: 89.2% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -6.6e7 < z < 2.6999999999999998e74

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

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

                \[\leadsto \color{blue}{-z} \]
              6. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 6: 89.2% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

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

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

                if -6.6e7 < z < 2.6999999999999998e74

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

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

                  \[\leadsto \color{blue}{-z} \]
                6. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 7: 69.9% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -48 \lor \neg \left(x \leq 4800000000\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \log y - z\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (or (<= x -48.0) (not (<= x 4800000000.0)))
                   (fma (/ (- z) x) x x)
                   (- (* -0.5 (log y)) z)))
                double code(double x, double y, double z) {
                	double tmp;
                	if ((x <= -48.0) || !(x <= 4800000000.0)) {
                		tmp = fma((-z / x), x, x);
                	} else {
                		tmp = (-0.5 * log(y)) - z;
                	}
                	return tmp;
                }
                
                function code(x, y, z)
                	tmp = 0.0
                	if ((x <= -48.0) || !(x <= 4800000000.0))
                		tmp = fma(Float64(Float64(-z) / x), x, x);
                	else
                		tmp = Float64(Float64(-0.5 * log(y)) - z);
                	end
                	return tmp
                end
                
                code[x_, y_, z_] := If[Or[LessEqual[x, -48.0], N[Not[LessEqual[x, 4800000000.0]], $MachinePrecision]], N[(N[((-z) / x), $MachinePrecision] * x + x), $MachinePrecision], N[(N[(-0.5 * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq -48 \lor \neg \left(x \leq 4800000000\right):\\
                \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;-0.5 \cdot \log y - z\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -48 or 4.8e9 < x

                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{z}{x}, x, x\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites72.1%

                      \[\leadsto \mathsf{fma}\left(\frac{-z}{x}, x, x\right) \]

                    if -48 < x < 4.8e9

                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto -0.5 \cdot \log y - \color{blue}{z} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification66.3%

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

                    Alternative 8: 99.1% accurate, 1.0× speedup?

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

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
                        12. lower-log.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 6.49999999999999991e-15 < 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.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. 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.3

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

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

                    Alternative 9: 89.8% accurate, 1.0× speedup?

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

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, \log y, x\right)} - z \]
                        12. lower-log.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 135 < 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. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

                    Alternative 10: 89.9% accurate, 1.0× speedup?

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

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 11: 88.9% accurate, 1.0× speedup?

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

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 2.1e12 < 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. 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.f6417.2

                            \[\leadsto \color{blue}{-z} \]
                        5. Applied rewrites17.2%

                          \[\leadsto \color{blue}{-z} \]
                        6. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 12: 84.4% accurate, 1.0× speedup?

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

                          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 1.3e137 < 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. 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.f6482.0

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

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

                        Alternative 13: 57.3% accurate, 3.7× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-95} \lor \neg \left(x \leq 4.5 \cdot 10^{-47}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
                        (FPCore (x y z)
                         :precision binary64
                         (if (or (<= x -3.8e-95) (not (<= x 4.5e-47))) (fma (/ (- z) x) x x) (- z)))
                        double code(double x, double y, double z) {
                        	double tmp;
                        	if ((x <= -3.8e-95) || !(x <= 4.5e-47)) {
                        		tmp = fma((-z / x), x, x);
                        	} else {
                        		tmp = -z;
                        	}
                        	return tmp;
                        }
                        
                        function code(x, y, z)
                        	tmp = 0.0
                        	if ((x <= -3.8e-95) || !(x <= 4.5e-47))
                        		tmp = fma(Float64(Float64(-z) / x), x, x);
                        	else
                        		tmp = Float64(-z);
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_] := If[Or[LessEqual[x, -3.8e-95], N[Not[LessEqual[x, 4.5e-47]], $MachinePrecision]], N[(N[((-z) / x), $MachinePrecision] * x + x), $MachinePrecision], (-z)]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -3.8 \cdot 10^{-95} \lor \neg \left(x \leq 4.5 \cdot 10^{-47}\right):\\
                        \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;-z\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -3.7999999999999997e-95 or 4.5e-47 < x

                          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{z}{x}, x, x\right) \]
                          7. Step-by-step derivation
                            1. Applied rewrites63.3%

                              \[\leadsto \mathsf{fma}\left(\frac{-z}{x}, x, x\right) \]

                            if -3.7999999999999997e-95 < x < 4.5e-47

                            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.f6438.6

                                \[\leadsto \color{blue}{-z} \]
                            5. Applied rewrites38.6%

                              \[\leadsto \color{blue}{-z} \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification52.6%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.8 \cdot 10^{-95} \lor \neg \left(x \leq 4.5 \cdot 10^{-47}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{-z}{x}, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 14: 38.2% accurate, 4.1× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -66000000 \lor \neg \left(z \leq 2.6 \cdot 10^{+74}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot z\\ \end{array} \end{array} \]
                          (FPCore (x y z)
                           :precision binary64
                           (if (or (<= z -66000000.0) (not (<= z 2.6e+74))) (- z) (* (/ x z) z)))
                          double code(double x, double y, double z) {
                          	double tmp;
                          	if ((z <= -66000000.0) || !(z <= 2.6e+74)) {
                          		tmp = -z;
                          	} else {
                          		tmp = (x / z) * z;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(x, y, z)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8) :: tmp
                              if ((z <= (-66000000.0d0)) .or. (.not. (z <= 2.6d+74))) then
                                  tmp = -z
                              else
                                  tmp = (x / z) * z
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z) {
                          	double tmp;
                          	if ((z <= -66000000.0) || !(z <= 2.6e+74)) {
                          		tmp = -z;
                          	} else {
                          		tmp = (x / z) * z;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z):
                          	tmp = 0
                          	if (z <= -66000000.0) or not (z <= 2.6e+74):
                          		tmp = -z
                          	else:
                          		tmp = (x / z) * z
                          	return tmp
                          
                          function code(x, y, z)
                          	tmp = 0.0
                          	if ((z <= -66000000.0) || !(z <= 2.6e+74))
                          		tmp = Float64(-z);
                          	else
                          		tmp = Float64(Float64(x / z) * z);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z)
                          	tmp = 0.0;
                          	if ((z <= -66000000.0) || ~((z <= 2.6e+74)))
                          		tmp = -z;
                          	else
                          		tmp = (x / z) * z;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_] := If[Or[LessEqual[z, -66000000.0], N[Not[LessEqual[z, 2.6e+74]], $MachinePrecision]], (-z), N[(N[(x / z), $MachinePrecision] * z), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;z \leq -66000000 \lor \neg \left(z \leq 2.6 \cdot 10^{+74}\right):\\
                          \;\;\;\;-z\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{x}{z} \cdot z\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if z < -6.6e7 or 2.6000000000000001e74 < 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. 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.f6466.1

                                \[\leadsto \color{blue}{-z} \]
                            5. Applied rewrites66.1%

                              \[\leadsto \color{blue}{-z} \]

                            if -6.6e7 < z < 2.6000000000000001e74

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

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

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

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

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

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

                                \[\leadsto \frac{x}{z} \cdot z \]
                              3. Step-by-step derivation
                                1. Applied rewrites24.4%

                                  \[\leadsto \frac{x}{z} \cdot z \]
                              4. Recombined 2 regimes into one program.
                              5. Final simplification40.4%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -66000000 \lor \neg \left(z \leq 2.6 \cdot 10^{+74}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot z\\ \end{array} \]
                              6. Add Preprocessing

                              Alternative 15: 30.1% 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.f6428.9

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

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

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

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

                              Reproduce

                              ?
                              herbie shell --seed 2024318 
                              (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))