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

Percentage Accurate: 95.6% → 99.9%
Time: 8.0s
Alternatives: 12
Speedup: 1.3×

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}

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: 95.6% 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.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 89.0%

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

      \[\leadsto \color{blue}{x - \frac{1}{x}} \]
    3. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto x - \color{blue}{\frac{1}{x}} \]
      2. lower-/.f64100.0

        \[\leadsto x - \frac{1}{\color{blue}{x}} \]
    4. Applied rewrites100.0%

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

    if -3100 < z < 2.89999999999999991e-9

    1. Initial program 99.8%

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

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

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

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

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

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

        \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{e^{z}} - x \cdot y} \]
      7. +-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{y}{\frac{5641895835477563}{5000000000000000} \cdot e^{z} - x \cdot y} + x} \]
    3. Applied rewrites99.8%

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

    if 2.89999999999999991e-9 < z

    1. Initial program 94.0%

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

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

        \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{{\left(e^{z}\right)}^{1}} - x \cdot y} \]
      3. metadata-evalN/A

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

        \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{{\left(e^{z}\right)}^{-1}}} - x \cdot y} \]
      5. inv-powN/A

        \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{\color{blue}{\frac{1}{e^{z}}}} - x \cdot y} \]
      6. lower-/.f64N/A

        \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{\frac{1}{e^{z}}}} - x \cdot y} \]
      7. rec-expN/A

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

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

        \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \frac{1}{e^{\color{blue}{-z}}} - x \cdot y} \]
    3. Applied rewrites94.0%

      \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\frac{1}{e^{-z}}} - x \cdot y} \]
    4. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot \left(y \cdot e^{\mathsf{neg}\left(z\right)}\right) + x \cdot \left(1 - \frac{-25000000000000000000000000000000}{31830988618379068626528276418969} \cdot \left({y}^{2} \cdot {\left(e^{\mathsf{neg}\left(z\right)}\right)}^{2}\right)\right)} \]
    5. Applied rewrites76.3%

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

      \[\leadsto \mathsf{fma}\left(\frac{5000000000000000}{5641895835477563} \cdot y, e^{-z}, x\right) \]
    7. Step-by-step derivation
      1. Applied rewrites99.3%

        \[\leadsto \mathsf{fma}\left(0.8862269254527579 \cdot y, e^{-z}, x\right) \]
    8. Recombined 3 regimes into one program.
    9. Add Preprocessing

    Alternative 2: 99.7% accurate, 0.8× speedup?

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

      1. Initial program 89.0%

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

        \[\leadsto \color{blue}{x - \frac{1}{x}} \]
      3. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto x - \color{blue}{\frac{1}{x}} \]
        2. lower-/.f64100.0

          \[\leadsto x - \frac{1}{\color{blue}{x}} \]
      4. Applied rewrites100.0%

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

      if -3100 < z

      1. Initial program 97.9%

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

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

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{{\left(e^{z}\right)}^{1}} - x \cdot y} \]
        3. metadata-evalN/A

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

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{{\left(e^{z}\right)}^{-1}}} - x \cdot y} \]
        5. inv-powN/A

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{\color{blue}{\frac{1}{e^{z}}}} - x \cdot y} \]
        6. lower-/.f64N/A

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{\frac{1}{e^{z}}}} - x \cdot y} \]
        7. rec-expN/A

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

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

          \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \frac{1}{e^{\color{blue}{-z}}} - x \cdot y} \]
      3. Applied rewrites97.9%

        \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\frac{1}{e^{-z}}} - x \cdot y} \]
      4. Taylor expanded in y around inf

        \[\leadsto x + \frac{y}{\color{blue}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)}} \]
      5. Step-by-step derivation
        1. negate-subN/A

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

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

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

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

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        6. inv-powN/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        7. pow-flipN/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        8. metadata-evalN/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        9. unpow1N/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        10. fp-cancel-sign-sub-invN/A

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

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

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        13. negate-subN/A

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

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

          \[\leadsto x + \frac{y}{\left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right) \cdot \color{blue}{y}} \]
      6. Applied rewrites99.9%

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

    Alternative 3: 99.5% accurate, 0.9× speedup?

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

      1. Initial program 89.0%

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

        \[\leadsto \color{blue}{x - \frac{1}{x}} \]
      3. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto x - \color{blue}{\frac{1}{x}} \]
        2. lower-/.f64100.0

          \[\leadsto x - \frac{1}{\color{blue}{x}} \]
      4. Applied rewrites100.0%

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

      if -3100 < z < 2.79999999999999984e-9

      1. Initial program 99.8%

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

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

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{{\left(e^{z}\right)}^{1}} - x \cdot y} \]
        3. metadata-evalN/A

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

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{{\left(e^{z}\right)}^{-1}}} - x \cdot y} \]
        5. inv-powN/A

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{\color{blue}{\frac{1}{e^{z}}}} - x \cdot y} \]
        6. lower-/.f64N/A

          \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{\frac{1}{e^{z}}}} - x \cdot y} \]
        7. rec-expN/A

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

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

          \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \frac{1}{e^{\color{blue}{-z}}} - x \cdot y} \]
      3. Applied rewrites99.8%

        \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\frac{1}{e^{-z}}} - x \cdot y} \]
      4. Taylor expanded in y around inf

        \[\leadsto x + \frac{y}{\color{blue}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)}} \]
      5. Step-by-step derivation
        1. negate-subN/A

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

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

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

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

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        6. inv-powN/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        7. pow-flipN/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        8. metadata-evalN/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        9. unpow1N/A

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        10. fp-cancel-sign-sub-invN/A

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

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

          \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
        13. negate-subN/A

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

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

          \[\leadsto x + \frac{y}{\left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right) \cdot \color{blue}{y}} \]
      6. Applied rewrites99.8%

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

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

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

        if 2.79999999999999984e-9 < z

        1. Initial program 94.0%

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

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

            \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{{\left(e^{z}\right)}^{1}} - x \cdot y} \]
          3. metadata-evalN/A

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

            \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{{\left(e^{z}\right)}^{-1}}} - x \cdot y} \]
          5. inv-powN/A

            \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{\color{blue}{\frac{1}{e^{z}}}} - x \cdot y} \]
          6. lower-/.f64N/A

            \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{\frac{1}{e^{z}}}} - x \cdot y} \]
          7. rec-expN/A

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

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

            \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \frac{1}{e^{\color{blue}{-z}}} - x \cdot y} \]
        3. Applied rewrites94.0%

          \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\frac{1}{e^{-z}}} - x \cdot y} \]
        4. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot \left(y \cdot e^{\mathsf{neg}\left(z\right)}\right) + x \cdot \left(1 - \frac{-25000000000000000000000000000000}{31830988618379068626528276418969} \cdot \left({y}^{2} \cdot {\left(e^{\mathsf{neg}\left(z\right)}\right)}^{2}\right)\right)} \]
        5. Applied rewrites76.3%

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

          \[\leadsto \mathsf{fma}\left(\frac{5000000000000000}{5641895835477563} \cdot y, e^{-z}, x\right) \]
        7. Step-by-step derivation
          1. Applied rewrites99.3%

            \[\leadsto \mathsf{fma}\left(0.8862269254527579 \cdot y, e^{-z}, x\right) \]
        8. Recombined 3 regimes into one program.
        9. Add Preprocessing

        Alternative 4: 99.5% accurate, 1.0× speedup?

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

          1. Initial program 89.0%

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

            \[\leadsto \color{blue}{x - \frac{1}{x}} \]
          3. Step-by-step derivation
            1. lower--.f64N/A

              \[\leadsto x - \color{blue}{\frac{1}{x}} \]
            2. lower-/.f64100.0

              \[\leadsto x - \frac{1}{\color{blue}{x}} \]
          4. Applied rewrites100.0%

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

          if -3100 < z < 2.79999999999999984e-9

          1. Initial program 99.8%

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

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

              \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{{\left(e^{z}\right)}^{1}} - x \cdot y} \]
            3. metadata-evalN/A

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

              \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{{\left(e^{z}\right)}^{-1}}} - x \cdot y} \]
            5. inv-powN/A

              \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{\color{blue}{\frac{1}{e^{z}}}} - x \cdot y} \]
            6. lower-/.f64N/A

              \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{\frac{1}{e^{z}}}} - x \cdot y} \]
            7. rec-expN/A

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

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

              \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \frac{1}{e^{\color{blue}{-z}}} - x \cdot y} \]
          3. Applied rewrites99.8%

            \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\frac{1}{e^{-z}}} - x \cdot y} \]
          4. Taylor expanded in y around inf

            \[\leadsto x + \frac{y}{\color{blue}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)}} \]
          5. Step-by-step derivation
            1. negate-subN/A

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

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

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

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

              \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
            6. inv-powN/A

              \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
            7. pow-flipN/A

              \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
            8. metadata-evalN/A

              \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
            9. unpow1N/A

              \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
            10. fp-cancel-sign-sub-invN/A

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

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

              \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
            13. negate-subN/A

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

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

              \[\leadsto x + \frac{y}{\left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right) \cdot \color{blue}{y}} \]
          6. Applied rewrites99.8%

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

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

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

            if 2.79999999999999984e-9 < z

            1. Initial program 94.0%

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

              \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
            3. Step-by-step derivation
              1. +-commutativeN/A

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

                \[\leadsto \frac{y}{e^{z}} \cdot \frac{5000000000000000}{5641895835477563} + x \]
              3. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, \frac{5000000000000000}{5641895835477563}, x\right) \]
              5. lift-exp.f6499.3

                \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, 0.8862269254527579, x\right) \]
            4. Applied rewrites99.3%

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

          Alternative 5: 99.4% accurate, 1.1× speedup?

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

            1. Initial program 89.0%

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

              \[\leadsto \color{blue}{x - \frac{1}{x}} \]
            3. Step-by-step derivation
              1. lower--.f64N/A

                \[\leadsto x - \color{blue}{\frac{1}{x}} \]
              2. lower-/.f64100.0

                \[\leadsto x - \frac{1}{\color{blue}{x}} \]
            4. Applied rewrites100.0%

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

            if -3100 < z < 245

            1. Initial program 99.8%

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

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

                \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{{\left(e^{z}\right)}^{1}} - x \cdot y} \]
              3. metadata-evalN/A

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

                \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{{\left(e^{z}\right)}^{-1}}} - x \cdot y} \]
              5. inv-powN/A

                \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{\color{blue}{\frac{1}{e^{z}}}} - x \cdot y} \]
              6. lower-/.f64N/A

                \[\leadsto x + \frac{y}{\frac{5641895835477563}{5000000000000000} \cdot \color{blue}{\frac{1}{\frac{1}{e^{z}}}} - x \cdot y} \]
              7. rec-expN/A

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

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

                \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \frac{1}{e^{\color{blue}{-z}}} - x \cdot y} \]
            3. Applied rewrites99.8%

              \[\leadsto x + \frac{y}{1.1283791670955126 \cdot \color{blue}{\frac{1}{e^{-z}}} - x \cdot y} \]
            4. Taylor expanded in y around inf

              \[\leadsto x + \frac{y}{\color{blue}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)}} \]
            5. Step-by-step derivation
              1. negate-subN/A

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

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

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

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

                \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
              6. inv-powN/A

                \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
              7. pow-flipN/A

                \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
              8. metadata-evalN/A

                \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
              9. unpow1N/A

                \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
              10. fp-cancel-sign-sub-invN/A

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

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

                \[\leadsto x + \frac{y}{y \cdot \left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right)} \]
              13. negate-subN/A

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

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

                \[\leadsto x + \frac{y}{\left(\frac{5641895835477563}{5000000000000000} \cdot \frac{1}{y \cdot e^{\mathsf{neg}\left(z\right)}} - x\right) \cdot \color{blue}{y}} \]
            6. Applied rewrites99.8%

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

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

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

              if 245 < z

              1. Initial program 93.8%

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

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

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

              Alternative 6: 99.4% accurate, 1.3× speedup?

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

                1. Initial program 89.0%

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

                  \[\leadsto \color{blue}{x - \frac{1}{x}} \]
                3. Step-by-step derivation
                  1. lower--.f64N/A

                    \[\leadsto x - \color{blue}{\frac{1}{x}} \]
                  2. lower-/.f64100.0

                    \[\leadsto x - \frac{1}{\color{blue}{x}} \]
                4. Applied rewrites100.0%

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

                if -3100 < z < 245

                1. Initial program 99.8%

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

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

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

                  if 245 < z

                  1. Initial program 93.8%

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

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

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

                  Alternative 7: 87.2% accurate, 0.4× 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 -10:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 5:\\ \;\;\;\;\mathsf{fma}\left(\frac{y}{1 + z}, 0.8862269254527579, x\right)\\ \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 -10.0)
                       t_0
                       (if (<= t_1 5.0) (fma (/ y (+ 1.0 z)) 0.8862269254527579 x) 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 <= -10.0) {
                  		tmp = t_0;
                  	} else if (t_1 <= 5.0) {
                  		tmp = fma((y / (1.0 + z)), 0.8862269254527579, x);
                  	} 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 <= -10.0)
                  		tmp = t_0;
                  	elseif (t_1 <= 5.0)
                  		tmp = fma(Float64(y / Float64(1.0 + z)), 0.8862269254527579, x);
                  	else
                  		tmp = t_0;
                  	end
                  	return 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, -10.0], t$95$0, If[LessEqual[t$95$1, 5.0], N[(N[(y / N[(1.0 + z), $MachinePrecision]), $MachinePrecision] * 0.8862269254527579 + x), $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 -10:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;t\_1 \leq 5:\\
                  \;\;\;\;\mathsf{fma}\left(\frac{y}{1 + z}, 0.8862269254527579, x\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \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)))) < -10 or 5 < (+.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. Taylor expanded in y around inf

                      \[\leadsto \color{blue}{x - \frac{1}{x}} \]
                    3. Step-by-step derivation
                      1. lower--.f64N/A

                        \[\leadsto x - \color{blue}{\frac{1}{x}} \]
                      2. lower-/.f6491.1

                        \[\leadsto x - \frac{1}{\color{blue}{x}} \]
                    4. Applied rewrites91.1%

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

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

                    1. Initial program 99.9%

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

                      \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                    3. Step-by-step derivation
                      1. +-commutativeN/A

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

                        \[\leadsto \frac{y}{e^{z}} \cdot \frac{5000000000000000}{5641895835477563} + x \]
                      3. lower-fma.f64N/A

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

                        \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, \frac{5000000000000000}{5641895835477563}, x\right) \]
                      5. lift-exp.f6499.2

                        \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, 0.8862269254527579, x\right) \]
                    4. Applied rewrites99.2%

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

                      \[\leadsto \mathsf{fma}\left(\frac{y}{1 + z}, \frac{5000000000000000}{5641895835477563}, x\right) \]
                    6. Step-by-step derivation
                      1. lower-+.f6475.2

                        \[\leadsto \mathsf{fma}\left(\frac{y}{1 + z}, 0.8862269254527579, x\right) \]
                    7. Applied rewrites75.2%

                      \[\leadsto \mathsf{fma}\left(\frac{y}{1 + z}, 0.8862269254527579, x\right) \]
                  3. Recombined 2 regimes into one program.
                  4. Add Preprocessing

                  Alternative 8: 86.5% accurate, 1.8× speedup?

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

                    1. Initial program 89.1%

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

                      \[\leadsto \color{blue}{x - \frac{1}{x}} \]
                    3. Step-by-step derivation
                      1. lower--.f64N/A

                        \[\leadsto x - \color{blue}{\frac{1}{x}} \]
                      2. lower-/.f6499.5

                        \[\leadsto x - \frac{1}{\color{blue}{x}} \]
                    4. Applied rewrites99.5%

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

                    if -0.0063 < z < 7.40000000000000028e-33

                    1. Initial program 99.9%

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

                      \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                    3. Step-by-step derivation
                      1. +-commutativeN/A

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

                        \[\leadsto \frac{y}{e^{z}} \cdot \frac{5000000000000000}{5641895835477563} + x \]
                      3. lower-fma.f64N/A

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

                        \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, \frac{5000000000000000}{5641895835477563}, x\right) \]
                      5. lift-exp.f6474.4

                        \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, 0.8862269254527579, x\right) \]
                    4. Applied rewrites74.4%

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

                      \[\leadsto x + \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot y} \]
                    6. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + x \]
                      2. lower-fma.f6474.2

                        \[\leadsto \mathsf{fma}\left(0.8862269254527579, y, x\right) \]
                    7. Applied rewrites74.2%

                      \[\leadsto \mathsf{fma}\left(0.8862269254527579, \color{blue}{y}, x\right) \]
                    8. Step-by-step derivation
                      1. lift-fma.f64N/A

                        \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + x \]
                      2. +-commutativeN/A

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

                        \[\leadsto x - \left(\mathsf{neg}\left(\frac{5000000000000000}{5641895835477563}\right)\right) \cdot \color{blue}{y} \]
                      4. metadata-evalN/A

                        \[\leadsto x - \frac{-5000000000000000}{5641895835477563} \cdot y \]
                      5. lower--.f64N/A

                        \[\leadsto x - \frac{-5000000000000000}{5641895835477563} \cdot \color{blue}{y} \]
                      6. lower-*.f6474.2

                        \[\leadsto x - -0.8862269254527579 \cdot y \]
                    9. Applied rewrites74.2%

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

                    if 7.40000000000000028e-33 < z

                    1. Initial program 94.4%

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

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

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

                    Alternative 9: 73.8% accurate, 1.8× speedup?

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

                      1. Initial program 91.9%

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

                        \[\leadsto \color{blue}{x} \]
                      3. Step-by-step derivation
                        1. Applied rewrites73.6%

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

                        if -0.00169999999999999991 < z < 7.40000000000000028e-33

                        1. Initial program 99.8%

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

                          \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                        3. Step-by-step derivation
                          1. +-commutativeN/A

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

                            \[\leadsto \frac{y}{e^{z}} \cdot \frac{5000000000000000}{5641895835477563} + x \]
                          3. lower-fma.f64N/A

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

                            \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, \frac{5000000000000000}{5641895835477563}, x\right) \]
                          5. lift-exp.f6474.4

                            \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, 0.8862269254527579, x\right) \]
                        4. Applied rewrites74.4%

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

                          \[\leadsto x + \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot y} \]
                        6. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + x \]
                          2. lower-fma.f6474.2

                            \[\leadsto \mathsf{fma}\left(0.8862269254527579, y, x\right) \]
                        7. Applied rewrites74.2%

                          \[\leadsto \mathsf{fma}\left(0.8862269254527579, \color{blue}{y}, x\right) \]
                        8. Step-by-step derivation
                          1. lift-fma.f64N/A

                            \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + x \]
                          2. +-commutativeN/A

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

                            \[\leadsto x - \left(\mathsf{neg}\left(\frac{5000000000000000}{5641895835477563}\right)\right) \cdot \color{blue}{y} \]
                          4. metadata-evalN/A

                            \[\leadsto x - \frac{-5000000000000000}{5641895835477563} \cdot y \]
                          5. lower--.f64N/A

                            \[\leadsto x - \frac{-5000000000000000}{5641895835477563} \cdot \color{blue}{y} \]
                          6. lower-*.f6474.2

                            \[\leadsto x - -0.8862269254527579 \cdot y \]
                        9. Applied rewrites74.2%

                          \[\leadsto x - -0.8862269254527579 \cdot \color{blue}{y} \]
                      4. Recombined 2 regimes into one program.
                      5. Add Preprocessing

                      Alternative 10: 73.8% accurate, 1.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -0.0017:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-33}:\\ \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                      (FPCore (x y z)
                       :precision binary64
                       (if (<= z -0.0017) x (if (<= z 7.4e-33) (fma 0.8862269254527579 y x) x)))
                      double code(double x, double y, double z) {
                      	double tmp;
                      	if (z <= -0.0017) {
                      		tmp = x;
                      	} else if (z <= 7.4e-33) {
                      		tmp = fma(0.8862269254527579, y, x);
                      	} else {
                      		tmp = x;
                      	}
                      	return tmp;
                      }
                      
                      function code(x, y, z)
                      	tmp = 0.0
                      	if (z <= -0.0017)
                      		tmp = x;
                      	elseif (z <= 7.4e-33)
                      		tmp = fma(0.8862269254527579, y, x);
                      	else
                      		tmp = x;
                      	end
                      	return tmp
                      end
                      
                      code[x_, y_, z_] := If[LessEqual[z, -0.0017], x, If[LessEqual[z, 7.4e-33], N[(0.8862269254527579 * y + x), $MachinePrecision], x]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;z \leq -0.0017:\\
                      \;\;\;\;x\\
                      
                      \mathbf{elif}\;z \leq 7.4 \cdot 10^{-33}:\\
                      \;\;\;\;\mathsf{fma}\left(0.8862269254527579, y, x\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if z < -0.00169999999999999991 or 7.40000000000000028e-33 < z

                        1. Initial program 91.9%

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

                          \[\leadsto \color{blue}{x} \]
                        3. Step-by-step derivation
                          1. Applied rewrites73.6%

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

                          if -0.00169999999999999991 < z < 7.40000000000000028e-33

                          1. Initial program 99.8%

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

                            \[\leadsto \color{blue}{x + \frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                          3. Step-by-step derivation
                            1. +-commutativeN/A

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

                              \[\leadsto \frac{y}{e^{z}} \cdot \frac{5000000000000000}{5641895835477563} + x \]
                            3. lower-fma.f64N/A

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

                              \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, \frac{5000000000000000}{5641895835477563}, x\right) \]
                            5. lift-exp.f6474.4

                              \[\leadsto \mathsf{fma}\left(\frac{y}{e^{z}}, 0.8862269254527579, x\right) \]
                          4. Applied rewrites74.4%

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

                            \[\leadsto x + \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot y} \]
                          6. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \frac{5000000000000000}{5641895835477563} \cdot y + x \]
                            2. lower-fma.f6474.2

                              \[\leadsto \mathsf{fma}\left(0.8862269254527579, y, x\right) \]
                          7. Applied rewrites74.2%

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

                        Alternative 11: 70.3% accurate, 2.2× speedup?

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

                          1. Initial program 97.1%

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

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

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

                            if -7.00000000000000029e-192 < x < 2.9000000000000001e-147

                            1. Initial program 90.6%

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

                              \[\leadsto \color{blue}{\frac{5000000000000000}{5641895835477563} \cdot \frac{y}{e^{z}}} \]
                            3. Step-by-step derivation
                              1. *-commutativeN/A

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

                                \[\leadsto \frac{y}{e^{z}} \cdot \color{blue}{\frac{5000000000000000}{5641895835477563}} \]
                              3. lower-/.f64N/A

                                \[\leadsto \frac{y}{e^{z}} \cdot \frac{5000000000000000}{5641895835477563} \]
                              4. lift-exp.f6440.1

                                \[\leadsto \frac{y}{e^{z}} \cdot 0.8862269254527579 \]
                            4. Applied rewrites40.1%

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

                              \[\leadsto y \cdot \frac{5000000000000000}{5641895835477563} \]
                            6. Step-by-step derivation
                              1. Applied rewrites37.8%

                                \[\leadsto y \cdot 0.8862269254527579 \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 12: 69.0% accurate, 25.8× 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. Taylor expanded in x around inf

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

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

                              Reproduce

                              ?
                              herbie shell --seed 2025110 
                              (FPCore (x y z)
                                :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
                                :precision binary64
                                (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))