Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

Percentage Accurate: 99.8% → 99.9%
Time: 13.3s
Alternatives: 14
Speedup: 0.5×

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

\\
\mathsf{fma}\left(\log y, -0.5 - y, y + \left(x - 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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 70.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x - \log y \cdot 0.5\\ \mathbf{if}\;y \leq 3.5 \cdot 10^{-133}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-82}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 12500000000000:\\ \;\;\;\;y + \left(x - z\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+56} \lor \neg \left(y \leq 5 \cdot 10^{+75}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- x (* (log y) 0.5))))
   (if (<= y 3.5e-133)
     t_0
     (if (<= y 4e-82)
       (- (* (log y) -0.5) z)
       (if (<= y 1.75e-18)
         t_0
         (if (<= y 12500000000000.0)
           (+ y (- x z))
           (if (or (<= y 1.35e+56) (not (<= y 5e+75)))
             (+ x (* y (- 1.0 (log y))))
             (- x z))))))))
double code(double x, double y, double z) {
	double t_0 = x - (log(y) * 0.5);
	double tmp;
	if (y <= 3.5e-133) {
		tmp = t_0;
	} else if (y <= 4e-82) {
		tmp = (log(y) * -0.5) - z;
	} else if (y <= 1.75e-18) {
		tmp = t_0;
	} else if (y <= 12500000000000.0) {
		tmp = y + (x - z);
	} else if ((y <= 1.35e+56) || !(y <= 5e+75)) {
		tmp = x + (y * (1.0 - log(y)));
	} else {
		tmp = x - 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) :: t_0
    real(8) :: tmp
    t_0 = x - (log(y) * 0.5d0)
    if (y <= 3.5d-133) then
        tmp = t_0
    else if (y <= 4d-82) then
        tmp = (log(y) * (-0.5d0)) - z
    else if (y <= 1.75d-18) then
        tmp = t_0
    else if (y <= 12500000000000.0d0) then
        tmp = y + (x - z)
    else if ((y <= 1.35d+56) .or. (.not. (y <= 5d+75))) then
        tmp = x + (y * (1.0d0 - log(y)))
    else
        tmp = x - z
    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 <= 3.5e-133) {
		tmp = t_0;
	} else if (y <= 4e-82) {
		tmp = (Math.log(y) * -0.5) - z;
	} else if (y <= 1.75e-18) {
		tmp = t_0;
	} else if (y <= 12500000000000.0) {
		tmp = y + (x - z);
	} else if ((y <= 1.35e+56) || !(y <= 5e+75)) {
		tmp = x + (y * (1.0 - Math.log(y)));
	} else {
		tmp = x - z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x - (math.log(y) * 0.5)
	tmp = 0
	if y <= 3.5e-133:
		tmp = t_0
	elif y <= 4e-82:
		tmp = (math.log(y) * -0.5) - z
	elif y <= 1.75e-18:
		tmp = t_0
	elif y <= 12500000000000.0:
		tmp = y + (x - z)
	elif (y <= 1.35e+56) or not (y <= 5e+75):
		tmp = x + (y * (1.0 - math.log(y)))
	else:
		tmp = x - z
	return tmp
function code(x, y, z)
	t_0 = Float64(x - Float64(log(y) * 0.5))
	tmp = 0.0
	if (y <= 3.5e-133)
		tmp = t_0;
	elseif (y <= 4e-82)
		tmp = Float64(Float64(log(y) * -0.5) - z);
	elseif (y <= 1.75e-18)
		tmp = t_0;
	elseif (y <= 12500000000000.0)
		tmp = Float64(y + Float64(x - z));
	elseif ((y <= 1.35e+56) || !(y <= 5e+75))
		tmp = Float64(x + Float64(y * Float64(1.0 - log(y))));
	else
		tmp = Float64(x - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x - (log(y) * 0.5);
	tmp = 0.0;
	if (y <= 3.5e-133)
		tmp = t_0;
	elseif (y <= 4e-82)
		tmp = (log(y) * -0.5) - z;
	elseif (y <= 1.75e-18)
		tmp = t_0;
	elseif (y <= 12500000000000.0)
		tmp = y + (x - z);
	elseif ((y <= 1.35e+56) || ~((y <= 5e+75)))
		tmp = x + (y * (1.0 - log(y)));
	else
		tmp = x - z;
	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, 3.5e-133], t$95$0, If[LessEqual[y, 4e-82], N[(N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.75e-18], t$95$0, If[LessEqual[y, 12500000000000.0], N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 1.35e+56], N[Not[LessEqual[y, 5e+75]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x - \log y \cdot 0.5\\
\mathbf{if}\;y \leq 3.5 \cdot 10^{-133}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 4 \cdot 10^{-82}:\\
\;\;\;\;\log y \cdot -0.5 - z\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{-18}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 12500000000000:\\
\;\;\;\;y + \left(x - z\right)\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+56} \lor \neg \left(y \leq 5 \cdot 10^{+75}\right):\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\

\mathbf{else}:\\
\;\;\;\;x - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 3.50000000000000003e-133 or 4e-82 < y < 1.7499999999999999e-18

    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. associate--l+100.0%

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

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

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

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

    if 3.50000000000000003e-133 < y < 4e-82

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \log y - z} \]
    6. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto \color{blue}{\log y \cdot -0.5} - z \]
    7. Simplified86.1%

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

    if 1.7499999999999999e-18 < y < 1.25e13

    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. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e13 < y < 1.35000000000000005e56 or 5.0000000000000002e75 < y

    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. associate--l+99.7%

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

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

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

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

        \[\leadsto \left(y + x\right) - \color{blue}{\left(-y \cdot \log \left(\frac{1}{y}\right)\right)} \]
      2. distribute-rgt-neg-in86.7%

        \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \left(-\log \left(\frac{1}{y}\right)\right)} \]
      3. log-rec86.7%

        \[\leadsto \left(y + x\right) - y \cdot \left(-\color{blue}{\left(-\log y\right)}\right) \]
      4. remove-double-neg86.7%

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

      \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \log y} \]
    8. Taylor expanded in y around 0 86.7%

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

    if 1.35000000000000005e56 < y < 5.0000000000000002e75

    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. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - \frac{-\left(-\log y\right) \cdot \color{blue}{\left(y \cdot y\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    8. Simplified100.0%

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

      \[\leadsto \color{blue}{x - z} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification84.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.5 \cdot 10^{-133}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-82}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-18}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 12500000000000:\\ \;\;\;\;y + \left(x - z\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+56} \lor \neg \left(y \leq 5 \cdot 10^{+75}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]

Alternative 4: 88.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + y \cdot \left(1 - \log y\right)\\ \mathbf{if}\;y \leq 225000000:\\ \;\;\;\;\left(x + \log y \cdot -0.5\right) - z\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+57}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{+75}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+190} \lor \neg \left(y \leq 8.8 \cdot 10^{+251}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;y - \left(z + y \cdot \log y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (* y (- 1.0 (log y))))))
   (if (<= y 225000000.0)
     (- (+ x (* (log y) -0.5)) z)
     (if (<= y 4.7e+57)
       t_0
       (if (<= y 7.1e+75)
         (- x z)
         (if (or (<= y 4.8e+190) (not (<= y 8.8e+251)))
           t_0
           (- y (+ z (* y (log y))))))))))
