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

Percentage Accurate: 96.2% → 99.6%
Time: 6.8s
Alternatives: 12
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 12 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: 96.2% 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, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -750:\\ \;\;\;\;x + \frac{-1}{x}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-10}:\\ \;\;\;\;x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{0.8862269254527579}{e^{z}}, y, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -750.0)
   (+ x (/ -1.0 x))
   (if (<= z 1.1e-10)
     (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y))))
     (fma (/ 0.8862269254527579 (exp z)) y x))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -750.0) {
		tmp = x + (-1.0 / x);
	} else if (z <= 1.1e-10) {
		tmp = x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
	} else {
		tmp = fma((0.8862269254527579 / exp(z)), y, x);
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if (z <= -750.0)
		tmp = Float64(x + Float64(-1.0 / x));
	elseif (z <= 1.1e-10)
		tmp = Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y))));
	else
		tmp = fma(Float64(0.8862269254527579 / exp(z)), y, x);
	end
	return tmp
end
code[x_, y_, z_] := If[LessEqual[z, -750.0], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-10], N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.8862269254527579 / N[Exp[z], $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{0.8862269254527579}{e^{z}}, y, x\right)\\


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

    1. Initial program 85.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 -750 < z < 1.09999999999999995e-10

      1. Initial program 99.8%

        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
      2. Add Preprocessing

      if 1.09999999999999995e-10 < z

      1. Initial program 94.3%

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

        \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
      4. Step-by-step derivation
        1. Applied rewrites100.0%

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

      Alternative 2: 87.2% accurate, 0.3× speedup?

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

        1. Initial program 94.2%

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

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

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

          1. Initial program 99.9%

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

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

            if 9.99999999999999962e-165 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 2e10

            1. Initial program 99.8%

              \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y}} \]
              2. lift-*.f64N/A

                \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - \color{blue}{x \cdot y}} \]
              3. fp-cancel-sub-sign-invN/A

                \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + \left(\mathsf{neg}\left(x\right)\right) \cdot y}} \]
              4. +-commutativeN/A

                \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot y + \frac{5641895835477563}{5000000000000000} \cdot e^{z}}} \]
              5. distribute-lft-neg-outN/A

                \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(x \cdot y\right)\right)} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
              6. distribute-rgt-neg-inN/A

                \[\leadsto x + \frac{y}{\color{blue}{x \cdot \left(\mathsf{neg}\left(y\right)\right)} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
              7. *-commutativeN/A

                \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot x} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
              8. lower-fma.f64N/A

                \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), x, \frac{5641895835477563}{5000000000000000} \cdot e^{z}\right)}} \]
              9. lower-neg.f6499.8

                \[\leadsto x + \frac{y}{\mathsf{fma}\left(\color{blue}{-y}, x, 1.1283791670955126 \cdot e^{z}\right)} \]
              10. lift-*.f64N/A

                \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z}}\right)} \]
              11. *-commutativeN/A

                \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{e^{z} \cdot \frac{5641895835477563}{5000000000000000}}\right)} \]
              12. lower-*.f6499.8

                \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
            4. Applied rewrites99.8%

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

              \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} + -1 \cdot \left(x \cdot y\right)}} \]
            6. Step-by-step derivation
              1. Applied rewrites95.1%

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

                \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000}} \]
              3. Step-by-step derivation
                1. Applied rewrites95.1%

                  \[\leadsto x + \frac{y}{1.1283791670955126} \]
              4. Recombined 3 regimes into one program.
              5. Add Preprocessing

              Alternative 3: 87.0% 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 -1 \lor \neg \left(t\_0 \leq 400000\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 -1.0) (not (<= t_0 400000.0))) (+ 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 <= -1.0) || !(t_0 <= 400000.0)) {
              		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 <= (-1.0d0)) .or. (.not. (t_0 <= 400000.0d0))) 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 <= -1.0) || !(t_0 <= 400000.0)) {
              		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 <= -1.0) or not (t_0 <= 400000.0):
              		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 <= -1.0) || !(t_0 <= 400000.0))
              		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 <= -1.0) || ~((t_0 <= 400000.0)))
              		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, -1.0], N[Not[LessEqual[t$95$0, 400000.0]], $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 -1 \lor \neg \left(t\_0 \leq 400000\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)))) < -1 or 4e5 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y))))

                1. Initial program 94.2%

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

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

                  if -1 < (+.f64 x (/.f64 y (-.f64 (*.f64 #s(literal 5641895835477563/5000000000000000 binary64) (exp.f64 z)) (*.f64 x y)))) < 4e5

                  1. Initial program 99.8%

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

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

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

                  Alternative 4: 99.9% accurate, 1.0× speedup?

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

                    1. Initial program 85.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 -750 < z

                      1. Initial program 97.9%

                        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                      2. Add Preprocessing
                      3. Step-by-step derivation
                        1. lift--.f64N/A

                          \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y}} \]
                        2. lift-*.f64N/A

                          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - \color{blue}{x \cdot y}} \]
                        3. fp-cancel-sub-sign-invN/A

                          \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + \left(\mathsf{neg}\left(x\right)\right) \cdot y}} \]
                        4. +-commutativeN/A

                          \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot y + \frac{5641895835477563}{5000000000000000} \cdot e^{z}}} \]
                        5. distribute-lft-neg-outN/A

                          \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(x \cdot y\right)\right)} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
                        6. distribute-rgt-neg-inN/A

                          \[\leadsto x + \frac{y}{\color{blue}{x \cdot \left(\mathsf{neg}\left(y\right)\right)} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
                        7. *-commutativeN/A

                          \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot x} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
                        8. lower-fma.f64N/A

                          \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), x, \frac{5641895835477563}{5000000000000000} \cdot e^{z}\right)}} \]
                        9. lower-neg.f6499.9

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(\color{blue}{-y}, x, 1.1283791670955126 \cdot e^{z}\right)} \]
                        10. lift-*.f64N/A

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z}}\right)} \]
                        11. *-commutativeN/A

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{e^{z} \cdot \frac{5641895835477563}{5000000000000000}}\right)} \]
                        12. lower-*.f6499.9

                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
                      4. Applied rewrites99.9%

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

                    Alternative 5: 99.6% accurate, 1.0× speedup?

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

                      1. Initial program 85.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 -55 < z < 1.09999999999999995e-10

                        1. Initial program 99.8%

                          \[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}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)\right)\right)} - x \cdot y} \]
                        4. Step-by-step derivation
                          1. Applied rewrites99.5%

                            \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.18806319451591877, z, 0.5641895835477563\right), z, 1.1283791670955126\right), z, 1.1283791670955126\right)} - x \cdot y} \]

                          if 1.09999999999999995e-10 < z

                          1. Initial program 94.3%

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

                            \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                          4. Step-by-step derivation
                            1. Applied rewrites100.0%

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

                          Alternative 6: 99.8% accurate, 2.4× speedup?

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

                            1. Initial program 85.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 -55 < z < 195

                              1. Initial program 99.8%

                                \[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}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{10000000000000000} + \frac{5641895835477563}{30000000000000000} \cdot z\right)\right)\right)} - x \cdot y} \]
                              4. Step-by-step derivation
                                1. Applied rewrites99.1%

                                  \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.18806319451591877, z, 0.5641895835477563\right), z, 1.1283791670955126\right), z, 1.1283791670955126\right)} - x \cdot y} \]

                                if 195 < z

                                1. Initial program 94.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 7: 99.8% accurate, 2.5× speedup?

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

                                  1. Initial program 85.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 -90 < z < 195

                                    1. Initial program 99.8%

                                      \[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}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\left(1 + z \cdot \left(1 + \frac{1}{2} \cdot z\right)\right)} - x \cdot y} \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites98.9%

                                        \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.5, z, 1\right), z, 1\right)} - x \cdot y} \]

                                      if 195 < z

                                      1. Initial program 94.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 8: 99.8% accurate, 2.7× speedup?

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

                                        1. Initial program 85.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 -90 < z < 195

                                          1. Initial program 99.8%

                                            \[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}{\left(\frac{5641895835477563}{5000000000000000} + z \cdot \left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{10000000000000000} \cdot z\right)\right)} - x \cdot y} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites98.9%

                                              \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(0.5641895835477563, z, 1.1283791670955126\right), z, 1.1283791670955126\right)} - x \cdot y} \]

                                            if 195 < z

                                            1. Initial program 94.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 9: 99.7% accurate, 3.1× speedup?

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

                                              1. Initial program 85.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 -55 < z < 195

                                                1. Initial program 99.8%

                                                  \[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}{\left(\frac{5641895835477563}{5000000000000000} + \frac{5641895835477563}{5000000000000000} \cdot z\right)} - x \cdot y} \]
                                                4. Step-by-step derivation
                                                  1. Applied rewrites98.8%

                                                    \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(1.1283791670955126, z, 1.1283791670955126\right)} - x \cdot y} \]

                                                  if 195 < z

                                                  1. Initial program 94.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 10: 99.6% accurate, 3.7× speedup?

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

                                                    1. Initial program 85.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 -90 < z < 195

                                                      1. Initial program 99.8%

                                                        \[x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y} \]
                                                      2. Add Preprocessing
                                                      3. Step-by-step derivation
                                                        1. lift--.f64N/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y}} \]
                                                        2. lift-*.f64N/A

                                                          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - \color{blue}{x \cdot y}} \]
                                                        3. fp-cancel-sub-sign-invN/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} + \left(\mathsf{neg}\left(x\right)\right) \cdot y}} \]
                                                        4. +-commutativeN/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(x\right)\right) \cdot y + \frac{5641895835477563}{5000000000000000} \cdot e^{z}}} \]
                                                        5. distribute-lft-neg-outN/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(x \cdot y\right)\right)} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
                                                        6. distribute-rgt-neg-inN/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{x \cdot \left(\mathsf{neg}\left(y\right)\right)} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
                                                        7. *-commutativeN/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot x} + \frac{5641895835477563}{5000000000000000} \cdot e^{z}} \]
                                                        8. lower-fma.f64N/A

                                                          \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y\right), x, \frac{5641895835477563}{5000000000000000} \cdot e^{z}\right)}} \]
                                                        9. lower-neg.f6499.8

                                                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(\color{blue}{-y}, x, 1.1283791670955126 \cdot e^{z}\right)} \]
                                                        10. lift-*.f64N/A

                                                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{\frac{5641895835477563}{5000000000000000} \cdot e^{z}}\right)} \]
                                                        11. *-commutativeN/A

                                                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{e^{z} \cdot \frac{5641895835477563}{5000000000000000}}\right)} \]
                                                        12. lower-*.f6499.8

                                                          \[\leadsto x + \frac{y}{\mathsf{fma}\left(-y, x, \color{blue}{e^{z} \cdot 1.1283791670955126}\right)} \]
                                                      4. Applied rewrites99.8%

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

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

                                                          \[\leadsto x + \frac{y}{\color{blue}{\mathsf{fma}\left(-y, x, 1.1283791670955126\right)}} \]

                                                        if 195 < z

                                                        1. Initial program 94.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 11: 70.7% accurate, 4.9× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{-194} \lor \neg \left(x \leq 5.8 \cdot 10^{-121}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right) \cdot 0.8862269254527579\\ \end{array} \end{array} \]
                                                        (FPCore (x y z)
                                                         :precision binary64
                                                         (if (or (<= x -3.5e-194) (not (<= x 5.8e-121)))
                                                           x
                                                           (* (fma (- y) z y) 0.8862269254527579)))
                                                        double code(double x, double y, double z) {
                                                        	double tmp;
                                                        	if ((x <= -3.5e-194) || !(x <= 5.8e-121)) {
                                                        		tmp = x;
                                                        	} else {
                                                        		tmp = fma(-y, z, y) * 0.8862269254527579;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        function code(x, y, z)
                                                        	tmp = 0.0
                                                        	if ((x <= -3.5e-194) || !(x <= 5.8e-121))
                                                        		tmp = x;
                                                        	else
                                                        		tmp = Float64(fma(Float64(-y), z, y) * 0.8862269254527579);
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        code[x_, y_, z_] := If[Or[LessEqual[x, -3.5e-194], N[Not[LessEqual[x, 5.8e-121]], $MachinePrecision]], x, N[(N[((-y) * z + y), $MachinePrecision] * 0.8862269254527579), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;x \leq -3.5 \cdot 10^{-194} \lor \neg \left(x \leq 5.8 \cdot 10^{-121}\right):\\
                                                        \;\;\;\;x\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\mathsf{fma}\left(-y, z, y\right) \cdot 0.8862269254527579\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if x < -3.5000000000000003e-194 or 5.8e-121 < x

                                                          1. Initial program 97.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 rewrites82.5%

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

                                                            if -3.5000000000000003e-194 < x < 5.8e-121

                                                            1. Initial program 90.1%

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

                                                              \[\leadsto \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                                                            4. Step-by-step derivation
                                                              1. Applied rewrites45.6%

                                                                \[\leadsto \color{blue}{\frac{y}{e^{z}} \cdot 0.8862269254527579} \]
                                                              2. Taylor expanded in z around 0

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

                                                                  \[\leadsto \mathsf{fma}\left(-y, z, y\right) \cdot 0.8862269254527579 \]
                                                              4. Recombined 2 regimes into one program.
                                                              5. Final simplification72.8%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{-194} \lor \neg \left(x \leq 5.8 \cdot 10^{-121}\right):\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-y, z, y\right) \cdot 0.8862269254527579\\ \end{array} \]
                                                              6. Add Preprocessing

                                                              Alternative 12: 68.9% 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 95.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 rewrites69.6%

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