Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2

Percentage Accurate: 99.8% → 99.8%
Time: 7.2s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(x - \left(y + 0.5\right) \cdot \log y\right) + y\right) - z \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ (- x (* (+ y 0.5) (log y))) y) z))
double code(double x, double y, double z) {
	return ((x - ((y + 0.5) * log(y))) + y) - z;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z)
use fmin_fmax_functions
    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 10 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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 99.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right) - z\\

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


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

    1. Initial program 100.0%

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

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

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

      if 4.79999999999999957e-7 < y

      1. Initial program 99.6%

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

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

          \[\leadsto \left(\left(x - \color{blue}{\log y \cdot y}\right) + y\right) - z \]
      5. Recombined 2 regimes into one program.
      6. Add Preprocessing

      Alternative 3: 69.5% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+15} \lor \neg \left(z \leq 210\right):\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (or (<= z -1e+15) (not (<= z 210.0))) (- x z) (fma -0.5 (log y) x)))
      double code(double x, double y, double z) {
      	double tmp;
      	if ((z <= -1e+15) || !(z <= 210.0)) {
      		tmp = x - z;
      	} else {
      		tmp = fma(-0.5, log(y), x);
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if ((z <= -1e+15) || !(z <= 210.0))
      		tmp = Float64(x - z);
      	else
      		tmp = fma(-0.5, log(y), x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[Or[LessEqual[z, -1e+15], N[Not[LessEqual[z, 210.0]], $MachinePrecision]], N[(x - z), $MachinePrecision], N[(-0.5 * N[Log[y], $MachinePrecision] + x), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;z \leq -1 \cdot 10^{+15} \lor \neg \left(z \leq 210\right):\\
      \;\;\;\;x - z\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(-0.5, \log y, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1e15 or 210 < 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 x around inf

          \[\leadsto \color{blue}{x} - z \]
        4. Step-by-step derivation
          1. Applied rewrites78.6%

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

          if -1e15 < z < 210

          1. Initial program 99.7%

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

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

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

              \[\leadsto x + \color{blue}{\frac{-1}{2} \cdot \log y} \]
            3. Applied rewrites62.7%

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

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

          Alternative 4: 89.5% accurate, 1.0× speedup?

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

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{\left(x - \frac{1}{2} \cdot \log y\right)} - z \]
            4. Step-by-step derivation
              1. Applied rewrites94.8%

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

              if 3.80000000000000011e87 < y

              1. Initial program 99.5%

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

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

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

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

                Alternative 5: 89.5% accurate, 1.0× speedup?

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

                  1. Initial program 99.9%

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

                    \[\leadsto \color{blue}{\left(x - \frac{1}{2} \cdot \log y\right)} - z \]
                  4. Step-by-step derivation
                    1. Applied rewrites94.8%

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

                    if 3.80000000000000011e87 < y

                    1. Initial program 99.5%

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

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

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

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

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

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

                        Alternative 6: 83.7% accurate, 1.0× speedup?

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

                          1. Initial program 99.9%

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

                            \[\leadsto \color{blue}{\left(x - \frac{1}{2} \cdot \log y\right)} - z \]
                          4. Step-by-step derivation
                            1. Applied rewrites89.8%

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

                            if 4.00000000000000007e141 < y

                            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 inf

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

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

                            Alternative 7: 71.4% accurate, 1.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4 \cdot 10^{+141}:\\ \;\;\;\;x - z\\ \mathbf{else}:\\ \;\;\;\;\left(1 - \log y\right) \cdot y\\ \end{array} \end{array} \]
                            (FPCore (x y z)
                             :precision binary64
                             (if (<= y 4e+141) (- x z) (* (- 1.0 (log y)) y)))
                            double code(double x, double y, double z) {
                            	double tmp;
                            	if (y <= 4e+141) {
                            		tmp = x - z;
                            	} else {
                            		tmp = (1.0 - log(y)) * y;
                            	}
                            	return tmp;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y, z)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8) :: tmp
                                if (y <= 4d+141) then
                                    tmp = x - z
                                else
                                    tmp = (1.0d0 - log(y)) * y
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double x, double y, double z) {
                            	double tmp;
                            	if (y <= 4e+141) {
                            		tmp = x - z;
                            	} else {
                            		tmp = (1.0 - Math.log(y)) * y;
                            	}
                            	return tmp;
                            }
                            
                            def code(x, y, z):
                            	tmp = 0
                            	if y <= 4e+141:
                            		tmp = x - z
                            	else:
                            		tmp = (1.0 - math.log(y)) * y
                            	return tmp
                            
                            function code(x, y, z)
                            	tmp = 0.0
                            	if (y <= 4e+141)
                            		tmp = Float64(x - z);
                            	else
                            		tmp = Float64(Float64(1.0 - log(y)) * y);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(x, y, z)
                            	tmp = 0.0;
                            	if (y <= 4e+141)
                            		tmp = x - z;
                            	else
                            		tmp = (1.0 - log(y)) * y;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[x_, y_, z_] := If[LessEqual[y, 4e+141], N[(x - z), $MachinePrecision], N[(N[(1.0 - N[Log[y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;y \leq 4 \cdot 10^{+141}:\\
                            \;\;\;\;x - z\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(1 - \log y\right) \cdot y\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if y < 4.00000000000000007e141

                              1. Initial program 99.9%

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

                                \[\leadsto \color{blue}{x} - z \]
                              4. Step-by-step derivation
                                1. Applied rewrites74.3%

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

                                if 4.00000000000000007e141 < y

                                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 inf

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

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

                                Alternative 8: 47.9% accurate, 7.9× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{+133}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.35 \cdot 10^{+30}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                                (FPCore (x y z)
                                 :precision binary64
                                 (if (<= x -1.8e+133) x (if (<= x 2.35e+30) (- z) x)))
                                double code(double x, double y, double z) {
                                	double tmp;
                                	if (x <= -1.8e+133) {
                                		tmp = x;
                                	} else if (x <= 2.35e+30) {
                                		tmp = -z;
                                	} else {
                                		tmp = x;
                                	}
                                	return tmp;
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y, z)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8) :: tmp
                                    if (x <= (-1.8d+133)) then
                                        tmp = x
                                    else if (x <= 2.35d+30) then
                                        tmp = -z
                                    else
                                        tmp = x
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z) {
                                	double tmp;
                                	if (x <= -1.8e+133) {
                                		tmp = x;
                                	} else if (x <= 2.35e+30) {
                                		tmp = -z;
                                	} else {
                                		tmp = x;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z):
                                	tmp = 0
                                	if x <= -1.8e+133:
                                		tmp = x
                                	elif x <= 2.35e+30:
                                		tmp = -z
                                	else:
                                		tmp = x
                                	return tmp
                                
                                function code(x, y, z)
                                	tmp = 0.0
                                	if (x <= -1.8e+133)
                                		tmp = x;
                                	elseif (x <= 2.35e+30)
                                		tmp = Float64(-z);
                                	else
                                		tmp = x;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z)
                                	tmp = 0.0;
                                	if (x <= -1.8e+133)
                                		tmp = x;
                                	elseif (x <= 2.35e+30)
                                		tmp = -z;
                                	else
                                		tmp = x;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_] := If[LessEqual[x, -1.8e+133], x, If[LessEqual[x, 2.35e+30], (-z), x]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;x \leq -1.8 \cdot 10^{+133}:\\
                                \;\;\;\;x\\
                                
                                \mathbf{elif}\;x \leq 2.35 \cdot 10^{+30}:\\
                                \;\;\;\;-z\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;x\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -1.79999999999999989e133 or 2.34999999999999995e30 < x

                                  1. Initial program 99.9%

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

                                    \[\leadsto \color{blue}{x} \]
                                  4. Step-by-step derivation
                                    1. Applied rewrites72.5%

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

                                    if -1.79999999999999989e133 < x < 2.34999999999999995e30

                                    1. Initial program 99.7%

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

                                      \[\leadsto \color{blue}{-1 \cdot z} \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites42.0%

                                        \[\leadsto \color{blue}{-z} \]
                                    5. Recombined 2 regimes into one program.
                                    6. Add Preprocessing

                                    Alternative 9: 57.6% accurate, 29.5× 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;
                                    }
                                    
                                    module fmin_fmax_functions
                                        implicit none
                                        private
                                        public fmax
                                        public fmin
                                    
                                        interface fmax
                                            module procedure fmax88
                                            module procedure fmax44
                                            module procedure fmax84
                                            module procedure fmax48
                                        end interface
                                        interface fmin
                                            module procedure fmin88
                                            module procedure fmin44
                                            module procedure fmin84
                                            module procedure fmin48
                                        end interface
                                    contains
                                        real(8) function fmax88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmax44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmax84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmax48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin88(x, y) result (res)
                                            real(8), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(4) function fmin44(x, y) result (res)
                                            real(4), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                        end function
                                        real(8) function fmin84(x, y) result(res)
                                            real(8), intent (in) :: x
                                            real(4), intent (in) :: y
                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                        end function
                                        real(8) function fmin48(x, y) result(res)
                                            real(4), intent (in) :: x
                                            real(8), intent (in) :: y
                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                        end function
                                    end module
                                    
                                    real(8) function code(x, y, z)
                                    use fmin_fmax_functions
                                        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. Add Preprocessing
                                    3. Taylor expanded in x around inf

                                      \[\leadsto \color{blue}{x} - z \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites60.1%

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

                                      Alternative 10: 30.0% accurate, 118.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;
                                      }
                                      
                                      module fmin_fmax_functions
                                          implicit none
                                          private
                                          public fmax
                                          public fmin
                                      
                                          interface fmax
                                              module procedure fmax88
                                              module procedure fmax44
                                              module procedure fmax84
                                              module procedure fmax48
                                          end interface
                                          interface fmin
                                              module procedure fmin88
                                              module procedure fmin44
                                              module procedure fmin84
                                              module procedure fmin48
                                          end interface
                                      contains
                                          real(8) function fmax88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmax44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmax84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmax48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin88(x, y) result (res)
                                              real(8), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(4) function fmin44(x, y) result (res)
                                              real(4), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                          end function
                                          real(8) function fmin84(x, y) result(res)
                                              real(8), intent (in) :: x
                                              real(4), intent (in) :: y
                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                          end function
                                          real(8) function fmin48(x, y) result(res)
                                              real(4), intent (in) :: x
                                              real(8), intent (in) :: y
                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                          end function
                                      end module
                                      
                                      real(8) function code(x, y, z)
                                      use fmin_fmax_functions
                                          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. Add Preprocessing
                                      3. Taylor expanded in x around inf

                                        \[\leadsto \color{blue}{x} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites30.9%

                                          \[\leadsto \color{blue}{x} \]
                                        2. Add Preprocessing

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

                                        \[\begin{array}{l} \\ \left(\left(y + x\right) - z\right) - \left(y + 0.5\right) \cdot \log y \end{array} \]
                                        (FPCore (x y z) :precision binary64 (- (- (+ y x) z) (* (+ y 0.5) (log y))))
                                        double code(double x, double y, double z) {
                                        	return ((y + x) - z) - ((y + 0.5) * log(y));
                                        }
                                        
                                        module fmin_fmax_functions
                                            implicit none
                                            private
                                            public fmax
                                            public fmin
                                        
                                            interface fmax
                                                module procedure fmax88
                                                module procedure fmax44
                                                module procedure fmax84
                                                module procedure fmax48
                                            end interface
                                            interface fmin
                                                module procedure fmin88
                                                module procedure fmin44
                                                module procedure fmin84
                                                module procedure fmin48
                                            end interface
                                        contains
                                            real(8) function fmax88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmax44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmax84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmax48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin88(x, y) result (res)
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(4) function fmin44(x, y) result (res)
                                                real(4), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                            end function
                                            real(8) function fmin84(x, y) result(res)
                                                real(8), intent (in) :: x
                                                real(4), intent (in) :: y
                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                            end function
                                            real(8) function fmin48(x, y) result(res)
                                                real(4), intent (in) :: x
                                                real(8), intent (in) :: y
                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                            end function
                                        end module
                                        
                                        real(8) function code(x, y, z)
                                        use fmin_fmax_functions
                                            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 2025019 
                                        (FPCore (x y z)
                                          :name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
                                          :precision binary64
                                        
                                          :alt
                                          (! :herbie-platform default (- (- (+ y x) z) (* (+ y 1/2) (log y))))
                                        
                                          (- (+ (- x (* (+ y 0.5) (log y))) y) z))