double code(double x, double y, double z) {
	double t_0 = x + (y * (1.0 - log(y)));
	double tmp;
	if (y <= 225000000.0) {
		tmp = (x + (log(y) * -0.5)) - z;
	} else if (y <= 4.7e+57) {
		tmp = t_0;
	} else if (y <= 7.1e+75) {
		tmp = x - z;
	} else if ((y <= 4.8e+190) || !(y <= 8.8e+251)) {
		tmp = t_0;
	} else {
		tmp = y - (z + (y * 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 + (y * (1.0d0 - log(y)))
    if (y <= 225000000.0d0) then
        tmp = (x + (log(y) * (-0.5d0))) - z
    else if (y <= 4.7d+57) then
        tmp = t_0
    else if (y <= 7.1d+75) then
        tmp = x - z
    else if ((y <= 4.8d+190) .or. (.not. (y <= 8.8d+251))) then
        tmp = t_0
    else
        tmp = y - (z + (y * log(y)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + (y * (1.0 - Math.log(y)));
	double tmp;
	if (y <= 225000000.0) {
		tmp = (x + (Math.log(y) * -0.5)) - z;
	} else if (y <= 4.7e+57) {
		tmp = t_0;
	} else if (y <= 7.1e+75) {
		tmp = x - z;
	} else if ((y <= 4.8e+190) || !(y <= 8.8e+251)) {
		tmp = t_0;
	} else {
		tmp = y - (z + (y * Math.log(y)));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + (y * (1.0 - math.log(y)))
	tmp = 0
	if y <= 225000000.0:
		tmp = (x + (math.log(y) * -0.5)) - z
	elif y <= 4.7e+57:
		tmp = t_0
	elif y <= 7.1e+75:
		tmp = x - z
	elif (y <= 4.8e+190) or not (y <= 8.8e+251):
		tmp = t_0
	else:
		tmp = y - (z + (y * math.log(y)))
	return tmp
function code(x, y, z)
	t_0 = Float64(x + Float64(y * Float64(1.0 - log(y))))
	tmp = 0.0
	if (y <= 225000000.0)
		tmp = Float64(Float64(x + Float64(log(y) * -0.5)) - z);
	elseif (y <= 4.7e+57)
		tmp = t_0;
	elseif (y <= 7.1e+75)
		tmp = Float64(x - z);
	elseif ((y <= 4.8e+190) || !(y <= 8.8e+251))
		tmp = t_0;
	else
		tmp = Float64(y - Float64(z + Float64(y * log(y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + (y * (1.0 - log(y)));
	tmp = 0.0;
	if (y <= 225000000.0)
		tmp = (x + (log(y) * -0.5)) - z;
	elseif (y <= 4.7e+57)
		tmp = t_0;
	elseif (y <= 7.1e+75)
		tmp = x - z;
	elseif ((y <= 4.8e+190) || ~((y <= 8.8e+251)))
		tmp = t_0;
	else
		tmp = y - (z + (y * log(y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 225000000.0], N[(N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 4.7e+57], t$95$0, If[LessEqual[y, 7.1e+75], N[(x - z), $MachinePrecision], If[Or[LessEqual[y, 4.8e+190], N[Not[LessEqual[y, 8.8e+251]], $MachinePrecision]], t$95$0, N[(y - N[(z + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4.7 \cdot 10^{+57}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 7.1 \cdot 10^{+75}:\\
\;\;\;\;x - z\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{+190} \lor \neg \left(y \leq 8.8 \cdot 10^{+251}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 2.25e8

    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. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.25e8 < y < 4.7000000000000003e57 or 7.09999999999999982e75 < y < 4.7999999999999997e190 or 8.7999999999999998e251 < y

    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. associate--l+99.7%

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

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

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

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

        \[\leadsto \left(y + x\right) - \color{blue}{\left(-y \cdot \log \left(\frac{1}{y}\right)\right)} \]
      2. distribute-rgt-neg-in88.4%

        \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \left(-\log \left(\frac{1}{y}\right)\right)} \]
      3. log-rec88.4%

        \[\leadsto \left(y + x\right) - y \cdot \left(-\color{blue}{\left(-\log y\right)}\right) \]
      4. remove-double-neg88.4%

        \[\leadsto \left(y + x\right) - y \cdot \color{blue}{\log y} \]
    7. Simplified88.4%

      \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \log y} \]
    8. Taylor expanded in y around 0 88.4%

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

    if 4.7000000000000003e57 < y < 7.09999999999999982e75

    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. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - \frac{-\left(-\log y\right) \cdot \color{blue}{\left(y \cdot y\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    8. Simplified100.0%

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

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

    if 4.7999999999999997e190 < y < 8.7999999999999998e251

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y + \left(\color{blue}{\log \left(\frac{1}{y}\right) \cdot y} - z\right) \]
      2. log-rec96.0%

        \[\leadsto y + \left(\color{blue}{\left(-\log y\right)} \cdot y - z\right) \]
      3. distribute-lft-neg-in96.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 225000000:\\ \;\;\;\;\left(x + \log y \cdot -0.5\right) - z\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+57}:\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{elif}\;y \leq 7.1 \cdot 10^{+75}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+190} \lor \neg \left(y \leq 8.8 \cdot 10^{+251}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;y - \left(z + y \cdot \log y\right)\\ \end{array} \]

Alternative 5: 66.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x - \log y \cdot 0.5\\ \mathbf{if}\;y \leq 9 \cdot 10^{-140}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;y + \left(x - z\right)\\ \mathbf{elif}\;y \leq 1.36 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+88}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;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 9e-140)
     t_0
     (if (<= y 2.1e-69)
       (+ y (- x z))
       (if (<= y 1.36e-18)
         t_0
         (if (<= y 4.9e+88) (- x z) (* 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 <= 9e-140) {
		tmp = t_0;
	} else if (y <= 2.1e-69) {
		tmp = y + (x - z);
	} else if (y <= 1.36e-18) {
		tmp = t_0;
	} else if (y <= 4.9e+88) {
		tmp = x - z;
	} else {
		tmp = 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 <= 9d-140) then
        tmp = t_0
    else if (y <= 2.1d-69) then
        tmp = y + (x - z)
    else if (y <= 1.36d-18) then
        tmp = t_0
    else if (y <= 4.9d+88) then
        tmp = x - z
    else
        tmp = 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 <= 9e-140) {
		tmp = t_0;
	} else if (y <= 2.1e-69) {
		tmp = y + (x - z);
	} else if (y <= 1.36e-18) {
		tmp = t_0;
	} else if (y <= 4.9e+88) {
		tmp = x - z;
	} else {
		tmp = 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 <= 9e-140:
		tmp = t_0
	elif y <= 2.1e-69:
		tmp = y + (x - z)
	elif y <= 1.36e-18:
		tmp = t_0
	elif y <= 4.9e+88:
		tmp = x - z
	else:
		tmp = 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 <= 9e-140)
		tmp = t_0;
	elseif (y <= 2.1e-69)
		tmp = Float64(y + Float64(x - z));
	elseif (y <= 1.36e-18)
		tmp = t_0;
	elseif (y <= 4.9e+88)
		tmp = Float64(x - z);
	else
		tmp = 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 <= 9e-140)
		tmp = t_0;
	elseif (y <= 2.1e-69)
		tmp = y + (x - z);
	elseif (y <= 1.36e-18)
		tmp = t_0;
	elseif (y <= 4.9e+88)
		tmp = x - z;
	else
		tmp = 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, 9e-140], t$95$0, If[LessEqual[y, 2.1e-69], N[(y + N[(x - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.36e-18], t$95$0, If[LessEqual[y, 4.9e+88], N[(x - z), $MachinePrecision], N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x - \log y \cdot 0.5\\
\mathbf{if}\;y \leq 9 \cdot 10^{-140}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-69}:\\
\;\;\;\;y + \left(x - z\right)\\

\mathbf{elif}\;y \leq 1.36 \cdot 10^{-18}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 4.9 \cdot 10^{+88}:\\
\;\;\;\;x - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 9.00000000000000008e-140 or 2.1e-69 < y < 1.3600000000000001e-18

    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. associate--l+100.0%

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

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

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

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

    if 9.00000000000000008e-140 < y < 2.1e-69

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3600000000000001e-18 < y < 4.9000000000000002e88

    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)} \]
    3. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x - \frac{\color{blue}{-1 \cdot \left({y}^{2} \cdot \log \left(\frac{1}{y}\right)\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    7. Step-by-step derivation
      1. mul-1-neg94.6%

        \[\leadsto \left(x - \frac{\color{blue}{-{y}^{2} \cdot \log \left(\frac{1}{y}\right)}}{y + -0.5}\right) + \left(y - z\right) \]
      2. *-commutative94.6%

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

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

        \[\leadsto \left(x - \frac{-\left(-\log y\right) \cdot \color{blue}{\left(y \cdot y\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    8. Simplified94.6%

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

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

    if 4.9000000000000002e88 < 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. sub-neg99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 9 \cdot 10^{-140}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;y + \left(x - z\right)\\ \mathbf{elif}\;y \leq 1.36 \cdot 10^{-18}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+88}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - \log y\right)\\ \end{array} \]

Alternative 6: 65.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x - \log y \cdot 0.5\\ \mathbf{if}\;y \leq 1.5 \cdot 10^{-135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-83}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+88}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;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 1.5e-135)
     t_0
     (if (<= y 1.25e-83)
       (- (* (log y) -0.5) z)
       (if (<= y 1.5e-18)
         t_0
         (if (<= y 4.6e+88) (- x z) (* 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 <= 1.5e-135) {
		tmp = t_0;
	} else if (y <= 1.25e-83) {
		tmp = (log(y) * -0.5) - z;
	} else if (y <= 1.5e-18) {
		tmp = t_0;
	} else if (y <= 4.6e+88) {
		tmp = x - z;
	} else {
		tmp = 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 <= 1.5d-135) then
        tmp = t_0
    else if (y <= 1.25d-83) then
        tmp = (log(y) * (-0.5d0)) - z
    else if (y <= 1.5d-18) then
        tmp = t_0
    else if (y <= 4.6d+88) then
        tmp = x - z
    else
        tmp = 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 <= 1.5e-135) {
		tmp = t_0;
	} else if (y <= 1.25e-83) {
		tmp = (Math.log(y) * -0.5) - z;
	} else if (y <= 1.5e-18) {
		tmp = t_0;
	} else if (y <= 4.6e+88) {
		tmp = x - z;
	} else {
		tmp = 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 <= 1.5e-135:
		tmp = t_0
	elif y <= 1.25e-83:
		tmp = (math.log(y) * -0.5) - z
	elif y <= 1.5e-18:
		tmp = t_0
	elif y <= 4.6e+88:
		tmp = x - z
	else:
		tmp = 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 <= 1.5e-135)
		tmp = t_0;
	elseif (y <= 1.25e-83)
		tmp = Float64(Float64(log(y) * -0.5) - z);
	elseif (y <= 1.5e-18)
		tmp = t_0;
	elseif (y <= 4.6e+88)
		tmp = Float64(x - z);
	else
		tmp = 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 <= 1.5e-135)
		tmp = t_0;
	elseif (y <= 1.25e-83)
		tmp = (log(y) * -0.5) - z;
	elseif (y <= 1.5e-18)
		tmp = t_0;
	elseif (y <= 4.6e+88)
		tmp = x - z;
	else
		tmp = 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, 1.5e-135], t$95$0, If[LessEqual[y, 1.25e-83], N[(N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.5e-18], t$95$0, If[LessEqual[y, 4.6e+88], N[(x - z), $MachinePrecision], N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x - \log y \cdot 0.5\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-135}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-83}:\\
\;\;\;\;\log y \cdot -0.5 - z\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-18}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+88}:\\
\;\;\;\;x - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 1.50000000000000006e-135 or 1.25e-83 < y < 1.49999999999999991e-18

    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. associate--l+100.0%

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

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

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

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

    if 1.50000000000000006e-135 < y < 1.25e-83

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \log y - z} \]
    6. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto \color{blue}{\log y \cdot -0.5} - z \]
    7. Simplified86.1%

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

    if 1.49999999999999991e-18 < y < 4.6000000000000003e88

    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)} \]
    3. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x - \frac{\color{blue}{-1 \cdot \left({y}^{2} \cdot \log \left(\frac{1}{y}\right)\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    7. Step-by-step derivation
      1. mul-1-neg94.6%

        \[\leadsto \left(x - \frac{\color{blue}{-{y}^{2} \cdot \log \left(\frac{1}{y}\right)}}{y + -0.5}\right) + \left(y - z\right) \]
      2. *-commutative94.6%

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

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

        \[\leadsto \left(x - \frac{-\left(-\log y\right) \cdot \color{blue}{\left(y \cdot y\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    8. Simplified94.6%

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

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

    if 4.6000000000000003e88 < 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. sub-neg99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-135}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-83}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-18}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+88}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - \log y\right)\\ \end{array} \]

Alternative 7: 88.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 470000000000:\\ \;\;\;\;\left(x + \log y \cdot -0.5\right) - z\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+57} \lor \neg \left(y \leq 5 \cdot 10^{+75}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y 470000000000.0)
   (- (+ x (* (log y) -0.5)) z)
   (if (or (<= y 3.4e+57) (not (<= y 5e+75)))
     (+ x (* y (- 1.0 (log y))))
     (- x z))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= 470000000000.0) {
		tmp = (x + (log(y) * -0.5)) - z;
	} else if ((y <= 3.4e+57) || !(y <= 5e+75)) {
		tmp = x + (y * (1.0 - log(y)));
	} else {
		tmp = x - 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 (y <= 470000000000.0d0) then
        tmp = (x + (log(y) * (-0.5d0))) - z
    else if ((y <= 3.4d+57) .or. (.not. (y <= 5d+75))) then
        tmp = x + (y * (1.0d0 - log(y)))
    else
        tmp = x - z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= 470000000000.0) {
		tmp = (x + (Math.log(y) * -0.5)) - z;
	} else if ((y <= 3.4e+57) || !(y <= 5e+75)) {
		tmp = x + (y * (1.0 - Math.log(y)));
	} else {
		tmp = x - z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= 470000000000.0:
		tmp = (x + (math.log(y) * -0.5)) - z
	elif (y <= 3.4e+57) or not (y <= 5e+75):
		tmp = x + (y * (1.0 - math.log(y)))
	else:
		tmp = x - z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= 470000000000.0)
		tmp = Float64(Float64(x + Float64(log(y) * -0.5)) - z);
	elseif ((y <= 3.4e+57) || !(y <= 5e+75))
		tmp = Float64(x + Float64(y * Float64(1.0 - log(y))));
	else
		tmp = Float64(x - z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= 470000000000.0)
		tmp = (x + (log(y) * -0.5)) - z;
	elseif ((y <= 3.4e+57) || ~((y <= 5e+75)))
		tmp = x + (y * (1.0 - log(y)));
	else
		tmp = x - z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, 470000000000.0], N[(N[(x + N[(N[Log[y], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], If[Or[LessEqual[y, 3.4e+57], N[Not[LessEqual[y, 5e+75]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 470000000000:\\
\;\;\;\;\left(x + \log y \cdot -0.5\right) - z\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{+57} \lor \neg \left(y \leq 5 \cdot 10^{+75}\right):\\
\;\;\;\;x + y \cdot \left(1 - \log y\right)\\

\mathbf{else}:\\
\;\;\;\;x - z\\


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

    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. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.7e11 < y < 3.39999999999999992e57 or 5.0000000000000002e75 < y

    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. associate--l+99.7%

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

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

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

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

        \[\leadsto \left(y + x\right) - \color{blue}{\left(-y \cdot \log \left(\frac{1}{y}\right)\right)} \]
      2. distribute-rgt-neg-in86.7%

        \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \left(-\log \left(\frac{1}{y}\right)\right)} \]
      3. log-rec86.7%

        \[\leadsto \left(y + x\right) - y \cdot \left(-\color{blue}{\left(-\log y\right)}\right) \]
      4. remove-double-neg86.7%

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

      \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \log y} \]
    8. Taylor expanded in y around 0 86.7%

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

    if 3.39999999999999992e57 < y < 5.0000000000000002e75

    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. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - \frac{-\left(-\log y\right) \cdot \color{blue}{\left(y \cdot y\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    8. Simplified100.0%

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

      \[\leadsto \color{blue}{x - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 470000000000:\\ \;\;\;\;\left(x + \log y \cdot -0.5\right) - z\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+57} \lor \neg \left(y \leq 5 \cdot 10^{+75}\right):\\ \;\;\;\;x + y \cdot \left(1 - \log y\right)\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]

Alternative 8: 88.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+69}:\\
\;\;\;\;\left(y - z\right) - y \cdot \log y\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+135}:\\
\;\;\;\;y + \left(x - \log y \cdot \left(y + 0.5\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x - z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.39999999999999991e69

    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. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999991e69 < z < 2.6e135

    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)} \]
    3. Simplified99.8%

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

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

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

        \[\leadsto y + \left(x - \color{blue}{\log y \cdot \left(0.5 + y\right)}\right) \]
      3. +-commutative96.8%

        \[\leadsto y + \left(x - \log y \cdot \color{blue}{\left(y + 0.5\right)}\right) \]
    6. Applied egg-rr96.8%

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

    if 2.6e135 < z

    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. associate--l+100.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(x - \frac{\color{blue}{-1 \cdot \left({y}^{2} \cdot \log \left(\frac{1}{y}\right)\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    7. Step-by-step derivation
      1. mul-1-neg75.6%

        \[\leadsto \left(x - \frac{\color{blue}{-{y}^{2} \cdot \log \left(\frac{1}{y}\right)}}{y + -0.5}\right) + \left(y - z\right) \]
      2. *-commutative75.6%

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

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

        \[\leadsto \left(x - \frac{-\left(-\log y\right) \cdot \color{blue}{\left(y \cdot y\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    8. Simplified75.6%

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

      \[\leadsto \color{blue}{x - z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+69}:\\ \;\;\;\;\left(y - z\right) - y \cdot \log y\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+135}:\\ \;\;\;\;y + \left(x - \log y \cdot \left(y + 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]

Alternative 9: 99.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.28:\\
\;\;\;\;\left(x + \log y \cdot -0.5\right) - z\\

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


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

    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. sub-neg99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.28000000000000003 < y

    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. associate--l+99.7%

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

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

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

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

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

        \[\leadsto \left(x - y \cdot \left(-\color{blue}{\left(-\log y\right)}\right)\right) + \left(y - z\right) \]
      4. remove-double-neg99.2%

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

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

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

Alternative 10: 99.8% accurate, 1.0× speedup?

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

\\
\left(x - \log y \cdot \left(y + 0.5\right)\right) + \left(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)} \]
  3. Simplified99.8%

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

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

Alternative 11: 71.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{+88}:\\
\;\;\;\;y + \left(x - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.40000000000000004e88

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.40000000000000004e88 < 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. sub-neg99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 46.5% accurate, 18.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+167}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.55e+104) (- z) (if (<= z 1.3e+167) x (- z))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.55e+104) {
		tmp = -z;
	} else if (z <= 1.3e+167) {
		tmp = x;
	} else {
		tmp = -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 <= (-1.55d+104)) then
        tmp = -z
    else if (z <= 1.3d+167) then
        tmp = x
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.55e+104) {
		tmp = -z;
	} else if (z <= 1.3e+167) {
		tmp = x;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.55e+104:
		tmp = -z
	elif z <= 1.3e+167:
		tmp = x
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.55e+104)
		tmp = Float64(-z);
	elseif (z <= 1.3e+167)
		tmp = x;
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.55e+104)
		tmp = -z;
	elseif (z <= 1.3e+167)
		tmp = x;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.55e+104], (-z), If[LessEqual[z, 1.3e+167], x, (-z)]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+104}:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{+167}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.55000000000000008e104 or 1.3000000000000001e167 < z

    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. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-z} \]
    6. Simplified81.2%

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

    if -1.55000000000000008e104 < z < 1.3000000000000001e167

    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)} \]
    3. Simplified99.8%

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

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

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

        \[\leadsto \left(y + x\right) - \color{blue}{\left(-y \cdot \log \left(\frac{1}{y}\right)\right)} \]
      2. distribute-rgt-neg-in76.0%

        \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \left(-\log \left(\frac{1}{y}\right)\right)} \]
      3. log-rec76.0%

        \[\leadsto \left(y + x\right) - y \cdot \left(-\color{blue}{\left(-\log y\right)}\right) \]
      4. remove-double-neg76.0%

        \[\leadsto \left(y + x\right) - y \cdot \color{blue}{\log y} \]
    7. Simplified76.0%

      \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \log y} \]
    8. Taylor expanded in y around 0 36.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{+167}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 13: 58.0% 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. associate--l+99.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(x - \frac{\color{blue}{-1 \cdot \left({y}^{2} \cdot \log \left(\frac{1}{y}\right)\right)}}{y + -0.5}\right) + \left(y - z\right) \]
  7. Step-by-step derivation
    1. mul-1-neg59.4%

      \[\leadsto \left(x - \frac{\color{blue}{-{y}^{2} \cdot \log \left(\frac{1}{y}\right)}}{y + -0.5}\right) + \left(y - z\right) \]
    2. *-commutative59.4%

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

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

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

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

    \[\leadsto \color{blue}{x - z} \]
  10. Final simplification51.2%

    \[\leadsto x - z \]

Alternative 14: 29.7% 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)} \]
  3. Simplified99.8%

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

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

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

      \[\leadsto \left(y + x\right) - \color{blue}{\left(-y \cdot \log \left(\frac{1}{y}\right)\right)} \]
    2. distribute-rgt-neg-in63.0%

      \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \left(-\log \left(\frac{1}{y}\right)\right)} \]
    3. log-rec63.0%

      \[\leadsto \left(y + x\right) - y \cdot \left(-\color{blue}{\left(-\log y\right)}\right) \]
    4. remove-double-neg63.0%

      \[\leadsto \left(y + x\right) - y \cdot \color{blue}{\log y} \]
  7. Simplified63.0%

    \[\leadsto \left(y + x\right) - \color{blue}{y \cdot \log y} \]
  8. Taylor expanded in y around 0 29.4%

    \[\leadsto \color{blue}{x} \]
  9. Final simplification29.4%

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