Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+115}:\\
\;\;\;\;x - z\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.00000000000000011e115

    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)} \]
      2. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.00000000000000011e115 < z < -7e12

    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. Add Preprocessing
    5. Taylor expanded in y around inf 98.4%

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

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

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

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

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

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

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

    if -7e12 < z < 4.2e21

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \left(y + \color{blue}{-1 \cdot \left(y \cdot \log y\right)}\right)\right) + \left(-0.5 \cdot \log y\right) \]
      7. associate-+r+99.0%

        \[\leadsto \color{blue}{\left(\left(x + y\right) + -1 \cdot \left(y \cdot \log y\right)\right)} + \left(-0.5 \cdot \log y\right) \]
      8. associate-+r+99.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \left(-1 \cdot \left(y \cdot \log y\right) + \left(-0.5 \cdot \log y\right)\right)} \]
      9. neg-mul-199.0%

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

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

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

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

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

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

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

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

    if 4.2e21 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \left(1 + -1 \cdot \log y\right) + \left(-z\right)} \]
      3. neg-mul-191.7%

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

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

        \[\leadsto \color{blue}{y \cdot \left(1 - \log y\right) - z} \]
    8. Simplified91.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+115}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;z \leq -7000000000000:\\ \;\;\;\;y - \left(z + y \cdot \log y\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{+21}:\\ \;\;\;\;x + \left(y - \log y \cdot \left(y + 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - \log y\right) - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 70.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+114}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;z \leq -39000000 \lor \neg \left(z \leq 0.47\right):\\ \;\;\;\;y - \left(z + y \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -5.5e+114)
   (- x z)
   (if (or (<= z -39000000.0) (not (<= z 0.47)))
     (- y (+ z (* y (log y))))
     (- x (* (log y) 0.5)))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -5.5e+114) {
		tmp = x - z;
	} else if ((z <= -39000000.0) || !(z <= 0.47)) {
		tmp = y - (z + (y * log(y)));
	} else {
		tmp = x - (log(y) * 0.5);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (z <= (-5.5d+114)) then
        tmp = x - z
    else if ((z <= (-39000000.0d0)) .or. (.not. (z <= 0.47d0))) then
        tmp = y - (z + (y * log(y)))
    else
        tmp = x - (log(y) * 0.5d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -5.5e+114) {
		tmp = x - z;
	} else if ((z <= -39000000.0) || !(z <= 0.47)) {
		tmp = y - (z + (y * Math.log(y)));
	} else {
		tmp = x - (Math.log(y) * 0.5);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -5.5e+114:
		tmp = x - z
	elif (z <= -39000000.0) or not (z <= 0.47):
		tmp = y - (z + (y * math.log(y)))
	else:
		tmp = x - (math.log(y) * 0.5)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -5.5e+114)
		tmp = Float64(x - z);
	elseif ((z <= -39000000.0) || !(z <= 0.47))
		tmp = Float64(y - Float64(z + Float64(y * log(y))));
	else
		tmp = Float64(x - Float64(log(y) * 0.5));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -5.5e+114)
		tmp = x - z;
	elseif ((z <= -39000000.0) || ~((z <= 0.47)))
		tmp = y - (z + (y * log(y)));
	else
		tmp = x - (log(y) * 0.5);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -5.5e+114], N[(x - z), $MachinePrecision], If[Or[LessEqual[z, -39000000.0], N[Not[LessEqual[z, 0.47]], $MachinePrecision]], N[(y - N[(z + N[(y * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+114}:\\
\;\;\;\;x - z\\

\mathbf{elif}\;z \leq -39000000 \lor \neg \left(z \leq 0.47\right):\\
\;\;\;\;y - \left(z + y \cdot \log y\right)\\

\mathbf{else}:\\
\;\;\;\;x - \log y \cdot 0.5\\


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

    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)} \]
      2. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5000000000000001e114 < z < -3.9e7 or 0.46999999999999997 < z

    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. Add Preprocessing
    5. Taylor expanded in y around inf 99.5%

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

        \[\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.5%

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

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

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

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

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

    if -3.9e7 < z < 0.46999999999999997

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+114}:\\ \;\;\;\;x - z\\ \mathbf{elif}\;z \leq -39000000 \lor \neg \left(z \leq 0.47\right):\\ \;\;\;\;y - \left(z + y \cdot \log y\right)\\ \mathbf{else}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 69.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{+135} \lor \neg \left(y \leq 2.8 \cdot 10^{+202}\right) \land y \leq 1.95 \cdot 10^{+222}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - \log y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y 1.7e+135) (and (not (<= y 2.8e+202)) (<= y 1.95e+222)))
   (- x z)
   (* y (- 1.0 (log y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= 1.7e+135) || (!(y <= 2.8e+202) && (y <= 1.95e+222))) {
		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) :: tmp
    if ((y <= 1.7d+135) .or. (.not. (y <= 2.8d+202)) .and. (y <= 1.95d+222)) 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 tmp;
	if ((y <= 1.7e+135) || (!(y <= 2.8e+202) && (y <= 1.95e+222))) {
		tmp = x - z;
	} else {
		tmp = y * (1.0 - Math.log(y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= 1.7e+135) or (not (y <= 2.8e+202) and (y <= 1.95e+222)):
		tmp = x - z
	else:
		tmp = y * (1.0 - math.log(y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= 1.7e+135) || (!(y <= 2.8e+202) && (y <= 1.95e+222)))
		tmp = 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 <= 1.7e+135) || (~((y <= 2.8e+202)) && (y <= 1.95e+222)))
		tmp = x - z;
	else
		tmp = y * (1.0 - log(y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, 1.7e+135], And[N[Not[LessEqual[y, 2.8e+202]], $MachinePrecision], LessEqual[y, 1.95e+222]]], N[(x - z), $MachinePrecision], N[(y * N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{+135} \lor \neg \left(y \leq 2.8 \cdot 10^{+202}\right) \land y \leq 1.95 \cdot 10^{+222}:\\
\;\;\;\;x - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.70000000000000005e135 or 2.80000000000000016e202 < y < 1.9499999999999999e222

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.70000000000000005e135 < y < 2.80000000000000016e202 or 1.9499999999999999e222 < y

    1. Initial program 99.6%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(1 - \log y\right) - 0.5 \cdot \log y} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv77.2%

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

        \[\leadsto y \cdot \color{blue}{\left(1 + \left(-\log y\right)\right)} + \left(-0.5\right) \cdot \log y \]
      3. distribute-lft-in77.2%

        \[\leadsto \color{blue}{\left(y \cdot 1 + y \cdot \left(-\log y\right)\right)} + \left(-0.5\right) \cdot \log y \]
      4. *-rgt-identity77.2%

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

        \[\leadsto \left(y + \color{blue}{\left(-y \cdot \log y\right)}\right) + \left(-0.5\right) \cdot \log y \]
      6. distribute-lft-neg-out77.2%

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

        \[\leadsto \left(y + \left(-y\right) \cdot \log y\right) + \color{blue}{-0.5} \cdot \log y \]
      8. associate-+l+77.2%

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

        \[\leadsto y + \color{blue}{\left(-0.5 \cdot \log y + \left(-y\right) \cdot \log y\right)} \]
      10. distribute-rgt-in77.2%

        \[\leadsto y + \color{blue}{\log y \cdot \left(-0.5 + \left(-y\right)\right)} \]
      11. sub-neg77.2%

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(1 - \log y\right)} \]
    10. Simplified77.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{+135} \lor \neg \left(y \leq 2.8 \cdot 10^{+202}\right) \land y \leq 1.95 \cdot 10^{+222}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(1 - \log y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.5% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.084:\\
\;\;\;\;x - z\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-91}:\\
\;\;\;\;y \cdot \left(1 - \log y\right)\\

\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;\log y \cdot -0.5 - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -0.0840000000000000052 or 0.92000000000000004 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0840000000000000052 < x < -8.49999999999999985e-91

    1. Initial program 99.4%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(1 - \log y\right) - 0.5 \cdot \log y} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv89.0%

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

        \[\leadsto y \cdot \color{blue}{\left(1 + \left(-\log y\right)\right)} + \left(-0.5\right) \cdot \log y \]
      3. distribute-lft-in89.0%

        \[\leadsto \color{blue}{\left(y \cdot 1 + y \cdot \left(-\log y\right)\right)} + \left(-0.5\right) \cdot \log y \]
      4. *-rgt-identity89.0%

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

        \[\leadsto \left(y + \color{blue}{\left(-y \cdot \log y\right)}\right) + \left(-0.5\right) \cdot \log y \]
      6. distribute-lft-neg-out89.0%

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

        \[\leadsto \left(y + \left(-y\right) \cdot \log y\right) + \color{blue}{-0.5} \cdot \log y \]
      8. associate-+l+89.0%

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

        \[\leadsto y + \color{blue}{\left(-0.5 \cdot \log y + \left(-y\right) \cdot \log y\right)} \]
      10. distribute-rgt-in89.1%

        \[\leadsto y + \color{blue}{\log y \cdot \left(-0.5 + \left(-y\right)\right)} \]
      11. sub-neg89.1%

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\left(1 - \log y\right)} \]
    10. Simplified62.8%

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

    if -8.49999999999999985e-91 < x < 0.92000000000000004

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot -0.5} - z \]
    8. Simplified72.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.084:\\ \;\;\;\;x - z\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-91}:\\ \;\;\;\;y \cdot \left(1 - \log y\right)\\ \mathbf{elif}\;x \leq 0.92:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -200:\\
