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

Percentage Accurate: 96.5% → 99.2%
Time: 6.8s
Alternatives: 12
Speedup: 1.4×

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}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 96.5% 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.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(-z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (- z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (-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 * (-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 * (-z - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (-z - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(Float64(-z) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (-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[((-z) - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{-1 \cdot z} - b\right)} \]
  3. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\mathsf{neg}\left(z\right)\right) - b\right)} \]
    2. lower-neg.f6499.2

      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(-z\right) - b\right)} \]
  4. Applied rewrites99.2%

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

Alternative 2: 30.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{1}{a \cdot b}\\ t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+180}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+31}:\\ \;\;\;\;\frac{x}{1}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* x (/ 1.0 (* a b))))
        (t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
   (if (<= t_2 -2e+180) t_1 (if (<= t_2 1e+31) (/ x 1.0) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = x * (1.0 / (a * b));
	double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
	double tmp;
	if (t_2 <= -2e+180) {
		tmp = t_1;
	} else if (t_2 <= 1e+31) {
		tmp = x / 1.0;
	} else {
		tmp = t_1;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 / (a * b))
    t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
    if (t_2 <= (-2d+180)) then
        tmp = t_1
    else if (t_2 <= 1d+31) then
        tmp = x / 1.0d0
    else
        tmp = t_1
    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 = x * (1.0 / (a * b));
	double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
	double tmp;
	if (t_2 <= -2e+180) {
		tmp = t_1;
	} else if (t_2 <= 1e+31) {
		tmp = x / 1.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = x * (1.0 / (a * b))
	t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))
	tmp = 0
	if t_2 <= -2e+180:
		tmp = t_1
	elif t_2 <= 1e+31:
		tmp = x / 1.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(x * Float64(1.0 / Float64(a * b)))
	t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))
	tmp = 0.0
	if (t_2 <= -2e+180)
		tmp = t_1;
	elseif (t_2 <= 1e+31)
		tmp = Float64(x / 1.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = x * (1.0 / (a * b));
	t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
	tmp = 0.0;
	if (t_2 <= -2e+180)
		tmp = t_1;
	elseif (t_2 <= 1e+31)
		tmp = x / 1.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(1.0 / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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[LessEqual[t$95$2, -2e+180], t$95$1, If[LessEqual[t$95$2, 1e+31], N[(x / 1.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{1}{a \cdot b}\\
t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+180}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 10^{+31}:\\
\;\;\;\;\frac{x}{1}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\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))) < -2e180 or 9.9999999999999996e30 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

    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. 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. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
      10. fp-cancel-sign-sub-invN/A

        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
      11. exp-diffN/A

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

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

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

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

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

        \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto x \cdot \frac{1}{1 + \color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
        2. lower-*.f64N/A

          \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \color{blue}{\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
        3. lower-*.f64N/A

          \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}\right)} \]
        4. lift-log.f64N/A

          \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
        5. lift--.f64N/A

          \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
        6. lift--.f6417.4

          \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - \color{blue}{b}\right)\right)} \]
      4. Applied rewrites17.4%

        \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
      5. Taylor expanded in b around inf

        \[\leadsto x \cdot \frac{1}{a \cdot \color{blue}{b}} \]
      6. Step-by-step derivation
        1. lift-*.f6421.5

          \[\leadsto x \cdot \frac{1}{a \cdot b} \]
      7. Applied rewrites21.5%

        \[\leadsto x \cdot \frac{1}{a \cdot \color{blue}{b}} \]

      if -2e180 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e30

      1. Initial program 94.1%

        \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
      2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

          \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
        10. fp-cancel-sign-sub-invN/A

          \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
        11. exp-diffN/A

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

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

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

        \[\leadsto \color{blue}{\frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
      5. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
        3. pow-expN/A

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

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

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

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

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

          \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}} \]
        9. associate-*r*N/A

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

          \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
        11. mul-1-negN/A

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

          \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
        13. mul-1-negN/A

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

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

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

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

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

          \[\leadsto \frac{x}{1} \]
        3. Step-by-step derivation
          1. Applied rewrites47.1%

            \[\leadsto \frac{x}{1} \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 3: 32.4% accurate, 1.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 10^{+31}:\\ \;\;\;\;x \cdot \frac{1}{1 + a \cdot \left(b + z\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{a \cdot b}\\ \end{array} \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) 1e+31)
           (* x (/ 1.0 (+ 1.0 (* a (+ b z)))))
           (* x (/ 1.0 (* a b)))))
        double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= 1e+31) {
        		tmp = x * (1.0 / (1.0 + (a * (b + z))));
        	} else {
        		tmp = x * (1.0 / (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 (((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= 1d+31) then
                tmp = x * (1.0d0 / (1.0d0 + (a * (b + z))))
            else
                tmp = x * (1.0d0 / (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 (((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= 1e+31) {
        		tmp = x * (1.0 / (1.0 + (a * (b + z))));
        	} else {
        		tmp = x * (1.0 / (a * b));
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	tmp = 0
        	if ((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))) <= 1e+31:
        		tmp = x * (1.0 / (1.0 + (a * (b + z))))
        	else:
        		tmp = x * (1.0 / (a * b))
        	return tmp
        
        function code(x, y, z, t, a, b)
        	tmp = 0.0
        	if (Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= 1e+31)
        		tmp = Float64(x * Float64(1.0 / Float64(1.0 + Float64(a * Float64(b + z)))));
        	else
        		tmp = Float64(x * Float64(1.0 / Float64(a * b)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	tmp = 0.0;
        	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= 1e+31)
        		tmp = x * (1.0 / (1.0 + (a * (b + z))));
        	else
        		tmp = x * (1.0 / (a * b));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], 1e+31], N[(x * N[(1.0 / N[(1.0 + N[(a * N[(b + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 10^{+31}:\\
        \;\;\;\;x \cdot \frac{1}{1 + a \cdot \left(b + z\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;x \cdot \frac{1}{a \cdot b}\\
        
        
        \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))) < 9.9999999999999996e30

          1. Initial program 96.4%

            \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
          2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

              \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
            10. fp-cancel-sign-sub-invN/A

              \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
            11. exp-diffN/A

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

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

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

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

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

              \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
            3. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + \color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
              2. lower-*.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \color{blue}{\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}\right)} \]
              4. lift-log.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
              5. lift--.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
              6. lift--.f6446.1

                \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - \color{blue}{b}\right)\right)} \]
            4. Applied rewrites46.1%

              \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
            5. Taylor expanded in z around 0

              \[\leadsto x \cdot \frac{1}{1 + \color{blue}{\left(a \cdot b + a \cdot z\right)}} \]
            6. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + \left(a \cdot b + \color{blue}{a \cdot z}\right)} \]
              2. distribute-lft-outN/A

                \[\leadsto x \cdot \frac{1}{1 + a \cdot \left(b + \color{blue}{z}\right)} \]
              3. lower-*.f64N/A

                \[\leadsto x \cdot \frac{1}{1 + a \cdot \left(b + \color{blue}{z}\right)} \]
              4. lower-+.f6446.6

                \[\leadsto x \cdot \frac{1}{1 + a \cdot \left(b + z\right)} \]
            7. Applied rewrites46.6%

              \[\leadsto x \cdot \frac{1}{1 + \color{blue}{a \cdot \left(b + z\right)}} \]

            if 9.9999999999999996e30 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

            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. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
              10. fp-cancel-sign-sub-invN/A

                \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
              11. exp-diffN/A

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

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

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

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

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

                \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
              3. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto x \cdot \frac{1}{1 + \color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                2. lower-*.f64N/A

                  \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \color{blue}{\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                3. lower-*.f64N/A

                  \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}\right)} \]
                4. lift-log.f64N/A

                  \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                5. lift--.f64N/A

                  \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                6. lift--.f643.4

                  \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - \color{blue}{b}\right)\right)} \]
              4. Applied rewrites3.4%

                \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
              5. Taylor expanded in b around inf

                \[\leadsto x \cdot \frac{1}{a \cdot \color{blue}{b}} \]
              6. Step-by-step derivation
                1. lift-*.f6410.4

                  \[\leadsto x \cdot \frac{1}{a \cdot b} \]
              7. Applied rewrites10.4%

                \[\leadsto x \cdot \frac{1}{a \cdot \color{blue}{b}} \]
            6. Recombined 2 regimes into one program.
            7. Add Preprocessing

            Alternative 4: 32.0% accurate, 1.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 10^{+31}:\\ \;\;\;\;x \cdot \frac{1}{1 + a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{1}{a \cdot b}\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) 1e+31)
               (* x (/ 1.0 (+ 1.0 (* a b))))
               (* x (/ 1.0 (* a b)))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= 1e+31) {
            		tmp = x * (1.0 / (1.0 + (a * b)));
            	} else {
            		tmp = x * (1.0 / (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 (((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= 1d+31) then
                    tmp = x * (1.0d0 / (1.0d0 + (a * b)))
                else
                    tmp = x * (1.0d0 / (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 (((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= 1e+31) {
            		tmp = x * (1.0 / (1.0 + (a * b)));
            	} else {
            		tmp = x * (1.0 / (a * b));
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if ((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))) <= 1e+31:
            		tmp = x * (1.0 / (1.0 + (a * b)))
            	else:
            		tmp = x * (1.0 / (a * b))
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if (Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= 1e+31)
            		tmp = Float64(x * Float64(1.0 / Float64(1.0 + Float64(a * b))));
            	else
            		tmp = Float64(x * Float64(1.0 / Float64(a * b)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= 1e+31)
            		tmp = x * (1.0 / (1.0 + (a * b)));
            	else
            		tmp = x * (1.0 / (a * b));
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], 1e+31], N[(x * N[(1.0 / N[(1.0 + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 / N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 10^{+31}:\\
            \;\;\;\;x \cdot \frac{1}{1 + a \cdot b}\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot \frac{1}{a \cdot b}\\
            
            
            \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))) < 9.9999999999999996e30

              1. Initial program 96.4%

                \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
              2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                  \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                10. fp-cancel-sign-sub-invN/A

                  \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                11. exp-diffN/A

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

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

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

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

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

                  \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                3. Step-by-step derivation
                  1. lower-+.f64N/A

                    \[\leadsto x \cdot \frac{1}{1 + \color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                  2. lower-*.f64N/A

                    \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \color{blue}{\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                  3. lower-*.f64N/A

                    \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}\right)} \]
                  4. lift-log.f64N/A

                    \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                  5. lift--.f64N/A

                    \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                  6. lift--.f6446.1

                    \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - \color{blue}{b}\right)\right)} \]
                4. Applied rewrites46.1%

                  \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                5. Taylor expanded in z around 0

                  \[\leadsto x \cdot \frac{1}{1 + \color{blue}{a \cdot b}} \]
                6. Step-by-step derivation
                  1. lower-+.f64N/A

                    \[\leadsto x \cdot \frac{1}{1 + a \cdot \color{blue}{b}} \]
                  2. lift-*.f6446.0

                    \[\leadsto x \cdot \frac{1}{1 + a \cdot b} \]
                7. Applied rewrites46.0%

                  \[\leadsto x \cdot \frac{1}{1 + \color{blue}{a \cdot b}} \]

                if 9.9999999999999996e30 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))

                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. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                  10. fp-cancel-sign-sub-invN/A

                    \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                  11. exp-diffN/A

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

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

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

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

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

                    \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                  3. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto x \cdot \frac{1}{1 + \color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    2. lower-*.f64N/A

                      \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \color{blue}{\left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                    3. lower-*.f64N/A

                      \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \color{blue}{\left(\log \left(1 - z\right) - b\right)}\right)} \]
                    4. lift-log.f64N/A

                      \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                    5. lift--.f64N/A

                      \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \]
                    6. lift--.f643.4

                      \[\leadsto x \cdot \frac{1}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - \color{blue}{b}\right)\right)} \]
                  4. Applied rewrites3.4%

                    \[\leadsto x \cdot \frac{1}{\color{blue}{1 + -1 \cdot \left(a \cdot \left(\log \left(1 - z\right) - b\right)\right)}} \]
                  5. Taylor expanded in b around inf

                    \[\leadsto x \cdot \frac{1}{a \cdot \color{blue}{b}} \]
                  6. Step-by-step derivation
                    1. lift-*.f6410.4

                      \[\leadsto x \cdot \frac{1}{a \cdot b} \]
                  7. Applied rewrites10.4%

                    \[\leadsto x \cdot \frac{1}{a \cdot \color{blue}{b}} \]
                6. Recombined 2 regimes into one program.
                7. Add Preprocessing

                Alternative 5: 92.8% accurate, 1.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{\left(\log z - t\right) \cdot y}\\ \mathbf{if}\;y \leq -9.8 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{+174}:\\ \;\;\;\;x \cdot e^{\mathsf{fma}\left(y, -t, a \cdot \left(\left(-z\right) - b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (let* ((t_1 (* x (exp (* (- (log z) t) y)))))
                   (if (<= y -9.8e+39)
                     t_1
                     (if (<= y 1.55e+174) (* x (exp (fma y (- t) (* a (- (- z) b))))) t_1))))
                double code(double x, double y, double z, double t, double a, double b) {
                	double t_1 = x * exp(((log(z) - t) * y));
                	double tmp;
                	if (y <= -9.8e+39) {
                		tmp = t_1;
                	} else if (y <= 1.55e+174) {
                		tmp = x * exp(fma(y, -t, (a * (-z - b))));
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                function code(x, y, z, t, a, b)
                	t_1 = Float64(x * exp(Float64(Float64(log(z) - t) * y)))
                	tmp = 0.0
                	if (y <= -9.8e+39)
                		tmp = t_1;
                	elseif (y <= 1.55e+174)
                		tmp = Float64(x * exp(fma(y, Float64(-t), Float64(a * Float64(Float64(-z) - b)))));
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.8e+39], t$95$1, If[LessEqual[y, 1.55e+174], N[(x * N[Exp[N[(y * (-t) + N[(a * N[((-z) - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := x \cdot e^{\left(\log z - t\right) \cdot y}\\
                \mathbf{if}\;y \leq -9.8 \cdot 10^{+39}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;y \leq 1.55 \cdot 10^{+174}:\\
                \;\;\;\;x \cdot e^{\mathsf{fma}\left(y, -t, a \cdot \left(\left(-z\right) - b\right)\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -9.79999999999999974e39 or 1.55e174 < y

                  1. Initial program 97.2%

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

                    \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right)}} \]
                  3. Step-by-step derivation
                    1. *-commutativeN/A

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

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

                      \[\leadsto x \cdot e^{\left(\log z - t\right) \cdot y} \]
                    4. lift--.f6490.8

                      \[\leadsto x \cdot e^{\left(\log z - t\right) \cdot y} \]
                  4. Applied rewrites90.8%

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

                  if -9.79999999999999974e39 < y < 1.55e174

                  1. Initial program 96.2%

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

                    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{-1 \cdot z} - b\right)} \]
                  3. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\mathsf{neg}\left(z\right)\right) - b\right)} \]
                    2. lower-neg.f6499.9

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

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

                    \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-1 \cdot t\right)} + a \cdot \left(\left(-z\right) - b\right)} \]
                  6. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto x \cdot e^{y \cdot \left(\mathsf{neg}\left(t\right)\right) + a \cdot \left(\left(-z\right) - b\right)} \]
                    2. lift-neg.f6493.8

                      \[\leadsto x \cdot e^{y \cdot \left(-t\right) + a \cdot \left(\left(-z\right) - b\right)} \]
                  7. Applied rewrites93.8%

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

                      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right) + a \cdot \left(\left(-z\right) - b\right)}} \]
                    2. lift-*.f64N/A

                      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)} + a \cdot \left(\left(-z\right) - b\right)} \]
                    3. lower-fma.f6493.8

                      \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, -t, a \cdot \left(\left(-z\right) - b\right)\right)}} \]
                  9. Applied rewrites93.8%

                    \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, -t, a \cdot \left(\left(-z\right) - b\right)\right)}} \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 6: 74.6% accurate, 2.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-10}:\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{elif}\;y \leq 160:\\ \;\;\;\;\frac{x}{e^{a \cdot \left(b + z\right)}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{{z}^{y}}{1}\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (if (<= y -1e-10)
                   (* x (exp (* (- t) y)))
                   (if (<= y 160.0) (/ x (exp (* a (+ b z)))) (* x (/ (pow z y) 1.0)))))
                double code(double x, double y, double z, double t, double a, double b) {
                	double tmp;
                	if (y <= -1e-10) {
                		tmp = x * exp((-t * y));
                	} else if (y <= 160.0) {
                		tmp = x / exp((a * (b + z)));
                	} else {
                		tmp = x * (pow(z, y) / 1.0);
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, 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 (y <= (-1d-10)) then
                        tmp = x * exp((-t * y))
                    else if (y <= 160.0d0) then
                        tmp = x / exp((a * (b + z)))
                    else
                        tmp = x * ((z ** y) / 1.0d0)
                    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 (y <= -1e-10) {
                		tmp = x * Math.exp((-t * y));
                	} else if (y <= 160.0) {
                		tmp = x / Math.exp((a * (b + z)));
                	} else {
                		tmp = x * (Math.pow(z, y) / 1.0);
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a, b):
                	tmp = 0
                	if y <= -1e-10:
                		tmp = x * math.exp((-t * y))
                	elif y <= 160.0:
                		tmp = x / math.exp((a * (b + z)))
                	else:
                		tmp = x * (math.pow(z, y) / 1.0)
                	return tmp
                
                function code(x, y, z, t, a, b)
                	tmp = 0.0
                	if (y <= -1e-10)
                		tmp = Float64(x * exp(Float64(Float64(-t) * y)));
                	elseif (y <= 160.0)
                		tmp = Float64(x / exp(Float64(a * Float64(b + z))));
                	else
                		tmp = Float64(x * Float64((z ^ y) / 1.0));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a, b)
                	tmp = 0.0;
                	if (y <= -1e-10)
                		tmp = x * exp((-t * y));
                	elseif (y <= 160.0)
                		tmp = x / exp((a * (b + z)));
                	else
                		tmp = x * ((z ^ y) / 1.0);
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e-10], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 160.0], N[(x / N[Exp[N[(a * N[(b + z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Power[z, y], $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -1 \cdot 10^{-10}:\\
                \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
                
                \mathbf{elif}\;y \leq 160:\\
                \;\;\;\;\frac{x}{e^{a \cdot \left(b + z\right)}}\\
                
                \mathbf{else}:\\
                \;\;\;\;x \cdot \frac{{z}^{y}}{1}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if y < -1.00000000000000004e-10

                  1. Initial program 97.2%

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

                    \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                  3. Step-by-step derivation
                    1. associate-*r*N/A

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

                      \[\leadsto x \cdot e^{\left(-1 \cdot t\right) \cdot \color{blue}{y}} \]
                    3. mul-1-negN/A

                      \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(t\right)\right) \cdot y} \]
                    4. lower-neg.f6460.1

                      \[\leadsto x \cdot e^{\left(-t\right) \cdot y} \]
                  4. Applied rewrites60.1%

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

                  if -1.00000000000000004e-10 < y < 160

                  1. Initial program 95.5%

                    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                  2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                      \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                    10. fp-cancel-sign-sub-invN/A

                      \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                    11. exp-diffN/A

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

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

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

                    \[\leadsto \color{blue}{\frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                  5. Step-by-step derivation
                    1. lower-/.f64N/A

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

                      \[\leadsto \frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                    3. pow-expN/A

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

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

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

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

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

                      \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}} \]
                    9. associate-*r*N/A

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

                      \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                    11. mul-1-negN/A

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

                      \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                    13. mul-1-negN/A

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

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

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

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

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

                      \[\leadsto \frac{x}{e^{a \cdot b + a \cdot z}} \]
                    3. Step-by-step derivation
                      1. distribute-lft-outN/A

                        \[\leadsto \frac{x}{e^{a \cdot \left(b + z\right)}} \]
                      2. lower-*.f64N/A

                        \[\leadsto \frac{x}{e^{a \cdot \left(b + z\right)}} \]
                      3. lower-+.f6486.0

                        \[\leadsto \frac{x}{e^{a \cdot \left(b + z\right)}} \]
                    4. Applied rewrites86.0%

                      \[\leadsto \frac{x}{e^{a \cdot \left(b + z\right)}} \]

                    if 160 < y

                    1. Initial program 97.8%

                      \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                    2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                        \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                      10. fp-cancel-sign-sub-invN/A

                        \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                      11. exp-diffN/A

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

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

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

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

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

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

                          \[\leadsto x \cdot \frac{1}{\color{blue}{1}} \]
                        2. Taylor expanded in t around 0

                          \[\leadsto x \cdot \frac{\color{blue}{{z}^{y}}}{1} \]
                        3. Step-by-step derivation
                          1. lower-pow.f6467.3

                            \[\leadsto x \cdot \frac{{z}^{\color{blue}{y}}}{1} \]
                        4. Applied rewrites67.3%

                          \[\leadsto x \cdot \frac{\color{blue}{{z}^{y}}}{1} \]
                      4. Recombined 3 regimes into one program.
                      5. Add Preprocessing

                      Alternative 7: 71.7% accurate, 2.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{-10}:\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{elif}\;y \leq 160:\\ \;\;\;\;\frac{x}{e^{a \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{{z}^{y}}{1}\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b)
                       :precision binary64
                       (if (<= y -1e-10)
                         (* x (exp (* (- t) y)))
                         (if (<= y 160.0) (/ x (exp (* a b))) (* x (/ (pow z y) 1.0)))))
                      double code(double x, double y, double z, double t, double a, double b) {
                      	double tmp;
                      	if (y <= -1e-10) {
                      		tmp = x * exp((-t * y));
                      	} else if (y <= 160.0) {
                      		tmp = x / exp((a * b));
                      	} else {
                      		tmp = x * (pow(z, y) / 1.0);
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, 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 (y <= (-1d-10)) then
                              tmp = x * exp((-t * y))
                          else if (y <= 160.0d0) then
                              tmp = x / exp((a * b))
                          else
                              tmp = x * ((z ** y) / 1.0d0)
                          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 (y <= -1e-10) {
                      		tmp = x * Math.exp((-t * y));
                      	} else if (y <= 160.0) {
                      		tmp = x / Math.exp((a * b));
                      	} else {
                      		tmp = x * (Math.pow(z, y) / 1.0);
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a, b):
                      	tmp = 0
                      	if y <= -1e-10:
                      		tmp = x * math.exp((-t * y))
                      	elif y <= 160.0:
                      		tmp = x / math.exp((a * b))
                      	else:
                      		tmp = x * (math.pow(z, y) / 1.0)
                      	return tmp
                      
                      function code(x, y, z, t, a, b)
                      	tmp = 0.0
                      	if (y <= -1e-10)
                      		tmp = Float64(x * exp(Float64(Float64(-t) * y)));
                      	elseif (y <= 160.0)
                      		tmp = Float64(x / exp(Float64(a * b)));
                      	else
                      		tmp = Float64(x * Float64((z ^ y) / 1.0));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a, b)
                      	tmp = 0.0;
                      	if (y <= -1e-10)
                      		tmp = x * exp((-t * y));
                      	elseif (y <= 160.0)
                      		tmp = x / exp((a * b));
                      	else
                      		tmp = x * ((z ^ y) / 1.0);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1e-10], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 160.0], N[(x / N[Exp[N[(a * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Power[z, y], $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq -1 \cdot 10^{-10}:\\
                      \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
                      
                      \mathbf{elif}\;y \leq 160:\\
                      \;\;\;\;\frac{x}{e^{a \cdot b}}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x \cdot \frac{{z}^{y}}{1}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if y < -1.00000000000000004e-10

                        1. Initial program 97.2%

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

                          \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                        3. Step-by-step derivation
                          1. associate-*r*N/A

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

                            \[\leadsto x \cdot e^{\left(-1 \cdot t\right) \cdot \color{blue}{y}} \]
                          3. mul-1-negN/A

                            \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(t\right)\right) \cdot y} \]
                          4. lower-neg.f6460.1

                            \[\leadsto x \cdot e^{\left(-t\right) \cdot y} \]
                        4. Applied rewrites60.1%

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

                        if -1.00000000000000004e-10 < y < 160

                        1. Initial program 95.5%

                          \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                        2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                            \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                          10. fp-cancel-sign-sub-invN/A

                            \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                          11. exp-diffN/A

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

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

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

                          \[\leadsto \color{blue}{\frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                        5. Step-by-step derivation
                          1. lower-/.f64N/A

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

                            \[\leadsto \frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                          3. pow-expN/A

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

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

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

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

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

                            \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}} \]
                          9. associate-*r*N/A

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

                            \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                          11. mul-1-negN/A

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

                            \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                          13. mul-1-negN/A

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

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

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

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

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

                            \[\leadsto \frac{x}{e^{a \cdot b}} \]
                          3. Step-by-step derivation
                            1. lift-*.f6480.0

                              \[\leadsto \frac{x}{e^{a \cdot b}} \]
                          4. Applied rewrites80.0%

                            \[\leadsto \frac{x}{e^{a \cdot b}} \]

                          if 160 < y

                          1. Initial program 97.8%

                            \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                          2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                              \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                            10. fp-cancel-sign-sub-invN/A

                              \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                            11. exp-diffN/A

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

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

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

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

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

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

                                \[\leadsto x \cdot \frac{1}{\color{blue}{1}} \]
                              2. Taylor expanded in t around 0

                                \[\leadsto x \cdot \frac{\color{blue}{{z}^{y}}}{1} \]
                              3. Step-by-step derivation
                                1. lower-pow.f6467.3

                                  \[\leadsto x \cdot \frac{{z}^{\color{blue}{y}}}{1} \]
                              4. Applied rewrites67.3%

                                \[\leadsto x \cdot \frac{\color{blue}{{z}^{y}}}{1} \]
                            4. Recombined 3 regimes into one program.
                            5. Add Preprocessing

                            Alternative 8: 70.8% accurate, 2.5× speedup?

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

                              1. Initial program 98.3%

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

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

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

                                  \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot \color{blue}{b}} \]
                                3. mul-1-negN/A

                                  \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(a\right)\right) \cdot b} \]
                                4. lower-neg.f6475.9

                                  \[\leadsto x \cdot e^{\left(-a\right) \cdot b} \]
                              4. Applied rewrites75.9%

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

                              if -3.6e22 < b < 6.5000000000000001e90

                              1. Initial program 95.4%

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

                                \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                              3. Step-by-step derivation
                                1. associate-*r*N/A

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

                                  \[\leadsto x \cdot e^{\left(-1 \cdot t\right) \cdot \color{blue}{y}} \]
                                3. mul-1-negN/A

                                  \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(t\right)\right) \cdot y} \]
                                4. lower-neg.f6466.1

                                  \[\leadsto x \cdot e^{\left(-t\right) \cdot y} \]
                              4. Applied rewrites66.1%

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

                              if 6.5000000000000001e90 < b

                              1. Initial program 98.0%

                                \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                              2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                                  \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                                10. fp-cancel-sign-sub-invN/A

                                  \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                                11. exp-diffN/A

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

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

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

                                \[\leadsto \color{blue}{\frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                              5. Step-by-step derivation
                                1. lower-/.f64N/A

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

                                  \[\leadsto \frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                                3. pow-expN/A

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

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

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

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

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

                                  \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}} \]
                                9. associate-*r*N/A

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

                                  \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                                11. mul-1-negN/A

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

                                  \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                                13. mul-1-negN/A

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

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

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

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

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

                                  \[\leadsto \frac{x}{e^{a \cdot b}} \]
                                3. Step-by-step derivation
                                  1. lift-*.f6480.6

                                    \[\leadsto \frac{x}{e^{a \cdot b}} \]
                                4. Applied rewrites80.6%

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

                              Alternative 9: 70.8% accurate, 2.6× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot e^{\left(-a\right) \cdot b}\\ \mathbf{if}\;b \leq -3.6 \cdot 10^{+22}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{+90}:\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                              (FPCore (x y z t a b)
                               :precision binary64
                               (let* ((t_1 (* x (exp (* (- a) b)))))
                                 (if (<= b -3.6e+22) t_1 (if (<= b 6.5e+90) (* x (exp (* (- t) y))) t_1))))
                              double code(double x, double y, double z, double t, double a, double b) {
                              	double t_1 = x * exp((-a * b));
                              	double tmp;
                              	if (b <= -3.6e+22) {
                              		tmp = t_1;
                              	} else if (b <= 6.5e+90) {
                              		tmp = x * exp((-t * y));
                              	} else {
                              		tmp = t_1;
                              	}
                              	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 = x * exp((-a * b))
                                  if (b <= (-3.6d+22)) then
                                      tmp = t_1
                                  else if (b <= 6.5d+90) then
                                      tmp = x * exp((-t * y))
                                  else
                                      tmp = t_1
                                  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 = x * Math.exp((-a * b));
                              	double tmp;
                              	if (b <= -3.6e+22) {
                              		tmp = t_1;
                              	} else if (b <= 6.5e+90) {
                              		tmp = x * Math.exp((-t * y));
                              	} else {
                              		tmp = t_1;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z, t, a, b):
                              	t_1 = x * math.exp((-a * b))
                              	tmp = 0
                              	if b <= -3.6e+22:
                              		tmp = t_1
                              	elif b <= 6.5e+90:
                              		tmp = x * math.exp((-t * y))
                              	else:
                              		tmp = t_1
                              	return tmp
                              
                              function code(x, y, z, t, a, b)
                              	t_1 = Float64(x * exp(Float64(Float64(-a) * b)))
                              	tmp = 0.0
                              	if (b <= -3.6e+22)
                              		tmp = t_1;
                              	elseif (b <= 6.5e+90)
                              		tmp = Float64(x * exp(Float64(Float64(-t) * y)));
                              	else
                              		tmp = t_1;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z, t, a, b)
                              	t_1 = x * exp((-a * b));
                              	tmp = 0.0;
                              	if (b <= -3.6e+22)
                              		tmp = t_1;
                              	elseif (b <= 6.5e+90)
                              		tmp = x * exp((-t * y));
                              	else
                              		tmp = t_1;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[((-a) * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.6e+22], t$95$1, If[LessEqual[b, 6.5e+90], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_1 := x \cdot e^{\left(-a\right) \cdot b}\\
                              \mathbf{if}\;b \leq -3.6 \cdot 10^{+22}:\\
                              \;\;\;\;t\_1\\
                              
                              \mathbf{elif}\;b \leq 6.5 \cdot 10^{+90}:\\
                              \;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_1\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if b < -3.6e22 or 6.5000000000000001e90 < b

                                1. Initial program 98.2%

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

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

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

                                    \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot \color{blue}{b}} \]
                                  3. mul-1-negN/A

                                    \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(a\right)\right) \cdot b} \]
                                  4. lower-neg.f6477.9

                                    \[\leadsto x \cdot e^{\left(-a\right) \cdot b} \]
                                4. Applied rewrites77.9%

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

                                if -3.6e22 < b < 6.5000000000000001e90

                                1. Initial program 95.4%

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

                                  \[\leadsto x \cdot e^{\color{blue}{-1 \cdot \left(t \cdot y\right)}} \]
                                3. Step-by-step derivation
                                  1. associate-*r*N/A

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

                                    \[\leadsto x \cdot e^{\left(-1 \cdot t\right) \cdot \color{blue}{y}} \]
                                  3. mul-1-negN/A

                                    \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(t\right)\right) \cdot y} \]
                                  4. lower-neg.f6466.1

                                    \[\leadsto x \cdot e^{\left(-t\right) \cdot y} \]
                                4. Applied rewrites66.1%

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

                              Alternative 10: 87.8% accurate, 2.6× speedup?

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

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

                                \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{-1 \cdot z} - b\right)} \]
                              3. Step-by-step derivation
                                1. mul-1-negN/A

                                  \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\mathsf{neg}\left(z\right)\right) - b\right)} \]
                                2. lower-neg.f6499.2

                                  \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(-z\right) - b\right)} \]
                              4. Applied rewrites99.2%

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

                                \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(-1 \cdot t\right)} + a \cdot \left(\left(-z\right) - b\right)} \]
                              6. Step-by-step derivation
                                1. mul-1-negN/A

                                  \[\leadsto x \cdot e^{y \cdot \left(\mathsf{neg}\left(t\right)\right) + a \cdot \left(\left(-z\right) - b\right)} \]
                                2. lift-neg.f6487.5

                                  \[\leadsto x \cdot e^{y \cdot \left(-t\right) + a \cdot \left(\left(-z\right) - b\right)} \]
                              7. Applied rewrites87.5%

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

                                  \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right) + a \cdot \left(\left(-z\right) - b\right)}} \]
                                2. lift-*.f64N/A

                                  \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(-t\right)} + a \cdot \left(\left(-z\right) - b\right)} \]
                                3. lower-fma.f6487.8

                                  \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, -t, a \cdot \left(\left(-z\right) - b\right)\right)}} \]
                              9. Applied rewrites87.8%

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

                              Alternative 11: 58.6% accurate, 2.9× speedup?

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

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

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

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

                                  \[\leadsto x \cdot e^{\left(-1 \cdot a\right) \cdot \color{blue}{b}} \]
                                3. mul-1-negN/A

                                  \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(a\right)\right) \cdot b} \]
                                4. lower-neg.f6458.6

                                  \[\leadsto x \cdot e^{\left(-a\right) \cdot b} \]
                              4. Applied rewrites58.6%

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

                              Alternative 12: 19.7% accurate, 27.3× speedup?

                              \[\begin{array}{l} \\ \frac{x}{1} \end{array} \]
                              (FPCore (x y z t a b) :precision binary64 (/ x 1.0))
                              double code(double x, double y, double z, double t, double a, double b) {
                              	return x / 1.0;
                              }
                              
                              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 / 1.0d0
                              end function
                              
                              public static double code(double x, double y, double z, double t, double a, double b) {
                              	return x / 1.0;
                              }
                              
                              def code(x, y, z, t, a, b):
                              	return x / 1.0
                              
                              function code(x, y, z, t, a, b)
                              	return Float64(x / 1.0)
                              end
                              
                              function tmp = code(x, y, z, t, a, b)
                              	tmp = x / 1.0;
                              end
                              
                              code[x_, y_, z_, t_, a_, b_] := N[(x / 1.0), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              \frac{x}{1}
                              \end{array}
                              
                              Derivation
                              1. Initial program 96.5%

                                \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \]
                              2. 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. lift-+.f64N/A

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

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

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

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

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

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

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

                                  \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\log \left(1 - z\right)} - b\right)} \]
                                10. fp-cancel-sign-sub-invN/A

                                  \[\leadsto x \cdot e^{\color{blue}{y \cdot \left(\log z - t\right) - \left(\mathsf{neg}\left(a\right)\right) \cdot \left(\log \left(1 - z\right) - b\right)}} \]
                                11. exp-diffN/A

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

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

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

                                \[\leadsto \color{blue}{\frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                              5. Step-by-step derivation
                                1. lower-/.f64N/A

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

                                  \[\leadsto \frac{x \cdot e^{y \cdot \left(\log z - t\right)}}{e^{\color{blue}{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}}} \]
                                3. pow-expN/A

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

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

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

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

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

                                  \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{-1 \cdot \left(a \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)\right)}} \]
                                9. associate-*r*N/A

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

                                  \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-1 \cdot a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                                11. mul-1-negN/A

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

                                  \[\leadsto \frac{x \cdot {\left(e^{y}\right)}^{\left(\log z - t\right)}}{e^{\left(-a\right) \cdot \left(\log \left(1 - z\right) + -1 \cdot b\right)}} \]
                                13. mul-1-negN/A

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

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

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

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

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

                                  \[\leadsto \frac{x}{1} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites19.7%

                                    \[\leadsto \frac{x}{1} \]
                                  2. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2025093 
                                  (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))))))