Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A

Percentage Accurate: 95.7% → 99.6%
Time: 4.8s
Alternatives: 7
Speedup: 3.7×

Specification

?
\[\begin{array}{l} \\ x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * exp(z)) - (x * 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 = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
end function
public static double code(double x, double y, double z) {
	return x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
}
def code(x, y, z):
	return x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
function code(x, y, z)
	return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
end
function tmp = code(x, y, z)
	tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\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 7 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: 95.7% accurate, 1.0× speedup?

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

\\
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\end{array}

Alternative 1: 99.6% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -330:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 225:\\ \;\;\;\;x + \frac{y}{\left(\frac{1.1283791670955126}{y} - x\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -330.0)
   (+ x (/ -1.0 x))
   (if (<= z 225.0) (+ x (/ y (* (- (/ 1.1283791670955126 y) x) y))) x)))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -330.0) {
		tmp = x + (-1.0 / x);
	} else if (z <= 225.0) {
		tmp = x + (y / (((1.1283791670955126 / y) - x) * y));
	} 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 (z <= (-330.0d0)) then
        tmp = x + ((-1.0d0) / x)
    else if (z <= 225.0d0) then
        tmp = x + (y / (((1.1283791670955126d0 / y) - x) * y))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (z <= -330.0) {
		tmp = x + (-1.0 / x);
	} else if (z <= 225.0) {
		tmp = x + (y / (((1.1283791670955126 / y) - x) * y));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -330.0:
		tmp = x + (-1.0 / x)
	elif z <= 225.0:
		tmp = x + (y / (((1.1283791670955126 / y) - x) * y))
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -330.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (z <= 225.0)
		tmp = Float64(x + Float64(y / Float64(Float64(Float64(1.1283791670955126 / y) - x) * y)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -330.0)
		tmp = x + (-1.0 / x);
	elseif (z <= 225.0)
		tmp = x + (y / (((1.1283791670955126 / y) - x) * y));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -330.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 225.0], N[(x + N[(y / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] - x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -330:\\
\;\;\;\;x + \frac{-1}{x}\\

\mathbf{elif}\;z \leq 225:\\
\;\;\;\;x + \frac{y}{\left(\frac{1.1283791670955126}{y} - x\right) \cdot y}\\

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


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

    1. Initial program 89.7%

      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
    4. Step-by-step derivation
      1. Applied rewrites100.0%

        \[\leadsto x + \color{blue}{\frac{-1}{x}} \]

      if -330 < z < 225

      1. Initial program 99.9%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing
      3. Taylor expanded in y around inf

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

          \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.1283791670955126, -x\right) \cdot y}} \]
        2. Taylor expanded in z around 0

          \[\leadsto x + \frac{y}{\left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y} - x\right) \cdot y} \]
        3. Step-by-step derivation
          1. Applied rewrites99.9%

            \[\leadsto x + \frac{y}{\left(\frac{1.1283791670955126}{y} - x\right) \cdot y} \]

          if 225 < z

          1. Initial program 96.0%

            \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
          2. Add Preprocessing
          3. Taylor expanded in x around inf

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

              \[\leadsto \color{blue}{x} \]
          5. Recombined 3 regimes into one program.
          6. Add Preprocessing

          Alternative 2: 86.1% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-18} \lor \neg \left(t\_0 \leq 10^{-8}\right):\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y))))))
             (if (or (<= t_0 -2e-18) (not (<= t_0 1e-8))) (+ x (/ -1.0 x)) x)))
          double code(double x, double y, double z) {
          	double t_0 = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
          	double tmp;
          	if ((t_0 <= -2e-18) || !(t_0 <= 1e-8)) {
          		tmp = x + (-1.0 / x);
          	} 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) :: t_0
              real(8) :: tmp
              t_0 = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
              if ((t_0 <= (-2d-18)) .or. (.not. (t_0 <= 1d-8))) then
                  tmp = x + ((-1.0d0) / x)
              else
                  tmp = x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double t_0 = x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
          	double tmp;
          	if ((t_0 <= -2e-18) || !(t_0 <= 1e-8)) {
          		tmp = x + (-1.0 / x);
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
          	tmp = 0
          	if (t_0 <= -2e-18) or not (t_0 <= 1e-8):
          		tmp = x + (-1.0 / x)
          	else:
          		tmp = x
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))))
          	tmp = 0.0
          	if ((t_0 <= -2e-18) || !(t_0 <= 1e-8))
          		tmp = Float64(x + Float64(-1.0 / x));
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	t_0 = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
          	tmp = 0.0;
          	if ((t_0 <= -2e-18) || ~((t_0 <= 1e-8)))
          		tmp = x + (-1.0 / x);
          	else
          		tmp = x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e-18], N[Not[LessEqual[t$95$0, 1e-8]], $MachinePrecision]], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], x]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\
          \mathbf{if}\;t\_0 \leq -2 \cdot 10^{-18} \lor \neg \left(t\_0 \leq 10^{-8}\right):\\
          \;\;\;\;x + \frac{-1}{x}\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < -2.0000000000000001e-18 or 1e-8 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y))))

            1. Initial program 95.1%

              \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
            4. Step-by-step derivation
              1. Applied rewrites91.2%

                \[\leadsto x + \color{blue}{\frac{-1}{x}} \]

              if -2.0000000000000001e-18 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 1e-8

              1. Initial program 100.0%

                \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

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

                  \[\leadsto \color{blue}{x} \]
              5. Recombined 2 regimes into one program.
              6. Final simplification88.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \leq -2 \cdot 10^{-18} \lor \neg \left(x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \leq 10^{-8}\right):\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
              7. Add Preprocessing

              Alternative 3: 99.9% accurate, 0.9× speedup?

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

                1. Initial program 89.7%

                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

                  \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
                4. Step-by-step derivation
                  1. Applied rewrites100.0%

                    \[\leadsto x + \color{blue}{\frac{-1}{x}} \]

                  if -740 < z

                  1. Initial program 98.4%

                    \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y around inf

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

                      \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\frac{e^{z}}{y}, 1.1283791670955126, -x\right) \cdot y}} \]
                  5. Recombined 2 regimes into one program.
                  6. Add Preprocessing

                  Alternative 4: 98.5% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -740:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\ \end{array} \end{array} \]
                  (FPCore (x y z)
                   :precision binary64
                   (if (<= z -740.0)
                     (+ x (/ -1.0 x))
                     (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y))))))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= -740.0) {
                  		tmp = x + (-1.0 / x);
                  	} else {
                  		tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * 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 (z <= (-740.0d0)) then
                          tmp = x + ((-1.0d0) / x)
                      else
                          tmp = x + (y / ((1.1283791670955126d0 * exp(z)) - (x * y)))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= -740.0) {
                  		tmp = x + (-1.0 / x);
                  	} else {
                  		tmp = x + (y / ((1.1283791670955126 * Math.exp(z)) - (x * y)));
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if z <= -740.0:
                  		tmp = x + (-1.0 / x)
                  	else:
                  		tmp = x + (y / ((1.1283791670955126 * math.exp(z)) - (x * y)))
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (z <= -740.0)
                  		tmp = Float64(x + Float64(-1.0 / x));
                  	else
                  		tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (z <= -740.0)
                  		tmp = x + (-1.0 / x);
                  	else
                  		tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[z, -740.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -740:\\
                  \;\;\;\;x + \frac{-1}{x}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -740

                    1. Initial program 89.7%

                      \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                    2. Add Preprocessing
                    3. Taylor expanded in x around inf

                      \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites100.0%

                        \[\leadsto x + \color{blue}{\frac{-1}{x}} \]

                      if -740 < z

                      1. Initial program 98.4%

                        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                      2. Add Preprocessing
                    5. Recombined 2 regimes into one program.
                    6. Add Preprocessing

                    Alternative 5: 99.6% accurate, 3.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -330:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 225:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                    (FPCore (x y z)
                     :precision binary64
                     (if (<= z -330.0)
                       (+ x (/ -1.0 x))
                       (if (<= z 225.0) (+ x (/ y (- 1.1283791670955126 (* x y)))) x)))
                    double code(double x, double y, double z) {
                    	double tmp;
                    	if (z <= -330.0) {
                    		tmp = x + (-1.0 / x);
                    	} else if (z <= 225.0) {
                    		tmp = x + (y / (1.1283791670955126 - (x * y)));
                    	} 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 (z <= (-330.0d0)) then
                            tmp = x + ((-1.0d0) / x)
                        else if (z <= 225.0d0) then
                            tmp = x + (y / (1.1283791670955126d0 - (x * y)))
                        else
                            tmp = x
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z) {
                    	double tmp;
                    	if (z <= -330.0) {
                    		tmp = x + (-1.0 / x);
                    	} else if (z <= 225.0) {
                    		tmp = x + (y / (1.1283791670955126 - (x * y)));
                    	} else {
                    		tmp = x;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z):
                    	tmp = 0
                    	if z <= -330.0:
                    		tmp = x + (-1.0 / x)
                    	elif z <= 225.0:
                    		tmp = x + (y / (1.1283791670955126 - (x * y)))
                    	else:
                    		tmp = x
                    	return tmp
                    
                    function code(x, y, z)
                    	tmp = 0.0
                    	if (z <= -330.0)
                    		tmp = Float64(x + Float64(-1.0 / x));
                    	elseif (z <= 225.0)
                    		tmp = Float64(x + Float64(y / Float64(1.1283791670955126 - Float64(x * y))));
                    	else
                    		tmp = x;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z)
                    	tmp = 0.0;
                    	if (z <= -330.0)
                    		tmp = x + (-1.0 / x);
                    	elseif (z <= 225.0)
                    		tmp = x + (y / (1.1283791670955126 - (x * y)));
                    	else
                    		tmp = x;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_] := If[LessEqual[z, -330.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 225.0], N[(x + N[(y / N[(1.1283791670955126 - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;z \leq -330:\\
                    \;\;\;\;x + \frac{-1}{x}\\
                    
                    \mathbf{elif}\;z \leq 225:\\
                    \;\;\;\;x + \frac{y}{1.1283791670955126 - x \cdot y}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;x\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if z < -330

                      1. Initial program 89.7%

                        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                      2. Add Preprocessing
                      3. Taylor expanded in x around inf

                        \[\leadsto x + \color{blue}{\frac{-1}{x}} \]
                      4. Step-by-step derivation
                        1. Applied rewrites100.0%

                          \[\leadsto x + \color{blue}{\frac{-1}{x}} \]

                        if -330 < z < 225

                        1. Initial program 99.9%

                          \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                        2. Add Preprocessing
                        3. Taylor expanded in z around 0

                          \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000}} - x \cdot y} \]
                        4. Step-by-step derivation
                          1. Applied rewrites99.9%

                            \[\leadsto x + \frac{y}{\color{blue}{1.1283791670955126} - x \cdot y} \]

                          if 225 < z

                          1. Initial program 96.0%

                            \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                          2. Add Preprocessing
                          3. Taylor expanded in x around inf

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

                              \[\leadsto \color{blue}{x} \]
                          5. Recombined 3 regimes into one program.
                          6. Add Preprocessing

                          Alternative 6: 68.9% accurate, 7.1× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+120}:\\ \;\;\;\;\frac{-1}{x}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                          (FPCore (x y z) :precision binary64 (if (<= z -3.6e+120) (/ -1.0 x) x))
                          double code(double x, double y, double z) {
                          	double tmp;
                          	if (z <= -3.6e+120) {
                          		tmp = -1.0 / x;
                          	} 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 (z <= (-3.6d+120)) then
                                  tmp = (-1.0d0) / x
                              else
                                  tmp = x
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double x, double y, double z) {
                          	double tmp;
                          	if (z <= -3.6e+120) {
                          		tmp = -1.0 / x;
                          	} else {
                          		tmp = x;
                          	}
                          	return tmp;
                          }
                          
                          def code(x, y, z):
                          	tmp = 0
                          	if z <= -3.6e+120:
                          		tmp = -1.0 / x
                          	else:
                          		tmp = x
                          	return tmp
                          
                          function code(x, y, z)
                          	tmp = 0.0
                          	if (z <= -3.6e+120)
                          		tmp = Float64(-1.0 / x);
                          	else
                          		tmp = x;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(x, y, z)
                          	tmp = 0.0;
                          	if (z <= -3.6e+120)
                          		tmp = -1.0 / x;
                          	else
                          		tmp = x;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[x_, y_, z_] := If[LessEqual[z, -3.6e+120], N[(-1.0 / x), $MachinePrecision], x]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;z \leq -3.6 \cdot 10^{+120}:\\
                          \;\;\;\;\frac{-1}{x}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;x\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if z < -3.60000000000000016e120

                            1. Initial program 89.1%

                              \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                            2. Add Preprocessing
                            3. Taylor expanded in x around inf

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

                                \[\leadsto \color{blue}{\left(1 - \frac{1}{x \cdot x}\right) \cdot x} \]
                              2. Taylor expanded in x around 0

                                \[\leadsto \frac{-1}{\color{blue}{x}} \]
                              3. Step-by-step derivation
                                1. Applied rewrites58.2%

                                  \[\leadsto \frac{-1}{\color{blue}{x}} \]

                                if -3.60000000000000016e120 < z

                                1. Initial program 97.6%

                                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                                2. Add Preprocessing
                                3. Taylor expanded in x around inf

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

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

                                Alternative 7: 68.5% accurate, 128.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 96.3%

                                  \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                                2. Add Preprocessing
                                3. Taylor expanded in x around inf

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

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

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

                                  \[\begin{array}{l} \\ x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x} \end{array} \]
                                  (FPCore (x y z)
                                   :precision binary64
                                   (+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x))))
                                  double code(double x, double y, double z) {
                                  	return x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - 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 + (1.0d0 / (((1.1283791670955126d0 / y) * exp(z)) - x))
                                  end function
                                  
                                  public static double code(double x, double y, double z) {
                                  	return x + (1.0 / (((1.1283791670955126 / y) * Math.exp(z)) - x));
                                  }
                                  
                                  def code(x, y, z):
                                  	return x + (1.0 / (((1.1283791670955126 / y) * math.exp(z)) - x))
                                  
                                  function code(x, y, z)
                                  	return Float64(x + Float64(1.0 / Float64(Float64(Float64(1.1283791670955126 / y) * exp(z)) - x)))
                                  end
                                  
                                  function tmp = code(x, y, z)
                                  	tmp = x + (1.0 / (((1.1283791670955126 / y) * exp(z)) - x));
                                  end
                                  
                                  code[x_, y_, z_] := N[(x + N[(1.0 / N[(N[(N[(1.1283791670955126 / y), $MachinePrecision] * N[Exp[z], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  x + \frac{1}{\frac{1.1283791670955126}{y} \cdot e^{z} - x}
                                  \end{array}
                                  

                                  Reproduce

                                  ?
                                  herbie shell --seed 2025018 
                                  (FPCore (x y z)
                                    :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
                                    :precision binary64
                                  
                                    :alt
                                    (! :herbie-platform default (+ x (/ 1 (- (* (/ 5641895835477563/5000000000000000 y) (exp z)) x))))
                                  
                                    (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))