\;\;\;\;x - z\\

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

\mathbf{elif}\;x \leq 0.92:\\
\;\;\;\;\log y \cdot -0.5 - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -200 or 0.92000000000000004 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -200 < x < -6.99999999999999989e-101

    1. Initial program 99.4%

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(1 - \log y\right) - 0.5 \cdot \log y} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv89.0%

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

        \[\leadsto y \cdot \color{blue}{\left(1 + \left(-\log y\right)\right)} + \left(-0.5\right) \cdot \log y \]
      3. distribute-lft-in89.0%

        \[\leadsto \color{blue}{\left(y \cdot 1 + y \cdot \left(-\log y\right)\right)} + \left(-0.5\right) \cdot \log y \]
      4. *-rgt-identity89.0%

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

        \[\leadsto \left(y + \color{blue}{\left(-y \cdot \log y\right)}\right) + \left(-0.5\right) \cdot \log y \]
      6. distribute-lft-neg-out89.0%

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

        \[\leadsto \left(y + \left(-y\right) \cdot \log y\right) + \color{blue}{-0.5} \cdot \log y \]
      8. associate-+l+89.0%

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

        \[\leadsto y + \color{blue}{\left(-0.5 \cdot \log y + \left(-y\right) \cdot \log y\right)} \]
      10. distribute-rgt-in89.1%

        \[\leadsto y + \color{blue}{\log y \cdot \left(-0.5 + \left(-y\right)\right)} \]
      11. sub-neg89.1%

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

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

    if -6.99999999999999989e-101 < x < 0.92000000000000004

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot -0.5} - z \]
    8. Simplified72.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -200:\\ \;\;\;\;x - z\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-101}:\\ \;\;\;\;y + \log y \cdot \left(-0.5 - y\right)\\ \mathbf{elif}\;x \leq 0.92:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{else}:\\ \;\;\;\;x - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.7% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-262}:\\
