Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B

Percentage Accurate: 96.3% → 99.6%
Time: 10.1s
Alternatives: 11
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
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, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 96.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
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, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}

Alternative 1: 99.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ x \cdot e^{\mathsf{fma}\left(-a, z + b, \left(\log z - t\right) \cdot y\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (fma (- a) (+ z b) (* (- (log z) t) y)))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(fma(-a, (z + b), ((log(z) - t) * y)));
}
function code(x, y, z, t, a, b)
	return Float64(x * exp(fma(Float64(-a), Float64(z + b), Float64(Float64(log(z) - t) * y))))
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-a) * N[(z + b), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x \cdot e^{\mathsf{fma}\left(-a, z + b, \left(\log z - t\right) \cdot y\right)}
\end{array}
Derivation
  1. Initial program 96.6%

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in z around 0

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

      \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(-a, z + b, \left(\log z - t\right) \cdot y\right)}} \]
    2. Add Preprocessing

    Alternative 2: 50.0% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+17} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+23}\right):\\ \;\;\;\;e^{\left(-a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot z}\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
       (if (or (<= t_1 -2e+17) (not (<= t_1 5e+23)))
         (exp (* (- a) b))
         (* x (exp (* (- a) z))))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
    	double tmp;
    	if ((t_1 <= -2e+17) || !(t_1 <= 5e+23)) {
    		tmp = exp((-a * b));
    	} else {
    		tmp = x * exp((-a * z));
    	}
    	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, t, a, b)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8) :: t_1
        real(8) :: tmp
        t_1 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
        if ((t_1 <= (-2d+17)) .or. (.not. (t_1 <= 5d+23))) then
            tmp = exp((-a * b))
        else
            tmp = x * exp((-a * z))
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
    	double tmp;
    	if ((t_1 <= -2e+17) || !(t_1 <= 5e+23)) {
    		tmp = Math.exp((-a * b));
    	} else {
    		tmp = x * Math.exp((-a * z));
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	t_1 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))
    	tmp = 0
    	if (t_1 <= -2e+17) or not (t_1 <= 5e+23):
    		tmp = math.exp((-a * b))
    	else:
    		tmp = x * math.exp((-a * z))
    	return tmp
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))
    	tmp = 0.0
    	if ((t_1 <= -2e+17) || !(t_1 <= 5e+23))
    		tmp = exp(Float64(Float64(-a) * b));
    	else
    		tmp = Float64(x * exp(Float64(Float64(-a) * z)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
    	tmp = 0.0;
    	if ((t_1 <= -2e+17) || ~((t_1 <= 5e+23)))
    		tmp = exp((-a * b));
    	else
    		tmp = x * exp((-a * z));
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+17], N[Not[LessEqual[t$95$1, 5e+23]], $MachinePrecision]], N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision], N[(x * N[Exp[N[((-a) * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
    \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+17} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+23}\right):\\
    \;\;\;\;e^{\left(-a\right) \cdot b}\\
    
    \mathbf{else}:\\
    \;\;\;\;x \cdot e^{\left(-a\right) \cdot z}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e17 or 4.9999999999999999e23 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

      1. Initial program 98.1%

        \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in t around inf

        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
      4. Step-by-step derivation
        1. Applied rewrites45.2%

          \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
        2. Step-by-step derivation
          1. add-exp-logN/A

            \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
          2. lower-exp.f64N/A

            \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
          3. lift-*.f64N/A

            \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
          4. log-prodN/A

            \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
          5. lift-exp.f64N/A

            \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
          6. add-log-expN/A

            \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
          7. lower-+.f64N/A

            \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
          8. lower-log.f6422.3

            \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
        3. Applied rewrites9.2%

          \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
        4. Taylor expanded in b around inf

          \[\leadsto e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
        5. Step-by-step derivation
          1. Applied rewrites45.8%

            \[\leadsto e^{\color{blue}{\left(-a\right) \cdot b}} \]

          if -2e17 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.9999999999999999e23

          1. Initial program 89.5%

            \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

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

              \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(-a, z + b, \left(\log z - t\right) \cdot y\right)}} \]
            2. Taylor expanded in z around inf

              \[\leadsto x \cdot e^{-1 \cdot \color{blue}{\left(a \cdot z\right)}} \]
            3. Step-by-step derivation
              1. Applied rewrites90.6%

                \[\leadsto x \cdot e^{\left(-a\right) \cdot \color{blue}{z}} \]
            4. Recombined 2 regimes into one program.
            5. Final simplification53.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2 \cdot 10^{+17} \lor \neg \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 5 \cdot 10^{+23}\right):\\ \;\;\;\;e^{\left(-a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-a\right) \cdot z}\\ \end{array} \]
            6. Add Preprocessing

            Alternative 3: 47.9% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+17} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+23}\right):\\ \;\;\;\;e^{\left(-a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;e^{b \cdot a} \cdot x\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (let* ((t_1 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
               (if (or (<= t_1 -2e+17) (not (<= t_1 5e+23)))
                 (exp (* (- a) b))
                 (* (exp (* b a)) x))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
            	double tmp;
            	if ((t_1 <= -2e+17) || !(t_1 <= 5e+23)) {
            		tmp = exp((-a * b));
            	} else {
            		tmp = exp((b * a)) * 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, t, a, b)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8) :: t_1
                real(8) :: tmp
                t_1 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
                if ((t_1 <= (-2d+17)) .or. (.not. (t_1 <= 5d+23))) then
                    tmp = exp((-a * b))
                else
                    tmp = exp((b * a)) * x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t, double a, double b) {
            	double t_1 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
            	double tmp;
            	if ((t_1 <= -2e+17) || !(t_1 <= 5e+23)) {
            		tmp = Math.exp((-a * b));
            	} else {
            		tmp = Math.exp((b * a)) * x;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	t_1 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))
            	tmp = 0
            	if (t_1 <= -2e+17) or not (t_1 <= 5e+23):
            		tmp = math.exp((-a * b))
            	else:
            		tmp = math.exp((b * a)) * x
            	return tmp
            
            function code(x, y, z, t, a, b)
            	t_1 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))
            	tmp = 0.0
            	if ((t_1 <= -2e+17) || !(t_1 <= 5e+23))
            		tmp = exp(Float64(Float64(-a) * b));
            	else
            		tmp = Float64(exp(Float64(b * a)) * x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	t_1 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
            	tmp = 0.0;
            	if ((t_1 <= -2e+17) || ~((t_1 <= 5e+23)))
            		tmp = exp((-a * b));
            	else
            		tmp = exp((b * a)) * x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e+17], N[Not[LessEqual[t$95$1, 5e+23]], $MachinePrecision]], N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision], N[(N[Exp[N[(b * a), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
            \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+17} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+23}\right):\\
            \;\;\;\;e^{\left(-a\right) \cdot b}\\
            
            \mathbf{else}:\\
            \;\;\;\;e^{b \cdot a} \cdot x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -2e17 or 4.9999999999999999e23 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

              1. Initial program 98.1%

                \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in t around inf

                \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
              4. Step-by-step derivation
                1. Applied rewrites45.2%

                  \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                2. Step-by-step derivation
                  1. add-exp-logN/A

                    \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                  2. lower-exp.f64N/A

                    \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                  3. lift-*.f64N/A

                    \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                  4. log-prodN/A

                    \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
                  5. lift-exp.f64N/A

                    \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
                  6. add-log-expN/A

                    \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
                  7. lower-+.f64N/A

                    \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
                  8. lower-log.f6422.3

                    \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
                3. Applied rewrites9.2%

                  \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
                4. Taylor expanded in b around inf

                  \[\leadsto e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                5. Step-by-step derivation
                  1. Applied rewrites45.8%

                    \[\leadsto e^{\color{blue}{\left(-a\right) \cdot b}} \]

                  if -2e17 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 4.9999999999999999e23

                  1. Initial program 89.5%

                    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in b around inf

                    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                  4. Step-by-step derivation
                    1. Applied rewrites82.2%

                      \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]
                    2. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \color{blue}{x \cdot e^{\left(-b\right) \cdot a}} \]
                      2. *-commutativeN/A

                        \[\leadsto \color{blue}{e^{\left(-b\right) \cdot a} \cdot x} \]
                      3. lower-*.f6482.2

                        \[\leadsto \color{blue}{e^{\left(-b\right) \cdot a} \cdot x} \]
                    3. Applied rewrites82.2%

                      \[\leadsto \color{blue}{e^{b \cdot a} \cdot x} \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification52.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq -2 \cdot 10^{+17} \lor \neg \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 5 \cdot 10^{+23}\right):\\ \;\;\;\;e^{\left(-a\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;e^{b \cdot a} \cdot x\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 4: 79.1% accurate, 1.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+138}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+48}:\\ \;\;\;\;x \cdot e^{\left(\log z - t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{b \cdot a}}\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b)
                   :precision binary64
                   (if (<= a -1e+138)
                     (* x (exp (* (- b) a)))
                     (if (<= a 1.3e+48) (* x (exp (* (- (log z) t) y))) (/ x (exp (* b a))))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	double tmp;
                  	if (a <= -1e+138) {
                  		tmp = x * exp((-b * a));
                  	} else if (a <= 1.3e+48) {
                  		tmp = x * exp(((log(z) - t) * y));
                  	} else {
                  		tmp = x / exp((b * a));
                  	}
                  	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, t, a, b)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: t
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      real(8) :: tmp
                      if (a <= (-1d+138)) then
                          tmp = x * exp((-b * a))
                      else if (a <= 1.3d+48) then
                          tmp = x * exp(((log(z) - t) * y))
                      else
                          tmp = x / exp((b * a))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t, double a, double b) {
                  	double tmp;
                  	if (a <= -1e+138) {
                  		tmp = x * Math.exp((-b * a));
                  	} else if (a <= 1.3e+48) {
                  		tmp = x * Math.exp(((Math.log(z) - t) * y));
                  	} else {
                  		tmp = x / Math.exp((b * a));
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t, a, b):
                  	tmp = 0
                  	if a <= -1e+138:
                  		tmp = x * math.exp((-b * a))
                  	elif a <= 1.3e+48:
                  		tmp = x * math.exp(((math.log(z) - t) * y))
                  	else:
                  		tmp = x / math.exp((b * a))
                  	return tmp
                  
                  function code(x, y, z, t, a, b)
                  	tmp = 0.0
                  	if (a <= -1e+138)
                  		tmp = Float64(x * exp(Float64(Float64(-b) * a)));
                  	elseif (a <= 1.3e+48)
                  		tmp = Float64(x * exp(Float64(Float64(log(z) - t) * y)));
                  	else
                  		tmp = Float64(x / exp(Float64(b * a)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t, a, b)
                  	tmp = 0.0;
                  	if (a <= -1e+138)
                  		tmp = x * exp((-b * a));
                  	elseif (a <= 1.3e+48)
                  		tmp = x * exp(((log(z) - t) * y));
                  	else
                  		tmp = x / exp((b * a));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1e+138], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.3e+48], N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(b * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;a \leq -1 \cdot 10^{+138}:\\
                  \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
                  
                  \mathbf{elif}\;a \leq 1.3 \cdot 10^{+48}:\\
                  \;\;\;\;x \cdot e^{\left(\log z - t\right) \cdot y}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{x}{e^{b \cdot a}}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if a < -1e138

                    1. Initial program 93.1%

                      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in b around inf

                      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites91.0%

                        \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]

                      if -1e138 < a < 1.29999999999999998e48

                      1. Initial program 98.7%

                        \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y around inf

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

                          \[\leadsto x \cdot e^{\color{blue}{\left(\log z - t\right) \cdot y}} \]

                        if 1.29999999999999998e48 < a

                        1. Initial program 93.5%

                          \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                        2. Add Preprocessing
                        3. Step-by-step derivation
                          1. lift-exp.f64N/A

                            \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                          2. sinh-+-cosh-revN/A

                            \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                          3. flip-+N/A

                            \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                          4. sinh-coshN/A

                            \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                          5. sinh---cosh-revN/A

                            \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                          6. lower-/.f64N/A

                            \[\leadsto x \cdot \color{blue}{\frac{1}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                        4. Applied rewrites93.5%

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

                          \[\leadsto \color{blue}{\frac{x}{e^{\mathsf{neg}\left(\left(-1 \cdot \left(a \cdot b\right) + y \cdot \left(\log z - t\right)\right)\right)}}} \]
                        6. Step-by-step derivation
                          1. Applied rewrites93.5%

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

                            \[\leadsto \frac{x}{e^{a \cdot b}} \]
                          3. Step-by-step derivation
                            1. Applied rewrites77.0%

                              \[\leadsto \frac{x}{e^{b \cdot a}} \]
                          4. Recombined 3 regimes into one program.
                          5. Add Preprocessing

                          Alternative 5: 73.9% accurate, 1.5× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 1.45 \cdot 10^{-5}\right):\\ \;\;\;\;e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}}\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b)
                           :precision binary64
                           (if (or (<= y -2.5) (not (<= y 1.45e-5)))
                             (exp (* y (- (log z) t)))
                             (/ x (pow (E) (* b a)))))
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 1.45 \cdot 10^{-5}\right):\\
                          \;\;\;\;e^{y \cdot \left(\log z - t\right)}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if y < -2.5 or 1.45e-5 < y

                            1. Initial program 97.9%

                              \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in t around inf

                              \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                            4. Step-by-step derivation
                              1. Applied rewrites54.3%

                                \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                              2. Step-by-step derivation
                                1. add-exp-logN/A

                                  \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                2. lower-exp.f64N/A

                                  \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                3. lift-*.f64N/A

                                  \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                4. log-prodN/A

                                  \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
                                5. lift-exp.f64N/A

                                  \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
                                6. add-log-expN/A

                                  \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
                                7. lower-+.f64N/A

                                  \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
                                8. lower-log.f6427.8

                                  \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
                              3. Applied rewrites11.6%

                                \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
                              4. Taylor expanded in y around inf

                                \[\leadsto e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
                              5. Step-by-step derivation
                                1. Applied rewrites68.1%

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

                                if -2.5 < y < 1.45e-5

                                1. Initial program 95.0%

                                  \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. lift-exp.f64N/A

                                    \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                                  2. sinh-+-cosh-revN/A

                                    \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                                  3. flip-+N/A

                                    \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                                  4. sinh-coshN/A

                                    \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                                  5. sinh---cosh-revN/A

                                    \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                                  6. lower-/.f64N/A

                                    \[\leadsto x \cdot \color{blue}{\frac{1}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                                4. Applied rewrites95.0%

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

                                  \[\leadsto \color{blue}{\frac{x}{e^{\mathsf{neg}\left(\left(-1 \cdot \left(a \cdot b\right) + y \cdot \left(\log z - t\right)\right)\right)}}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites95.0%

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

                                    \[\leadsto \frac{x}{e^{\mathsf{neg}\left(-1 \cdot \left(a \cdot b\right)\right)}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites79.8%

                                      \[\leadsto \frac{x}{{\left(e^{1}\right)}^{\color{blue}{\left(b \cdot a\right)}}} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites79.8%

                                        \[\leadsto \frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}} \]
                                    3. Recombined 2 regimes into one program.
                                    4. Final simplification73.4%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.5 \lor \neg \left(y \leq 1.45 \cdot 10^{-5}\right):\\ \;\;\;\;e^{y \cdot \left(\log z - t\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}}\\ \end{array} \]
                                    5. Add Preprocessing

                                    Alternative 6: 70.5% accurate, 2.5× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}}\\ \end{array} \end{array} \]
                                    (FPCore (x y z t a b)
                                     :precision binary64
                                     (if (or (<= t -1.85e+200) (not (<= t 3.6e-25)))
                                       (* x (exp (* (- t) y)))
                                       (/ x (pow (E) (* b a)))))
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\
                                    \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if t < -1.8500000000000001e200 or 3.5999999999999999e-25 < t

                                      1. Initial program 97.5%

                                        \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in t around inf

                                        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites84.3%

                                          \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]

                                        if -1.8500000000000001e200 < t < 3.5999999999999999e-25

                                        1. Initial program 96.1%

                                          \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                        2. Add Preprocessing
                                        3. Step-by-step derivation
                                          1. lift-exp.f64N/A

                                            \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                                          2. sinh-+-cosh-revN/A

                                            \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                                          3. flip-+N/A

                                            \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                                          4. sinh-coshN/A

                                            \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                                          5. sinh---cosh-revN/A

                                            \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                                          6. lower-/.f64N/A

                                            \[\leadsto x \cdot \color{blue}{\frac{1}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                                        4. Applied rewrites96.1%

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

                                          \[\leadsto \color{blue}{\frac{x}{e^{\mathsf{neg}\left(\left(-1 \cdot \left(a \cdot b\right) + y \cdot \left(\log z - t\right)\right)\right)}}} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites96.1%

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

                                            \[\leadsto \frac{x}{e^{\mathsf{neg}\left(-1 \cdot \left(a \cdot b\right)\right)}} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites72.6%

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

                                                \[\leadsto \frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}} \]
                                            3. Recombined 2 regimes into one program.
                                            4. Final simplification76.3%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{{\mathsf{E}\left(\right)}^{\left(b \cdot a\right)}}\\ \end{array} \]
                                            5. Add Preprocessing

                                            Alternative 7: 70.5% accurate, 2.5× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{b \cdot a}}\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b)
                                             :precision binary64
                                             (if (or (<= t -1.85e+200) (not (<= t 3.6e-25)))
                                               (* x (exp (* (- t) y)))
                                               (/ x (exp (* b a)))))
                                            double code(double x, double y, double z, double t, double a, double b) {
                                            	double tmp;
                                            	if ((t <= -1.85e+200) || !(t <= 3.6e-25)) {
                                            		tmp = x * exp((-t * y));
                                            	} else {
                                            		tmp = x / exp((b * a));
                                            	}
                                            	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, t, a, b)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: x
                                                real(8), intent (in) :: y
                                                real(8), intent (in) :: z
                                                real(8), intent (in) :: t
                                                real(8), intent (in) :: a
                                                real(8), intent (in) :: b
                                                real(8) :: tmp
                                                if ((t <= (-1.85d+200)) .or. (.not. (t <= 3.6d-25))) then
                                                    tmp = x * exp((-t * y))
                                                else
                                                    tmp = x / exp((b * a))
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double x, double y, double z, double t, double a, double b) {
                                            	double tmp;
                                            	if ((t <= -1.85e+200) || !(t <= 3.6e-25)) {
                                            		tmp = x * Math.exp((-t * y));
                                            	} else {
                                            		tmp = x / Math.exp((b * a));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(x, y, z, t, a, b):
                                            	tmp = 0
                                            	if (t <= -1.85e+200) or not (t <= 3.6e-25):
                                            		tmp = x * math.exp((-t * y))
                                            	else:
                                            		tmp = x / math.exp((b * a))
                                            	return tmp
                                            
                                            function code(x, y, z, t, a, b)
                                            	tmp = 0.0
                                            	if ((t <= -1.85e+200) || !(t <= 3.6e-25))
                                            		tmp = Float64(x * exp(Float64(Float64(-t) * y)));
                                            	else
                                            		tmp = Float64(x / exp(Float64(b * a)));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(x, y, z, t, a, b)
                                            	tmp = 0.0;
                                            	if ((t <= -1.85e+200) || ~((t <= 3.6e-25)))
                                            		tmp = x * exp((-t * y));
                                            	else
                                            		tmp = x / exp((b * a));
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.85e+200], N[Not[LessEqual[t, 3.6e-25]], $MachinePrecision]], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x / N[Exp[N[(b * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\
                                            \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{x}{e^{b \cdot a}}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if t < -1.8500000000000001e200 or 3.5999999999999999e-25 < t

                                              1. Initial program 97.5%

                                                \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                              2. Add Preprocessing
                                              3. Taylor expanded in t around inf

                                                \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                              4. Step-by-step derivation
                                                1. Applied rewrites84.3%

                                                  \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]

                                                if -1.8500000000000001e200 < t < 3.5999999999999999e-25

                                                1. Initial program 96.1%

                                                  \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-exp.f64N/A

                                                    \[\leadsto x \cdot \color{blue}{e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                                                  2. sinh-+-cosh-revN/A

                                                    \[\leadsto x \cdot \color{blue}{\left(\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) + \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)} \]
                                                  3. flip-+N/A

                                                    \[\leadsto x \cdot \color{blue}{\frac{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) \cdot \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                                                  4. sinh-coshN/A

                                                    \[\leadsto x \cdot \frac{\color{blue}{1}}{\cosh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right) - \sinh \left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                                                  5. sinh---cosh-revN/A

                                                    \[\leadsto x \cdot \frac{1}{\color{blue}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                                                  6. lower-/.f64N/A

                                                    \[\leadsto x \cdot \color{blue}{\frac{1}{e^{\mathsf{neg}\left(\left(y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\right)\right)}}} \]
                                                4. Applied rewrites96.1%

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

                                                  \[\leadsto \color{blue}{\frac{x}{e^{\mathsf{neg}\left(\left(-1 \cdot \left(a \cdot b\right) + y \cdot \left(\log z - t\right)\right)\right)}}} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites96.1%

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

                                                    \[\leadsto \frac{x}{e^{a \cdot b}} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites72.6%

                                                      \[\leadsto \frac{x}{e^{b \cdot a}} \]
                                                  4. Recombined 2 regimes into one program.
                                                  5. Final simplification76.2%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{b \cdot a}}\\ \end{array} \]
                                                  6. Add Preprocessing

                                                  Alternative 8: 70.5% accurate, 2.6× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \end{array} \]
                                                  (FPCore (x y z t a b)
                                                   :precision binary64
                                                   (if (or (<= t -1.85e+200) (not (<= t 3.6e-25)))
                                                     (* x (exp (* (- t) y)))
                                                     (* x (exp (* (- b) a)))))
                                                  double code(double x, double y, double z, double t, double a, double b) {
                                                  	double tmp;
                                                  	if ((t <= -1.85e+200) || !(t <= 3.6e-25)) {
                                                  		tmp = x * exp((-t * y));
                                                  	} else {
                                                  		tmp = x * exp((-b * a));
                                                  	}
                                                  	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, t, a, b)
                                                  use fmin_fmax_functions
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      real(8), intent (in) :: z
                                                      real(8), intent (in) :: t
                                                      real(8), intent (in) :: a
                                                      real(8), intent (in) :: b
                                                      real(8) :: tmp
                                                      if ((t <= (-1.85d+200)) .or. (.not. (t <= 3.6d-25))) then
                                                          tmp = x * exp((-t * y))
                                                      else
                                                          tmp = x * exp((-b * a))
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  public static double code(double x, double y, double z, double t, double a, double b) {
                                                  	double tmp;
                                                  	if ((t <= -1.85e+200) || !(t <= 3.6e-25)) {
                                                  		tmp = x * Math.exp((-t * y));
                                                  	} else {
                                                  		tmp = x * Math.exp((-b * a));
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(x, y, z, t, a, b):
                                                  	tmp = 0
                                                  	if (t <= -1.85e+200) or not (t <= 3.6e-25):
                                                  		tmp = x * math.exp((-t * y))
                                                  	else:
                                                  		tmp = x * math.exp((-b * a))
                                                  	return tmp
                                                  
                                                  function code(x, y, z, t, a, b)
                                                  	tmp = 0.0
                                                  	if ((t <= -1.85e+200) || !(t <= 3.6e-25))
                                                  		tmp = Float64(x * exp(Float64(Float64(-t) * y)));
                                                  	else
                                                  		tmp = Float64(x * exp(Float64(Float64(-b) * a)));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(x, y, z, t, a, b)
                                                  	tmp = 0.0;
                                                  	if ((t <= -1.85e+200) || ~((t <= 3.6e-25)))
                                                  		tmp = x * exp((-t * y));
                                                  	else
                                                  		tmp = x * exp((-b * a));
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.85e+200], N[Not[LessEqual[t, 3.6e-25]], $MachinePrecision]], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\
                                                  \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if t < -1.8500000000000001e200 or 3.5999999999999999e-25 < t

                                                    1. Initial program 97.5%

                                                      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in t around inf

                                                      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                    4. Step-by-step derivation
                                                      1. Applied rewrites84.3%

                                                        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]

                                                      if -1.8500000000000001e200 < t < 3.5999999999999999e-25

                                                      1. Initial program 96.1%

                                                        \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in b around inf

                                                        \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites72.6%

                                                          \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]
                                                      5. Recombined 2 regimes into one program.
                                                      6. Final simplification76.2%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 3.6 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \]
                                                      7. Add Preprocessing

                                                      Alternative 9: 64.1% accurate, 2.6× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{+201} \lor \neg \left(t \leq 4.7 \cdot 10^{+137}\right):\\ \;\;\;\;e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \end{array} \]
                                                      (FPCore (x y z t a b)
                                                       :precision binary64
                                                       (if (or (<= t -1.12e+201) (not (<= t 4.7e+137)))
                                                         (exp (* (- t) y))
                                                         (* x (exp (* (- b) a)))))
                                                      double code(double x, double y, double z, double t, double a, double b) {
                                                      	double tmp;
                                                      	if ((t <= -1.12e+201) || !(t <= 4.7e+137)) {
                                                      		tmp = exp((-t * y));
                                                      	} else {
                                                      		tmp = x * exp((-b * a));
                                                      	}
                                                      	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, t, a, b)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          real(8), intent (in) :: z
                                                          real(8), intent (in) :: t
                                                          real(8), intent (in) :: a
                                                          real(8), intent (in) :: b
                                                          real(8) :: tmp
                                                          if ((t <= (-1.12d+201)) .or. (.not. (t <= 4.7d+137))) then
                                                              tmp = exp((-t * y))
                                                          else
                                                              tmp = x * exp((-b * a))
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double x, double y, double z, double t, double a, double b) {
                                                      	double tmp;
                                                      	if ((t <= -1.12e+201) || !(t <= 4.7e+137)) {
                                                      		tmp = Math.exp((-t * y));
                                                      	} else {
                                                      		tmp = x * Math.exp((-b * a));
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(x, y, z, t, a, b):
                                                      	tmp = 0
                                                      	if (t <= -1.12e+201) or not (t <= 4.7e+137):
                                                      		tmp = math.exp((-t * y))
                                                      	else:
                                                      		tmp = x * math.exp((-b * a))
                                                      	return tmp
                                                      
                                                      function code(x, y, z, t, a, b)
                                                      	tmp = 0.0
                                                      	if ((t <= -1.12e+201) || !(t <= 4.7e+137))
                                                      		tmp = exp(Float64(Float64(-t) * y));
                                                      	else
                                                      		tmp = Float64(x * exp(Float64(Float64(-b) * a)));
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(x, y, z, t, a, b)
                                                      	tmp = 0.0;
                                                      	if ((t <= -1.12e+201) || ~((t <= 4.7e+137)))
                                                      		tmp = exp((-t * y));
                                                      	else
                                                      		tmp = x * exp((-b * a));
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.12e+201], N[Not[LessEqual[t, 4.7e+137]], $MachinePrecision]], N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;t \leq -1.12 \cdot 10^{+201} \lor \neg \left(t \leq 4.7 \cdot 10^{+137}\right):\\
                                                      \;\;\;\;e^{\left(-t\right) \cdot y}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if t < -1.11999999999999994e201 or 4.6999999999999998e137 < t

                                                        1. Initial program 96.1%

                                                          \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in t around inf

                                                          \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites92.3%

                                                            \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                                                          2. Step-by-step derivation
                                                            1. add-exp-logN/A

                                                              \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                            2. lower-exp.f64N/A

                                                              \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                            3. lift-*.f64N/A

                                                              \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                            4. log-prodN/A

                                                              \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                            5. lift-exp.f64N/A

                                                              \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                            6. add-log-expN/A

                                                              \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
                                                            7. lower-+.f64N/A

                                                              \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
                                                            8. lower-log.f6446.9

                                                              \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
                                                          3. Applied rewrites5.1%

                                                            \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
                                                          4. Taylor expanded in t around inf

                                                            \[\leadsto e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                          5. Step-by-step derivation
                                                            1. Applied rewrites63.2%

                                                              \[\leadsto e^{\color{blue}{\left(-t\right) \cdot y}} \]

                                                            if -1.11999999999999994e201 < t < 4.6999999999999998e137

                                                            1. Initial program 96.7%

                                                              \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                            2. Add Preprocessing
                                                            3. Taylor expanded in b around inf

                                                              \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                                                            4. Step-by-step derivation
                                                              1. Applied rewrites72.1%

                                                                \[\leadsto x \cdot e^{\color{blue}{\left(-b\right) \cdot a}} \]
                                                            5. Recombined 2 regimes into one program.
                                                            6. Final simplification70.3%

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.12 \cdot 10^{+201} \lor \neg \left(t \leq 4.7 \cdot 10^{+137}\right):\\ \;\;\;\;e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \]
                                                            7. Add Preprocessing

                                                            Alternative 10: 40.5% accurate, 2.7× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 4.8 \cdot 10^{+125}\right):\\ \;\;\;\;e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-a\right) \cdot b}\\ \end{array} \end{array} \]
                                                            (FPCore (x y z t a b)
                                                             :precision binary64
                                                             (if (or (<= t -1.85e+200) (not (<= t 4.8e+125)))
                                                               (exp (* (- t) y))
                                                               (exp (* (- a) b))))
                                                            double code(double x, double y, double z, double t, double a, double b) {
                                                            	double tmp;
                                                            	if ((t <= -1.85e+200) || !(t <= 4.8e+125)) {
                                                            		tmp = exp((-t * y));
                                                            	} else {
                                                            		tmp = exp((-a * b));
                                                            	}
                                                            	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, t, a, b)
                                                            use fmin_fmax_functions
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                real(8), intent (in) :: z
                                                                real(8), intent (in) :: t
                                                                real(8), intent (in) :: a
                                                                real(8), intent (in) :: b
                                                                real(8) :: tmp
                                                                if ((t <= (-1.85d+200)) .or. (.not. (t <= 4.8d+125))) then
                                                                    tmp = exp((-t * y))
                                                                else
                                                                    tmp = exp((-a * b))
                                                                end if
                                                                code = tmp
                                                            end function
                                                            
                                                            public static double code(double x, double y, double z, double t, double a, double b) {
                                                            	double tmp;
                                                            	if ((t <= -1.85e+200) || !(t <= 4.8e+125)) {
                                                            		tmp = Math.exp((-t * y));
                                                            	} else {
                                                            		tmp = Math.exp((-a * b));
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(x, y, z, t, a, b):
                                                            	tmp = 0
                                                            	if (t <= -1.85e+200) or not (t <= 4.8e+125):
                                                            		tmp = math.exp((-t * y))
                                                            	else:
                                                            		tmp = math.exp((-a * b))
                                                            	return tmp
                                                            
                                                            function code(x, y, z, t, a, b)
                                                            	tmp = 0.0
                                                            	if ((t <= -1.85e+200) || !(t <= 4.8e+125))
                                                            		tmp = exp(Float64(Float64(-t) * y));
                                                            	else
                                                            		tmp = exp(Float64(Float64(-a) * b));
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(x, y, z, t, a, b)
                                                            	tmp = 0.0;
                                                            	if ((t <= -1.85e+200) || ~((t <= 4.8e+125)))
                                                            		tmp = exp((-t * y));
                                                            	else
                                                            		tmp = exp((-a * b));
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.85e+200], N[Not[LessEqual[t, 4.8e+125]], $MachinePrecision]], N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision], N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 4.8 \cdot 10^{+125}\right):\\
                                                            \;\;\;\;e^{\left(-t\right) \cdot y}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;e^{\left(-a\right) \cdot b}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if t < -1.8500000000000001e200 or 4.7999999999999999e125 < t

                                                              1. Initial program 96.3%

                                                                \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in t around inf

                                                                \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites92.7%

                                                                  \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                                                                2. Step-by-step derivation
                                                                  1. add-exp-logN/A

                                                                    \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                  2. lower-exp.f64N/A

                                                                    \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                  3. lift-*.f64N/A

                                                                    \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                  4. log-prodN/A

                                                                    \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                                  5. lift-exp.f64N/A

                                                                    \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                                  6. add-log-expN/A

                                                                    \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
                                                                  7. lower-+.f64N/A

                                                                    \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
                                                                  8. lower-log.f6446.0

                                                                    \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
                                                                3. Applied rewrites6.5%

                                                                  \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
                                                                4. Taylor expanded in t around inf

                                                                  \[\leadsto e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                                5. Step-by-step derivation
                                                                  1. Applied rewrites59.8%

                                                                    \[\leadsto e^{\color{blue}{\left(-t\right) \cdot y}} \]

                                                                  if -1.8500000000000001e200 < t < 4.7999999999999999e125

                                                                  1. Initial program 96.6%

                                                                    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in t around inf

                                                                    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                                  4. Step-by-step derivation
                                                                    1. Applied rewrites41.6%

                                                                      \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                                                                    2. Step-by-step derivation
                                                                      1. add-exp-logN/A

                                                                        \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                      2. lower-exp.f64N/A

                                                                        \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                      3. lift-*.f64N/A

                                                                        \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                      4. log-prodN/A

                                                                        \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                                      5. lift-exp.f64N/A

                                                                        \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                                      6. add-log-expN/A

                                                                        \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
                                                                      7. lower-+.f64N/A

                                                                        \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
                                                                      8. lower-log.f6422.3

                                                                        \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
                                                                    3. Applied rewrites18.3%

                                                                      \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
                                                                    4. Taylor expanded in b around inf

                                                                      \[\leadsto e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                                                                    5. Step-by-step derivation
                                                                      1. Applied rewrites45.0%

                                                                        \[\leadsto e^{\color{blue}{\left(-a\right) \cdot b}} \]
                                                                    6. Recombined 2 regimes into one program.
                                                                    7. Final simplification48.1%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.85 \cdot 10^{+200} \lor \neg \left(t \leq 4.8 \cdot 10^{+125}\right):\\ \;\;\;\;e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;e^{\left(-a\right) \cdot b}\\ \end{array} \]
                                                                    8. Add Preprocessing

                                                                    Alternative 11: 32.1% accurate, 3.0× speedup?

                                                                    \[\begin{array}{l} \\ e^{\left(-a\right) \cdot b} \end{array} \]
                                                                    (FPCore (x y z t a b) :precision binary64 (exp (* (- a) b)))
                                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                                    	return exp((-a * b));
                                                                    }
                                                                    
                                                                    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, t, a, b)
                                                                    use fmin_fmax_functions
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        real(8), intent (in) :: z
                                                                        real(8), intent (in) :: t
                                                                        real(8), intent (in) :: a
                                                                        real(8), intent (in) :: b
                                                                        code = exp((-a * b))
                                                                    end function
                                                                    
                                                                    public static double code(double x, double y, double z, double t, double a, double b) {
                                                                    	return Math.exp((-a * b));
                                                                    }
                                                                    
                                                                    def code(x, y, z, t, a, b):
                                                                    	return math.exp((-a * b))
                                                                    
                                                                    function code(x, y, z, t, a, b)
                                                                    	return exp(Float64(Float64(-a) * b))
                                                                    end
                                                                    
                                                                    function tmp = code(x, y, z, t, a, b)
                                                                    	tmp = exp((-a * b));
                                                                    end
                                                                    
                                                                    code[x_, y_, z_, t_, a_, b_] := N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    e^{\left(-a\right) \cdot b}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Initial program 96.6%

                                                                      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in t around inf

                                                                      \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                                                    4. Step-by-step derivation
                                                                      1. Applied rewrites52.4%

                                                                        \[\leadsto x \cdot e^{\color{blue}{\left(-t\right) \cdot y}} \]
                                                                      2. Step-by-step derivation
                                                                        1. add-exp-logN/A

                                                                          \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                        2. lower-exp.f64N/A

                                                                          \[\leadsto \color{blue}{e^{\log \left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                        3. lift-*.f64N/A

                                                                          \[\leadsto e^{\log \color{blue}{\left(x \cdot e^{\left(-t\right) \cdot y}\right)}} \]
                                                                        4. log-prodN/A

                                                                          \[\leadsto e^{\color{blue}{\log x + \log \left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                                        5. lift-exp.f64N/A

                                                                          \[\leadsto e^{\log x + \log \color{blue}{\left(e^{\left(-t\right) \cdot y}\right)}} \]
                                                                        6. add-log-expN/A

                                                                          \[\leadsto e^{\log x + \color{blue}{\left(-t\right) \cdot y}} \]
                                                                        7. lower-+.f64N/A

                                                                          \[\leadsto e^{\color{blue}{\log x + \left(-t\right) \cdot y}} \]
                                                                        8. lower-log.f6427.3

                                                                          \[\leadsto e^{\color{blue}{\log x} + \left(-t\right) \cdot y} \]
                                                                      3. Applied rewrites15.8%

                                                                        \[\leadsto \color{blue}{e^{\log x + t \cdot y}} \]
                                                                      4. Taylor expanded in b around inf

                                                                        \[\leadsto e^{\color{blue}{-1 \cdot \left(a \cdot b\right)}} \]
                                                                      5. Step-by-step derivation
                                                                        1. Applied rewrites38.3%

                                                                          \[\leadsto e^{\color{blue}{\left(-a\right) \cdot b}} \]
                                                                        2. Add Preprocessing

                                                                        Reproduce

                                                                        ?
                                                                        herbie shell --seed 2025021 
                                                                        (FPCore (x y z t a b)
                                                                          :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
                                                                          :precision binary64
                                                                          (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))