Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

Percentage Accurate: 99.8% → 99.9%
Time: 9.2s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 0.5× speedup?

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

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

    \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
  2. Step-by-step derivation
    1. associate--l+99.8%

      \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
    2. sub-neg99.8%

      \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
    3. associate-+l+99.8%

      \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
    4. *-commutative99.8%

      \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
    5. distribute-rgt-neg-in99.8%

      \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
    6. fma-def99.9%

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

      \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
    8. distribute-neg-in99.9%

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.5× speedup?

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

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

    \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
  2. Step-by-step derivation
    1. associate--l+99.8%

      \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
    2. sub-neg99.8%

      \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
    3. associate-+l+99.8%

      \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
    4. *-commutative99.8%

      \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
    5. distribute-rgt-neg-in99.8%

      \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
    6. fma-def99.9%

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

      \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
    8. distribute-neg-in99.9%

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

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

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

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

    \[\leadsto x + \color{blue}{\left(\left(-0.5 \cdot \log y + y \cdot \left(1 + -1 \cdot \log y\right)\right) - z\right)} \]
  5. Step-by-step derivation
    1. Simplified99.8%

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

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

    Alternative 3: 75.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x - \log y \cdot 0.5\\ \mathbf{if}\;y \leq 6.5 \cdot 10^{-228}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-53}:\\ \;\;\;\;\left(x + y\right) - z\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-24}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+18}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (- x (* (log y) 0.5))))
       (if (<= y 6.5e-228)
         t_0
         (if (<= y 1.26e-53)
           (- (+ x y) z)
           (if (<= y 6.1e-24)
             t_0
             (if (<= y 8.8e+18) (- x z) (+ x (* y (- 1.0 (log y))))))))))
    double code(double x, double y, double z) {
    	double t_0 = x - (log(y) * 0.5);
    	double tmp;
    	if (y <= 6.5e-228) {
    		tmp = t_0;
    	} else if (y <= 1.26e-53) {
    		tmp = (x + y) - z;
    	} else if (y <= 6.1e-24) {
    		tmp = t_0;
    	} else if (y <= 8.8e+18) {
    		tmp = x - z;
    	} else {
    		tmp = x + (y * (1.0 - log(y)));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = x - (log(y) * 0.5d0)
        if (y <= 6.5d-228) then
            tmp = t_0
        else if (y <= 1.26d-53) then
            tmp = (x + y) - z
        else if (y <= 6.1d-24) then
            tmp = t_0
        else if (y <= 8.8d+18) then
            tmp = x - z
        else
            tmp = x + (y * (1.0d0 - log(y)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = x - (Math.log(y) * 0.5);
    	double tmp;
    	if (y <= 6.5e-228) {
    		tmp = t_0;
    	} else if (y <= 1.26e-53) {
    		tmp = (x + y) - z;
    	} else if (y <= 6.1e-24) {
    		tmp = t_0;
    	} else if (y <= 8.8e+18) {
    		tmp = x - z;
    	} else {
    		tmp = x + (y * (1.0 - Math.log(y)));
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = x - (math.log(y) * 0.5)
    	tmp = 0
    	if y <= 6.5e-228:
    		tmp = t_0
    	elif y <= 1.26e-53:
    		tmp = (x + y) - z
    	elif y <= 6.1e-24:
    		tmp = t_0
    	elif y <= 8.8e+18:
    		tmp = x - z
    	else:
    		tmp = x + (y * (1.0 - math.log(y)))
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(x - Float64(log(y) * 0.5))
    	tmp = 0.0
    	if (y <= 6.5e-228)
    		tmp = t_0;
    	elseif (y <= 1.26e-53)
    		tmp = Float64(Float64(x + y) - z);
    	elseif (y <= 6.1e-24)
    		tmp = t_0;
    	elseif (y <= 8.8e+18)
    		tmp = Float64(x - z);
    	else
    		tmp = Float64(x + Float64(y * Float64(1.0 - log(y))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = x - (log(y) * 0.5);
    	tmp = 0.0;
    	if (y <= 6.5e-228)
    		tmp = t_0;
    	elseif (y <= 1.26e-53)
    		tmp = (x + y) - z;
    	elseif (y <= 6.1e-24)
    		tmp = t_0;
    	elseif (y <= 8.8e+18)
    		tmp = x - z;
    	else
    		tmp = x + (y * (1.0 - log(y)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.5e-228], t$95$0, If[LessEqual[y, 1.26e-53], N[(N[(x + y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 6.1e-24], t$95$0, If[LessEqual[y, 8.8e+18], N[(x - z), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x - \log y \cdot 0.5\\
    \mathbf{if}\;y \leq 6.5 \cdot 10^{-228}:\\
    \;\;\;\;t_0\\
    
    \mathbf{elif}\;y \leq 1.26 \cdot 10^{-53}:\\
    \;\;\;\;\left(x + y\right) - z\\
    
    \mathbf{elif}\;y \leq 6.1 \cdot 10^{-24}:\\
    \;\;\;\;t_0\\
    
    \mathbf{elif}\;y \leq 8.8 \cdot 10^{+18}:\\
    \;\;\;\;x - z\\
    
    \mathbf{else}:\\
    \;\;\;\;x + y \cdot \left(1 - \log y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y < 6.50000000000000029e-228 or 1.26e-53 < y < 6.10000000000000036e-24

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{\left(x - 0.5 \cdot \log y\right)} - z \]
      3. Taylor expanded in z around 0 90.7%

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

      if 6.50000000000000029e-228 < y < 1.26e-53

      1. Initial program 100.0%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. expm1-log1p-u68.6%

          \[\leadsto \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x - \left(y + 0.5\right) \cdot \log y\right)\right)} + y\right) - z \]
        2. sub-neg68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{x + \left(-\left(y + 0.5\right) \cdot \log y\right)}\right)\right) + y\right) - z \]
        3. distribute-lft-neg-in68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(x + \color{blue}{\left(-\left(y + 0.5\right)\right) \cdot \log y}\right)\right) + y\right) - z \]
        4. +-commutative68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(x + \left(-\color{blue}{\left(0.5 + y\right)}\right) \cdot \log y\right)\right) + y\right) - z \]
        5. distribute-neg-in68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(x + \color{blue}{\left(\left(-0.5\right) + \left(-y\right)\right)} \cdot \log y\right)\right) + y\right) - z \]
        6. metadata-eval68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(x + \left(\color{blue}{-0.5} + \left(-y\right)\right) \cdot \log y\right)\right) + y\right) - z \]
        7. sub-neg68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(x + \color{blue}{\left(-0.5 - y\right)} \cdot \log y\right)\right) + y\right) - z \]
        8. *-commutative68.6%

          \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(x + \color{blue}{\log y \cdot \left(-0.5 - y\right)}\right)\right) + y\right) - z \]
      3. Applied egg-rr68.6%

        \[\leadsto \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(x + \log y \cdot \left(-0.5 - y\right)\right)\right)} + y\right) - z \]
      4. Taylor expanded in x around inf 78.5%

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

      if 6.10000000000000036e-24 < y < 8.8e18

      1. Initial program 99.9%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. add-cube-cbrt99.3%

          \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y} \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right) \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}} - z \]
        2. pow399.3%

          \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right)}^{3}} - z \]
        3. sub-neg99.3%

          \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + y}\right)}^{3} - z \]
        4. associate-+l+99.3%

          \[\leadsto {\left(\sqrt[3]{\color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + y\right)}}\right)}^{3} - z \]
        5. distribute-lft-neg-in99.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-\left(y + 0.5\right)\right) \cdot \log y} + y\right)}\right)}^{3} - z \]
        6. +-commutative99.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\left(-\color{blue}{\left(0.5 + y\right)}\right) \cdot \log y + y\right)}\right)}^{3} - z \]
        7. distribute-neg-in99.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(\left(-0.5\right) + \left(-y\right)\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
        8. metadata-eval99.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\left(\color{blue}{-0.5} + \left(-y\right)\right) \cdot \log y + y\right)}\right)}^{3} - z \]
        9. sub-neg99.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-0.5 - y\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
        10. *-commutative99.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\log y \cdot \left(-0.5 - y\right)} + y\right)}\right)}^{3} - z \]
      3. Applied egg-rr99.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x + \left(\log y \cdot \left(-0.5 - y\right) + y\right)}\right)}^{3}} - z \]
      4. Step-by-step derivation
        1. add-cube-cbrt99.2%

          \[\leadsto {\left(\sqrt[3]{x + \color{blue}{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y} \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right) \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}}}\right)}^{3} - z \]
        2. pow399.2%

          \[\leadsto {\left(\sqrt[3]{x + \color{blue}{{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right)}^{3}}}\right)}^{3} - z \]
        3. fma-def99.2%

          \[\leadsto {\left(\sqrt[3]{x + {\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(\log y, -0.5 - y, y\right)}}\right)}^{3}}\right)}^{3} - z \]
      5. Applied egg-rr99.2%

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

        \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot x} - z \]
      7. Step-by-step derivation
        1. pow-base-181.8%

          \[\leadsto \color{blue}{1} \cdot x - z \]
        2. *-lft-identity81.8%

          \[\leadsto \color{blue}{x} - z \]
      8. Simplified81.8%

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

      if 8.8e18 < y

      1. Initial program 99.6%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. associate--l+99.6%

          \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
        2. sub-neg99.6%

          \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
        3. associate-+l+99.6%

          \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
        4. *-commutative99.6%

          \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
        5. distribute-rgt-neg-in99.6%

          \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
        6. fma-def99.7%

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

          \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
        8. distribute-neg-in99.7%

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

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

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

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

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

          \[\leadsto x + y \cdot \left(1 + \color{blue}{\left(-\log y\right)}\right) \]
        2. sub-neg83.5%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.5 \cdot 10^{-228}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-53}:\\ \;\;\;\;\left(x + y\right) - z\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-24}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+18}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \end{array} \]

    Alternative 4: 89.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.4 \cdot 10^{+22} \lor \neg \left(x \leq 8 \cdot 10^{+78}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y \cdot \left(y + 0.5\right)\right) - z\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (or (<= x -7.4e+22) (not (<= x 8e+78)))
       (+ x (* y (- 1.0 (log y))))
       (- (- y (* (log y) (+ y 0.5))) z)))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((x <= -7.4e+22) || !(x <= 8e+78)) {
    		tmp = x + (y * (1.0 - log(y)));
    	} else {
    		tmp = (y - (log(y) * (y + 0.5))) - 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 ((x <= (-7.4d+22)) .or. (.not. (x <= 8d+78))) then
            tmp = x + (y * (1.0d0 - log(y)))
        else
            tmp = (y - (log(y) * (y + 0.5d0))) - z
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((x <= -7.4e+22) || !(x <= 8e+78)) {
    		tmp = x + (y * (1.0 - Math.log(y)));
    	} else {
    		tmp = (y - (Math.log(y) * (y + 0.5))) - z;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (x <= -7.4e+22) or not (x <= 8e+78):
    		tmp = x + (y * (1.0 - math.log(y)))
    	else:
    		tmp = (y - (math.log(y) * (y + 0.5))) - z
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if ((x <= -7.4e+22) || !(x <= 8e+78))
    		tmp = Float64(x + Float64(y * Float64(1.0 - log(y))));
    	else
    		tmp = Float64(Float64(y - Float64(log(y) * Float64(y + 0.5))) - z);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((x <= -7.4e+22) || ~((x <= 8e+78)))
    		tmp = x + (y * (1.0 - log(y)));
    	else
    		tmp = (y - (log(y) * (y + 0.5))) - z;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[Or[LessEqual[x, -7.4e+22], N[Not[LessEqual[x, 8e+78]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(N[Log[y], $MachinePrecision] * N[(y + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -7.4 \cdot 10^{+22} \lor \neg \left(x \leq 8 \cdot 10^{+78}\right):\\
    \;\;\;\;x + y \cdot \left(1 - \log y\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(y - \log y \cdot \left(y + 0.5\right)\right) - z\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -7.3999999999999996e22 or 8.00000000000000007e78 < x

      1. Initial program 99.9%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. associate--l+99.9%

          \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
        2. sub-neg99.9%

          \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
        3. associate-+l+100.0%

          \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
        4. *-commutative100.0%

          \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
        5. distribute-rgt-neg-in100.0%

          \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
        6. fma-def100.0%

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

          \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
        8. distribute-neg-in100.0%

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

          \[\leadsto x + \mathsf{fma}\left(\log y, \color{blue}{\left(-0.5\right) - y}, y - z\right) \]
        10. metadata-eval100.0%

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

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

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

          \[\leadsto x + y \cdot \left(1 + \color{blue}{\left(-\log y\right)}\right) \]
        2. sub-neg87.6%

          \[\leadsto x + y \cdot \color{blue}{\left(1 - \log y\right)} \]
      6. Simplified87.6%

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

      if -7.3999999999999996e22 < x < 8.00000000000000007e78

      1. Initial program 99.7%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.4 \cdot 10^{+22} \lor \neg \left(x \leq 8 \cdot 10^{+78}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - \log y \cdot \left(y + 0.5\right)\right) - z\\ \end{array} \]

    Alternative 5: 99.8% accurate, 1.0× speedup?

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

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

    Alternative 6: 70.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -330000000000 \lor \neg \left(z \leq 202\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (or (<= z -330000000000.0) (not (<= z 202.0)))
       (- x z)
       (- x (* (log y) 0.5))))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((z <= -330000000000.0) || !(z <= 202.0)) {
    		tmp = x - z;
    	} else {
    		tmp = x - (log(y) * 0.5);
    	}
    	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 <= (-330000000000.0d0)) .or. (.not. (z <= 202.0d0))) then
            tmp = x - z
        else
            tmp = x - (log(y) * 0.5d0)
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((z <= -330000000000.0) || !(z <= 202.0)) {
    		tmp = x - z;
    	} else {
    		tmp = x - (Math.log(y) * 0.5);
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (z <= -330000000000.0) or not (z <= 202.0):
    		tmp = x - z
    	else:
    		tmp = x - (math.log(y) * 0.5)
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if ((z <= -330000000000.0) || !(z <= 202.0))
    		tmp = Float64(x - z);
    	else
    		tmp = Float64(x - Float64(log(y) * 0.5));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((z <= -330000000000.0) || ~((z <= 202.0)))
    		tmp = x - z;
    	else
    		tmp = x - (log(y) * 0.5);
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[Or[LessEqual[z, -330000000000.0], N[Not[LessEqual[z, 202.0]], $MachinePrecision]], N[(x - z), $MachinePrecision], N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -330000000000 \lor \neg \left(z \leq 202\right):\\
    \;\;\;\;x - z\\
    
    \mathbf{else}:\\
    \;\;\;\;x - \log y \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -3.3e11 or 202 < z

      1. Initial program 99.9%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. add-cube-cbrt99.0%

          \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y} \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right) \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}} - z \]
        2. pow399.0%

          \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right)}^{3}} - z \]
        3. sub-neg99.0%

          \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + y}\right)}^{3} - z \]
        4. associate-+l+99.0%

          \[\leadsto {\left(\sqrt[3]{\color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + y\right)}}\right)}^{3} - z \]
        5. distribute-lft-neg-in99.0%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-\left(y + 0.5\right)\right) \cdot \log y} + y\right)}\right)}^{3} - z \]
        6. +-commutative99.0%

          \[\leadsto {\left(\sqrt[3]{x + \left(\left(-\color{blue}{\left(0.5 + y\right)}\right) \cdot \log y + y\right)}\right)}^{3} - z \]
        7. distribute-neg-in99.0%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(\left(-0.5\right) + \left(-y\right)\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
        8. metadata-eval99.0%

          \[\leadsto {\left(\sqrt[3]{x + \left(\left(\color{blue}{-0.5} + \left(-y\right)\right) \cdot \log y + y\right)}\right)}^{3} - z \]
        9. sub-neg99.0%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-0.5 - y\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
        10. *-commutative99.0%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\log y \cdot \left(-0.5 - y\right)} + y\right)}\right)}^{3} - z \]
      3. Applied egg-rr99.0%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x + \left(\log y \cdot \left(-0.5 - y\right) + y\right)}\right)}^{3}} - z \]
      4. Step-by-step derivation
        1. add-cube-cbrt99.0%

          \[\leadsto {\left(\sqrt[3]{x + \color{blue}{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y} \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right) \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}}}\right)}^{3} - z \]
        2. pow399.0%

          \[\leadsto {\left(\sqrt[3]{x + \color{blue}{{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right)}^{3}}}\right)}^{3} - z \]
        3. fma-def98.9%

          \[\leadsto {\left(\sqrt[3]{x + {\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(\log y, -0.5 - y, y\right)}}\right)}^{3}}\right)}^{3} - z \]
      5. Applied egg-rr98.9%

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

        \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot x} - z \]
      7. Step-by-step derivation
        1. pow-base-171.3%

          \[\leadsto \color{blue}{1} \cdot x - z \]
        2. *-lft-identity71.3%

          \[\leadsto \color{blue}{x} - z \]
      8. Simplified71.3%

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

      if -3.3e11 < z < 202

      1. Initial program 99.7%

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

        \[\leadsto \color{blue}{\left(x - 0.5 \cdot \log y\right)} - z \]
      3. Taylor expanded in z around 0 57.5%

        \[\leadsto \color{blue}{x - 0.5 \cdot \log y} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification64.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -330000000000 \lor \neg \left(z \leq 202\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \end{array} \]

    Alternative 7: 69.6% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -130 \lor \neg \left(x \leq 4.55 \cdot 10^{+36}\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (or (<= x -130.0) (not (<= x 4.55e+36))) (- x z) (- (* (log y) -0.5) z)))
    double code(double x, double y, double z) {
    	double tmp;
    	if ((x <= -130.0) || !(x <= 4.55e+36)) {
    		tmp = x - z;
    	} else {
    		tmp = (log(y) * -0.5) - 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 ((x <= (-130.0d0)) .or. (.not. (x <= 4.55d+36))) then
            tmp = x - z
        else
            tmp = (log(y) * (-0.5d0)) - z
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if ((x <= -130.0) || !(x <= 4.55e+36)) {
    		tmp = x - z;
    	} else {
    		tmp = (Math.log(y) * -0.5) - z;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if (x <= -130.0) or not (x <= 4.55e+36):
    		tmp = x - z
    	else:
    		tmp = (math.log(y) * -0.5) - z
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if ((x <= -130.0) || !(x <= 4.55e+36))
    		tmp = Float64(x - z);
    	else
    		tmp = Float64(Float64(log(y) * -0.5) - z);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if ((x <= -130.0) || ~((x <= 4.55e+36)))
    		tmp = x - z;
    	else
    		tmp = (log(y) * -0.5) - z;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[Or[LessEqual[x, -130.0], N[Not[LessEqual[x, 4.55e+36]], $MachinePrecision]], N[(x - z), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision] - z), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -130 \lor \neg \left(x \leq 4.55 \cdot 10^{+36}\right):\\
    \;\;\;\;x - z\\
    
    \mathbf{else}:\\
    \;\;\;\;\log y \cdot -0.5 - z\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -130 or 4.54999999999999995e36 < x

      1. Initial program 99.9%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. add-cube-cbrt98.3%

          \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y} \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right) \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}} - z \]
        2. pow398.3%

          \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right)}^{3}} - z \]
        3. sub-neg98.3%

          \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + y}\right)}^{3} - z \]
        4. associate-+l+98.3%

          \[\leadsto {\left(\sqrt[3]{\color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + y\right)}}\right)}^{3} - z \]
        5. distribute-lft-neg-in98.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-\left(y + 0.5\right)\right) \cdot \log y} + y\right)}\right)}^{3} - z \]
        6. +-commutative98.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\left(-\color{blue}{\left(0.5 + y\right)}\right) \cdot \log y + y\right)}\right)}^{3} - z \]
        7. distribute-neg-in98.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(\left(-0.5\right) + \left(-y\right)\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
        8. metadata-eval98.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\left(\color{blue}{-0.5} + \left(-y\right)\right) \cdot \log y + y\right)}\right)}^{3} - z \]
        9. sub-neg98.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-0.5 - y\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
        10. *-commutative98.3%

          \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\log y \cdot \left(-0.5 - y\right)} + y\right)}\right)}^{3} - z \]
      3. Applied egg-rr98.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{x + \left(\log y \cdot \left(-0.5 - y\right) + y\right)}\right)}^{3}} - z \]
      4. Step-by-step derivation
        1. add-cube-cbrt98.2%

          \[\leadsto {\left(\sqrt[3]{x + \color{blue}{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y} \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right) \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}}}\right)}^{3} - z \]
        2. pow398.3%

          \[\leadsto {\left(\sqrt[3]{x + \color{blue}{{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right)}^{3}}}\right)}^{3} - z \]
        3. fma-def98.3%

          \[\leadsto {\left(\sqrt[3]{x + {\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(\log y, -0.5 - y, y\right)}}\right)}^{3}}\right)}^{3} - z \]
      5. Applied egg-rr98.3%

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

        \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot x} - z \]
      7. Step-by-step derivation
        1. pow-base-174.7%

          \[\leadsto \color{blue}{1} \cdot x - z \]
        2. *-lft-identity74.7%

          \[\leadsto \color{blue}{x} - z \]
      8. Simplified74.7%

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

      if -130 < x < 4.54999999999999995e36

      1. Initial program 99.7%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. flip-+72.2%

          \[\leadsto \left(\left(x - \color{blue}{\frac{y \cdot y - 0.5 \cdot 0.5}{y - 0.5}} \cdot \log y\right) + y\right) - z \]
        2. associate-*l/72.2%

          \[\leadsto \left(\left(x - \color{blue}{\frac{\left(y \cdot y - 0.5 \cdot 0.5\right) \cdot \log y}{y - 0.5}}\right) + y\right) - z \]
        3. fma-neg72.2%

          \[\leadsto \left(\left(x - \frac{\color{blue}{\mathsf{fma}\left(y, y, -0.5 \cdot 0.5\right)} \cdot \log y}{y - 0.5}\right) + y\right) - z \]
        4. metadata-eval72.2%

          \[\leadsto \left(\left(x - \frac{\mathsf{fma}\left(y, y, -\color{blue}{0.25}\right) \cdot \log y}{y - 0.5}\right) + y\right) - z \]
        5. metadata-eval72.2%

          \[\leadsto \left(\left(x - \frac{\mathsf{fma}\left(y, y, \color{blue}{-0.25}\right) \cdot \log y}{y - 0.5}\right) + y\right) - z \]
        6. sub-neg72.2%

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

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

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

        \[\leadsto \color{blue}{\left(y - \frac{\log y \cdot \left({y}^{2} - 0.25\right)}{y - 0.5}\right)} - z \]
      5. Taylor expanded in y around 0 55.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -130 \lor \neg \left(x \leq 4.55 \cdot 10^{+36}\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \end{array} \]

    Alternative 8: 89.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 65000000000000:\\ \;\;\;\;\left(x - \log y \cdot 0.5\right) - z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y 65000000000000.0)
       (- (- x (* (log y) 0.5)) z)
       (+ x (* y (- 1.0 (log y))))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 65000000000000.0) {
    		tmp = (x - (log(y) * 0.5)) - z;
    	} else {
    		tmp = x + (y * (1.0 - log(y)));
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (y <= 65000000000000.0d0) then
            tmp = (x - (log(y) * 0.5d0)) - z
        else
            tmp = x + (y * (1.0d0 - log(y)))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (y <= 65000000000000.0) {
    		tmp = (x - (Math.log(y) * 0.5)) - z;
    	} else {
    		tmp = x + (y * (1.0 - Math.log(y)));
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= 65000000000000.0:
    		tmp = (x - (math.log(y) * 0.5)) - z
    	else:
    		tmp = x + (y * (1.0 - math.log(y)))
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= 65000000000000.0)
    		tmp = Float64(Float64(x - Float64(log(y) * 0.5)) - z);
    	else
    		tmp = Float64(x + Float64(y * Float64(1.0 - log(y))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= 65000000000000.0)
    		tmp = (x - (log(y) * 0.5)) - z;
    	else
    		tmp = x + (y * (1.0 - log(y)));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, 65000000000000.0], N[(N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 65000000000000:\\
    \;\;\;\;\left(x - \log y \cdot 0.5\right) - z\\
    
    \mathbf{else}:\\
    \;\;\;\;x + y \cdot \left(1 - \log y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 6.5e13

      1. Initial program 100.0%

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

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

      if 6.5e13 < y

      1. Initial program 99.6%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. associate--l+99.6%

          \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
        2. sub-neg99.6%

          \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
        3. associate-+l+99.6%

          \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
        4. *-commutative99.6%

          \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
        5. distribute-rgt-neg-in99.6%

          \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
        6. fma-def99.7%

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

          \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
        8. distribute-neg-in99.7%

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

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

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

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

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

          \[\leadsto x + y \cdot \left(1 + \color{blue}{\left(-\log y\right)}\right) \]
        2. sub-neg83.5%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 65000000000000:\\ \;\;\;\;\left(x - \log y \cdot 0.5\right) - z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \end{array} \]

    Alternative 9: 48.5% accurate, 18.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+24}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+38}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= x -3e+24) x (if (<= x 1.65e+38) (- z) x)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (x <= -3e+24) {
    		tmp = x;
    	} else if (x <= 1.65e+38) {
    		tmp = -z;
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: tmp
        if (x <= (-3d+24)) then
            tmp = x
        else if (x <= 1.65d+38) then
            tmp = -z
        else
            tmp = x
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double tmp;
    	if (x <= -3e+24) {
    		tmp = x;
    	} else if (x <= 1.65e+38) {
    		tmp = -z;
    	} else {
    		tmp = x;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if x <= -3e+24:
    		tmp = x
    	elif x <= 1.65e+38:
    		tmp = -z
    	else:
    		tmp = x
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (x <= -3e+24)
    		tmp = x;
    	elseif (x <= 1.65e+38)
    		tmp = Float64(-z);
    	else
    		tmp = x;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (x <= -3e+24)
    		tmp = x;
    	elseif (x <= 1.65e+38)
    		tmp = -z;
    	else
    		tmp = x;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[x, -3e+24], x, If[LessEqual[x, 1.65e+38], (-z), x]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -3 \cdot 10^{+24}:\\
    \;\;\;\;x\\
    
    \mathbf{elif}\;x \leq 1.65 \cdot 10^{+38}:\\
    \;\;\;\;-z\\
    
    \mathbf{else}:\\
    \;\;\;\;x\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -2.99999999999999995e24 or 1.65e38 < x

      1. Initial program 99.9%

        \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
      2. Step-by-step derivation
        1. associate--l+99.9%

          \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
        2. sub-neg99.9%

          \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
        3. associate-+l+99.9%

          \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
        4. *-commutative99.9%

          \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
        5. distribute-rgt-neg-in99.9%

          \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
        6. fma-def100.0%

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

          \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
        8. distribute-neg-in100.0%

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

          \[\leadsto x + \mathsf{fma}\left(\log y, \color{blue}{\left(-0.5\right) - y}, y - z\right) \]
        10. metadata-eval100.0%

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

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

        \[\leadsto \color{blue}{x} \]

      if -2.99999999999999995e24 < x < 1.65e38

      1. Initial program 99.7%

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

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

        \[\leadsto \color{blue}{-1 \cdot z} \]
      4. Step-by-step derivation
        1. neg-mul-134.1%

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

        \[\leadsto \color{blue}{-z} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification46.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3 \cdot 10^{+24}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{+38}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

    Alternative 10: 58.5% accurate, 37.0× speedup?

    \[\begin{array}{l} \\ x - z \end{array} \]
    (FPCore (x y z) :precision binary64 (- x z))
    double code(double x, double y, double z) {
    	return x - 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 - z
    end function
    
    public static double code(double x, double y, double z) {
    	return x - z;
    }
    
    def code(x, y, z):
    	return x - z
    
    function code(x, y, z)
    	return Float64(x - z)
    end
    
    function tmp = code(x, y, z)
    	tmp = x - z;
    end
    
    code[x_, y_, z_] := N[(x - z), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    x - 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. Step-by-step derivation
      1. add-cube-cbrt98.5%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y} \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right) \cdot \sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}} - z \]
      2. pow398.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(x - \left(y + 0.5\right) \cdot \log y\right) + y}\right)}^{3}} - z \]
      3. sub-neg98.5%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + y}\right)}^{3} - z \]
      4. associate-+l+98.5%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + y\right)}}\right)}^{3} - z \]
      5. distribute-lft-neg-in98.5%

        \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-\left(y + 0.5\right)\right) \cdot \log y} + y\right)}\right)}^{3} - z \]
      6. +-commutative98.5%

        \[\leadsto {\left(\sqrt[3]{x + \left(\left(-\color{blue}{\left(0.5 + y\right)}\right) \cdot \log y + y\right)}\right)}^{3} - z \]
      7. distribute-neg-in98.5%

        \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(\left(-0.5\right) + \left(-y\right)\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
      8. metadata-eval98.5%

        \[\leadsto {\left(\sqrt[3]{x + \left(\left(\color{blue}{-0.5} + \left(-y\right)\right) \cdot \log y + y\right)}\right)}^{3} - z \]
      9. sub-neg98.5%

        \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\left(-0.5 - y\right)} \cdot \log y + y\right)}\right)}^{3} - z \]
      10. *-commutative98.5%

        \[\leadsto {\left(\sqrt[3]{x + \left(\color{blue}{\log y \cdot \left(-0.5 - y\right)} + y\right)}\right)}^{3} - z \]
    3. Applied egg-rr98.5%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{x + \left(\log y \cdot \left(-0.5 - y\right) + y\right)}\right)}^{3}} - z \]
    4. Step-by-step derivation
      1. add-cube-cbrt98.4%

        \[\leadsto {\left(\sqrt[3]{x + \color{blue}{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y} \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right) \cdot \sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}}}\right)}^{3} - z \]
      2. pow398.4%

        \[\leadsto {\left(\sqrt[3]{x + \color{blue}{{\left(\sqrt[3]{\log y \cdot \left(-0.5 - y\right) + y}\right)}^{3}}}\right)}^{3} - z \]
      3. fma-def98.4%

        \[\leadsto {\left(\sqrt[3]{x + {\left(\sqrt[3]{\color{blue}{\mathsf{fma}\left(\log y, -0.5 - y, y\right)}}\right)}^{3}}\right)}^{3} - z \]
    5. Applied egg-rr98.4%

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

      \[\leadsto \color{blue}{{1}^{0.3333333333333333} \cdot x} - z \]
    7. Step-by-step derivation
      1. pow-base-151.4%

        \[\leadsto \color{blue}{1} \cdot x - z \]
      2. *-lft-identity51.4%

        \[\leadsto \color{blue}{x} - z \]
    8. Simplified51.4%

      \[\leadsto \color{blue}{x} - z \]
    9. Final simplification51.4%

      \[\leadsto x - z \]

    Alternative 11: 30.1% accurate, 111.0× speedup?

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

      \[\left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{\left(x - \left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)} \]
      2. sub-neg99.8%

        \[\leadsto \color{blue}{\left(x + \left(-\left(y + 0.5\right) \cdot \log y\right)\right)} + \left(y - z\right) \]
      3. associate-+l+99.8%

        \[\leadsto \color{blue}{x + \left(\left(-\left(y + 0.5\right) \cdot \log y\right) + \left(y - z\right)\right)} \]
      4. *-commutative99.8%

        \[\leadsto x + \left(\left(-\color{blue}{\log y \cdot \left(y + 0.5\right)}\right) + \left(y - z\right)\right) \]
      5. distribute-rgt-neg-in99.8%

        \[\leadsto x + \left(\color{blue}{\log y \cdot \left(-\left(y + 0.5\right)\right)} + \left(y - z\right)\right) \]
      6. fma-def99.9%

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

        \[\leadsto x + \mathsf{fma}\left(\log y, -\color{blue}{\left(0.5 + y\right)}, y - z\right) \]
      8. distribute-neg-in99.9%

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

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

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

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

      \[\leadsto \color{blue}{x} \]
    5. Final simplification27.3%

      \[\leadsto x \]

    Developer target: 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 2023318 
    (FPCore (x y z)
      :name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
      :precision binary64
    
      :herbie-target
      (- (- (+ y x) z) (* (+ y 0.5) (log y)))
    
      (- (+ (- x (* (+ y 0.5) (log y))) y) z))