\;\;\;\;\log y \cdot -0.5 - z\\

\mathbf{elif}\;y \leq 24000000000:\\
\;\;\;\;x - z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 6.1999999999999997e-262

    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)} \]
      2. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\log y \cdot -0.5} - z \]
    8. Simplified80.9%

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

    if 6.1999999999999997e-262 < y < 2.4e10

    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)} \]
      2. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4e10 < y

    1. Initial program 99.6%

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

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

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

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

        \[\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.4%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{-262}:\\ \;\;\;\;\log y \cdot -0.5 - z\\ \mathbf{elif}\;y \leq 24000000000:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - y \cdot \log y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 70.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -33500000 \lor \neg \left(z \leq 165\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -33500000.0) (not (<= z 165.0))) (- x z) (- x (* (log y) 0.5))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -33500000.0) || !(z <= 165.0)) {
		tmp = x - z;
	} else {
		tmp = x - (log(y) * 0.5);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-33500000.0d0)) .or. (.not. (z <= 165.0d0))) then
        tmp = x - z
    else
        tmp = x - (log(y) * 0.5d0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -33500000.0) || !(z <= 165.0)) {
		tmp = x - z;
	} else {
		tmp = x - (Math.log(y) * 0.5);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -33500000.0) or not (z <= 165.0):
		tmp = x - z
	else:
		tmp = x - (math.log(y) * 0.5)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -33500000.0) || !(z <= 165.0))
		tmp = Float64(x - z);
	else
		tmp = Float64(x - Float64(log(y) * 0.5));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -33500000.0) || ~((z <= 165.0)))
		tmp = x - z;
	else
		tmp = x - (log(y) * 0.5);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -33500000.0], N[Not[LessEqual[z, 165.0]], $MachinePrecision]], N[(x - z), $MachinePrecision], N[(x - N[(N[Log[y], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -33500000 \lor \neg \left(z \leq 165\right):\\
\;\;\;\;x - z\\

\mathbf{else}:\\
\;\;\;\;x - \log y \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.35e7 or 165 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.35e7 < z < 165

    1. Initial program 99.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -33500000 \lor \neg \left(z \leq 165\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;x - \log y \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 99.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.0000000000000001e-8

    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)} \]
      2. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.0000000000000001e-8 < 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)} \]
      2. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 89.5% accurate, 1.0× speedup?

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

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

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


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

    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)} \]
      2. sub-neg100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1e10 < y

    1. Initial program 99.6%

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

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

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

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

        \[\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.4%

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

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

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

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

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

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

Alternative 11: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

Alternative 12: 48.5% accurate, 9.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6700000000000 \lor \neg \left(z \leq 1.16 \cdot 10^{+26}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -6700000000000.0) (not (<= z 1.16e+26))) (- z) x))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -6700000000000.0) || !(z <= 1.16e+26)) {
		tmp = -z;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-6700000000000.0d0)) .or. (.not. (z <= 1.16d+26))) then
        tmp = -z
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -6700000000000.0) || !(z <= 1.16e+26)) {
		tmp = -z;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -6700000000000.0) or not (z <= 1.16e+26):
		tmp = -z
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -6700000000000.0) || !(z <= 1.16e+26))
		tmp = Float64(-z);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -6700000000000.0) || ~((z <= 1.16e+26)))
		tmp = -z;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -6700000000000.0], N[Not[LessEqual[z, 1.16e+26]], $MachinePrecision]], (-z), x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6700000000000 \lor \neg \left(z \leq 1.16 \cdot 10^{+26}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.7e12 or 1.15999999999999996e26 < z

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-z} \]
    7. Simplified63.7%

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

    if -6.7e12 < z < 1.15999999999999996e26

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6700000000000 \lor \neg \left(z \leq 1.16 \cdot 10^{+26}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 57.6% 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)} \]
    2. sub-neg99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} - z \]
  7. Final simplification60.5%

    \[\leadsto x - z \]
  8. Add Preprocessing

Alternative 14: 29.6% accurate, 111.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification33.0%

    \[\leadsto x \]
  7. Add Preprocessing

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 2024039 
(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))