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

Percentage Accurate: 96.4% → 99.6%
Time: 17.8s
Alternatives: 11
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 96.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
	return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = x * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b):
	return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b)
	return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))))
end
function tmp = code(x, y, z, t, a, b)
	tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.6% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, \color{blue}{z + b}, y \cdot \left(\log z - t\right)\right)} \]
    10. *-commutativeN/A

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

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

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

      \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, z + b, \left(\color{blue}{\log z} - t\right) \cdot y\right)} \]
  5. Applied rewrites100.0%

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

Alternative 2: 89.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{+166} \lor \neg \left(y \leq 2.8 \cdot 10^{+78}\right):\\ \;\;\;\;x \cdot e^{\left(\log z - t\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= y -5e+166) (not (<= y 2.8e+78)))
   (* x (exp (* (- (log z) t) y)))
   (* (exp (* (+ (- y) (/ (* (- b) a) t)) t)) x)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((y <= -5e+166) || !(y <= 2.8e+78)) {
		tmp = x * exp(((log(z) - t) * y));
	} else {
		tmp = exp(((-y + ((-b * a) / t)) * t)) * x;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((y <= (-5d+166)) .or. (.not. (y <= 2.8d+78))) then
        tmp = x * exp(((log(z) - t) * y))
    else
        tmp = exp(((-y + ((-b * a) / t)) * t)) * x
    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 <= -5e+166) || !(y <= 2.8e+78)) {
		tmp = x * Math.exp(((Math.log(z) - t) * y));
	} else {
		tmp = Math.exp(((-y + ((-b * a) / t)) * t)) * x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (y <= -5e+166) or not (y <= 2.8e+78):
		tmp = x * math.exp(((math.log(z) - t) * y))
	else:
		tmp = math.exp(((-y + ((-b * a) / t)) * t)) * x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((y <= -5e+166) || !(y <= 2.8e+78))
		tmp = Float64(x * exp(Float64(Float64(log(z) - t) * y)));
	else
		tmp = Float64(exp(Float64(Float64(Float64(-y) + Float64(Float64(Float64(-b) * a) / t)) * t)) * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((y <= -5e+166) || ~((y <= 2.8e+78)))
		tmp = x * exp(((log(z) - t) * y));
	else
		tmp = exp(((-y + ((-b * a) / t)) * t)) * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -5e+166], N[Not[LessEqual[y, 2.8e+78]], $MachinePrecision]], N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[((-y) + N[(N[((-b) * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+166} \lor \neg \left(y \leq 2.8 \cdot 10^{+78}\right):\\
\;\;\;\;x \cdot e^{\left(\log z - t\right) \cdot y}\\

\mathbf{else}:\\
\;\;\;\;e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.0000000000000002e166 or 2.8000000000000001e78 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.0000000000000002e166 < y < 2.8000000000000001e78

      1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)} \cdot x} \]
        3. Applied rewrites94.0%

          \[\leadsto \color{blue}{e^{\left(y - \frac{\left(-b\right) \cdot a}{t}\right) \cdot \left(-t\right)} \cdot x} \]
      8. Recombined 2 regimes into one program.
      9. Final simplification94.6%

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

      Alternative 3: 92.0% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -105000000:\\ \;\;\;\;e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\ \end{array} \end{array} \]
      (FPCore (x y z t a b)
       :precision binary64
       (if (<= t -105000000.0)
         (* (exp (* (+ (- y) (/ (* (- b) a) t)) t)) x)
         (* x (exp (fma (- b) a (* (log z) y))))))
      double code(double x, double y, double z, double t, double a, double b) {
      	double tmp;
      	if (t <= -105000000.0) {
      		tmp = exp(((-y + ((-b * a) / t)) * t)) * x;
      	} else {
      		tmp = x * exp(fma(-b, a, (log(z) * y)));
      	}
      	return tmp;
      }
      
      function code(x, y, z, t, a, b)
      	tmp = 0.0
      	if (t <= -105000000.0)
      		tmp = Float64(exp(Float64(Float64(Float64(-y) + Float64(Float64(Float64(-b) * a) / t)) * t)) * x);
      	else
      		tmp = Float64(x * exp(fma(Float64(-b), a, Float64(log(z) * y))));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -105000000.0], N[(N[Exp[N[(N[((-y) + N[(N[((-b) * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(x * N[Exp[N[((-b) * a + N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -105000000:\\
      \;\;\;\;e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x\\
      
      \mathbf{else}:\\
      \;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -1.05e8

        1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)} \cdot x} \]
            3. lower-*.f6493.9

              \[\leadsto \color{blue}{e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)} \cdot x} \]
          3. Applied rewrites96.4%

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

          if -1.05e8 < t

          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. Add Preprocessing
          3. Taylor expanded in z around 0

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

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

              \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(\color{blue}{b \cdot a}\right)\right) + y \cdot \left(\log z - t\right)} \]
            3. distribute-lft-neg-inN/A

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

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

              \[\leadsto x \cdot e^{\mathsf{fma}\left(\color{blue}{-b}, a, y \cdot \left(\log z - t\right)\right)} \]
            6. *-commutativeN/A

              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right) \cdot y}\right)} \]
            7. lower-*.f64N/A

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

              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
            9. lower-log.f6497.4

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

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

            \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)} \]
          7. Step-by-step derivation
            1. Applied rewrites95.2%

              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification95.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -105000000:\\ \;\;\;\;e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\mathsf{fma}\left(-b, a, \log z \cdot y\right)}\\ \end{array} \]
          10. Add Preprocessing

          Alternative 4: 96.3% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ x \cdot e^{\mathsf{fma}\left(-b, a, \left(\log z - t\right) \cdot y\right)} \end{array} \]
          (FPCore (x y z t a b)
           :precision binary64
           (* x (exp (fma (- b) a (* (- (log z) t) y)))))
          double code(double x, double y, double z, double t, double a, double b) {
          	return x * exp(fma(-b, a, ((log(z) - t) * y)));
          }
          
          function code(x, y, z, t, a, b)
          	return Float64(x * exp(fma(Float64(-b), a, Float64(Float64(log(z) - t) * y))))
          end
          
          code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[((-b) * a + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          x \cdot e^{\mathsf{fma}\left(-b, a, \left(\log z - t\right) \cdot y\right)}
          \end{array}
          
          Derivation
          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. Add Preprocessing
          3. Taylor expanded in z around 0

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

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

              \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(\color{blue}{b \cdot a}\right)\right) + y \cdot \left(\log z - t\right)} \]
            3. distribute-lft-neg-inN/A

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

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

              \[\leadsto x \cdot e^{\mathsf{fma}\left(\color{blue}{-b}, a, y \cdot \left(\log z - t\right)\right)} \]
            6. *-commutativeN/A

              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right) \cdot y}\right)} \]
            7. lower-*.f64N/A

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

              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
            9. lower-log.f6497.1

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

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

          Alternative 5: 84.2% accurate, 1.5× speedup?

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

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x \cdot e^{\left(\color{blue}{\log z} - t\right) \cdot y} \]
              4. Applied rewrites93.0%

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

                \[\leadsto x \cdot e^{y \cdot \color{blue}{\log z}} \]
              6. Step-by-step derivation
                1. Applied rewrites93.0%

                  \[\leadsto x \cdot e^{y \cdot \color{blue}{\log z}} \]

                if -2.12000000000000003e228 < y

                1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)} \cdot x} \]
                    3. lower-*.f6484.7

                      \[\leadsto \color{blue}{e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)} \cdot x} \]
                  3. Applied rewrites87.0%

                    \[\leadsto \color{blue}{e^{\left(y - \frac{\left(-b\right) \cdot a}{t}\right) \cdot \left(-t\right)} \cdot x} \]
                8. Recombined 2 regimes into one program.
                9. Final simplification87.4%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.12 \cdot 10^{+228}:\\ \;\;\;\;x \cdot e^{y \cdot \log z}\\ \mathbf{else}:\\ \;\;\;\;e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x\\ \end{array} \]
                10. Add Preprocessing

                Alternative 6: 84.9% accurate, 2.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-183} \lor \neg \left(y \leq 3.9 \cdot 10^{-200}\right):\\ \;\;\;\;x \cdot e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\ \end{array} \end{array} \]
                (FPCore (x y z t a b)
                 :precision binary64
                 (if (or (<= y -4e-183) (not (<= y 3.9e-200)))
                   (* x (exp (* (- t) (- y (* (- a) (/ b t))))))
                   (* x (exp (* (- (- z) b) a)))))
                double code(double x, double y, double z, double t, double a, double b) {
                	double tmp;
                	if ((y <= -4e-183) || !(y <= 3.9e-200)) {
                		tmp = x * exp((-t * (y - (-a * (b / t)))));
                	} else {
                		tmp = x * exp(((-z - b) * a));
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(x, y, z, t, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    real(8) :: tmp
                    if ((y <= (-4d-183)) .or. (.not. (y <= 3.9d-200))) then
                        tmp = x * exp((-t * (y - (-a * (b / t)))))
                    else
                        tmp = x * exp(((-z - b) * a))
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double t, double a, double b) {
                	double tmp;
                	if ((y <= -4e-183) || !(y <= 3.9e-200)) {
                		tmp = x * Math.exp((-t * (y - (-a * (b / t)))));
                	} else {
                		tmp = x * Math.exp(((-z - b) * a));
                	}
                	return tmp;
                }
                
                def code(x, y, z, t, a, b):
                	tmp = 0
                	if (y <= -4e-183) or not (y <= 3.9e-200):
                		tmp = x * math.exp((-t * (y - (-a * (b / t)))))
                	else:
                		tmp = x * math.exp(((-z - b) * a))
                	return tmp
                
                function code(x, y, z, t, a, b)
                	tmp = 0.0
                	if ((y <= -4e-183) || !(y <= 3.9e-200))
                		tmp = Float64(x * exp(Float64(Float64(-t) * Float64(y - Float64(Float64(-a) * Float64(b / t))))));
                	else
                		tmp = Float64(x * exp(Float64(Float64(Float64(-z) - b) * a)));
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, t, a, b)
                	tmp = 0.0;
                	if ((y <= -4e-183) || ~((y <= 3.9e-200)))
                		tmp = x * exp((-t * (y - (-a * (b / t)))));
                	else
                		tmp = x * exp(((-z - b) * a));
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4e-183], N[Not[LessEqual[y, 3.9e-200]], $MachinePrecision]], N[(x * N[Exp[N[((-t) * N[(y - N[((-a) * N[(b / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -4 \cdot 10^{-183} \lor \neg \left(y \leq 3.9 \cdot 10^{-200}\right):\\
                \;\;\;\;x \cdot e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -4.00000000000000002e-183 or 3.89999999999999999e-200 < y

                  1. Initial program 99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -4.00000000000000002e-183 < y < 3.89999999999999999e-200

                    1. Initial program 93.6%

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

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

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

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

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

                        \[\leadsto x \cdot e^{\left(\color{blue}{\log \left(1 - z\right)} - b\right) \cdot a} \]
                      5. lower--.f6491.9

                        \[\leadsto x \cdot e^{\left(\log \color{blue}{\left(1 - z\right)} - b\right) \cdot a} \]
                    5. Applied rewrites91.9%

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

                      \[\leadsto x \cdot e^{\left(-1 \cdot z - b\right) \cdot a} \]
                    7. Step-by-step derivation
                      1. Applied rewrites98.2%

                        \[\leadsto x \cdot e^{\left(\left(-z\right) - b\right) \cdot a} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification87.3%

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

                    Alternative 7: 84.4% accurate, 2.4× speedup?

                    \[\begin{array}{l} \\ e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x \end{array} \]
                    (FPCore (x y z t a b)
                     :precision binary64
                     (* (exp (* (+ (- y) (/ (* (- b) a) t)) t)) x))
                    double code(double x, double y, double z, double t, double a, double b) {
                    	return exp(((-y + ((-b * a) / t)) * t)) * x;
                    }
                    
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y, z, t, a, b)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        real(8), intent (in) :: a
                        real(8), intent (in) :: b
                        code = exp(((-y + ((-b * a) / t)) * t)) * x
                    end function
                    
                    public static double code(double x, double y, double z, double t, double a, double b) {
                    	return Math.exp(((-y + ((-b * a) / t)) * t)) * x;
                    }
                    
                    def code(x, y, z, t, a, b):
                    	return math.exp(((-y + ((-b * a) / t)) * t)) * x
                    
                    function code(x, y, z, t, a, b)
                    	return Float64(exp(Float64(Float64(Float64(-y) + Float64(Float64(Float64(-b) * a) / t)) * t)) * x)
                    end
                    
                    function tmp = code(x, y, z, t, a, b)
                    	tmp = exp(((-y + ((-b * a) / t)) * t)) * x;
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[N[(N[((-y) + N[(N[((-b) * a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    e^{\left(\left(-y\right) + \frac{\left(-b\right) \cdot a}{t}\right) \cdot t} \cdot x
                    \end{array}
                    
                    Derivation
                    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. Add Preprocessing
                    3. Taylor expanded in t around -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{e^{\left(-t\right) \cdot \left(y - \left(-a\right) \cdot \frac{b}{t}\right)} \cdot x} \]
                        3. lower-*.f6483.6

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

                        \[\leadsto \color{blue}{e^{\left(y - \frac{\left(-b\right) \cdot a}{t}\right) \cdot \left(-t\right)} \cdot x} \]
                      4. Final simplification85.1%

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

                      Alternative 8: 74.7% accurate, 2.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{+38} \lor \neg \left(t \leq 1.9 \cdot 10^{+63}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\ \end{array} \end{array} \]
                      (FPCore (x y z t a b)
                       :precision binary64
                       (if (or (<= t -5.8e+38) (not (<= t 1.9e+63)))
                         (* x (exp (* (- y) t)))
                         (* x (exp (* (- (- z) b) a)))))
                      double code(double x, double y, double z, double t, double a, double b) {
                      	double tmp;
                      	if ((t <= -5.8e+38) || !(t <= 1.9e+63)) {
                      		tmp = x * exp((-y * t));
                      	} else {
                      		tmp = x * exp(((-z - b) * a));
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y, z, t, a, b)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: t
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8) :: tmp
                          if ((t <= (-5.8d+38)) .or. (.not. (t <= 1.9d+63))) then
                              tmp = x * exp((-y * t))
                          else
                              tmp = x * exp(((-z - b) * a))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t, double a, double b) {
                      	double tmp;
                      	if ((t <= -5.8e+38) || !(t <= 1.9e+63)) {
                      		tmp = x * Math.exp((-y * t));
                      	} else {
                      		tmp = x * Math.exp(((-z - b) * a));
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t, a, b):
                      	tmp = 0
                      	if (t <= -5.8e+38) or not (t <= 1.9e+63):
                      		tmp = x * math.exp((-y * t))
                      	else:
                      		tmp = x * math.exp(((-z - b) * a))
                      	return tmp
                      
                      function code(x, y, z, t, a, b)
                      	tmp = 0.0
                      	if ((t <= -5.8e+38) || !(t <= 1.9e+63))
                      		tmp = Float64(x * exp(Float64(Float64(-y) * t)));
                      	else
                      		tmp = Float64(x * exp(Float64(Float64(Float64(-z) - b) * a)));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t, a, b)
                      	tmp = 0.0;
                      	if ((t <= -5.8e+38) || ~((t <= 1.9e+63)))
                      		tmp = x * exp((-y * t));
                      	else
                      		tmp = x * exp(((-z - b) * a));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -5.8e+38], N[Not[LessEqual[t, 1.9e+63]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;t \leq -5.8 \cdot 10^{+38} \lor \neg \left(t \leq 1.9 \cdot 10^{+63}\right):\\
                      \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if t < -5.80000000000000013e38 or 1.9000000000000001e63 < t

                        1. Initial program 98.1%

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

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

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

                            \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
                          3. distribute-lft-neg-inN/A

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

                            \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot t}} \]
                          5. lower-neg.f6484.8

                            \[\leadsto x \cdot e^{\color{blue}{\left(-y\right)} \cdot t} \]
                        5. Applied rewrites84.8%

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

                        if -5.80000000000000013e38 < t < 1.9000000000000001e63

                        1. Initial program 97.7%

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

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

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

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

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

                            \[\leadsto x \cdot e^{\left(\color{blue}{\log \left(1 - z\right)} - b\right) \cdot a} \]
                          5. lower--.f6472.2

                            \[\leadsto x \cdot e^{\left(\log \color{blue}{\left(1 - z\right)} - b\right) \cdot a} \]
                        5. Applied rewrites72.2%

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

                          \[\leadsto x \cdot e^{\left(-1 \cdot z - b\right) \cdot a} \]
                        7. Step-by-step derivation
                          1. Applied rewrites74.5%

                            \[\leadsto x \cdot e^{\left(\left(-z\right) - b\right) \cdot a} \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification78.6%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{+38} \lor \neg \left(t \leq 1.9 \cdot 10^{+63}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 9: 71.9% accurate, 2.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{+38} \lor \neg \left(t \leq 2.05 \cdot 10^{+29}\right):\\ \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\ \end{array} \end{array} \]
                        (FPCore (x y z t a b)
                         :precision binary64
                         (if (or (<= t -4.2e+38) (not (<= t 2.05e+29)))
                           (* x (exp (* (- y) t)))
                           (* x (exp (* (- b) a)))))
                        double code(double x, double y, double z, double t, double a, double b) {
                        	double tmp;
                        	if ((t <= -4.2e+38) || !(t <= 2.05e+29)) {
                        		tmp = x * exp((-y * t));
                        	} else {
                        		tmp = x * exp((-b * a));
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y, z, t, a, b)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: t
                            real(8), intent (in) :: a
                            real(8), intent (in) :: b
                            real(8) :: tmp
                            if ((t <= (-4.2d+38)) .or. (.not. (t <= 2.05d+29))) then
                                tmp = x * exp((-y * t))
                            else
                                tmp = x * exp((-b * a))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double t, double a, double b) {
                        	double tmp;
                        	if ((t <= -4.2e+38) || !(t <= 2.05e+29)) {
                        		tmp = x * Math.exp((-y * t));
                        	} else {
                        		tmp = x * Math.exp((-b * a));
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, t, a, b):
                        	tmp = 0
                        	if (t <= -4.2e+38) or not (t <= 2.05e+29):
                        		tmp = x * math.exp((-y * t))
                        	else:
                        		tmp = x * math.exp((-b * a))
                        	return tmp
                        
                        function code(x, y, z, t, a, b)
                        	tmp = 0.0
                        	if ((t <= -4.2e+38) || !(t <= 2.05e+29))
                        		tmp = Float64(x * exp(Float64(Float64(-y) * t)));
                        	else
                        		tmp = Float64(x * exp(Float64(Float64(-b) * a)));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, t, a, b)
                        	tmp = 0.0;
                        	if ((t <= -4.2e+38) || ~((t <= 2.05e+29)))
                        		tmp = x * exp((-y * t));
                        	else
                        		tmp = x * exp((-b * a));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.2e+38], N[Not[LessEqual[t, 2.05e+29]], $MachinePrecision]], N[(x * N[Exp[N[((-y) * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;t \leq -4.2 \cdot 10^{+38} \lor \neg \left(t \leq 2.05 \cdot 10^{+29}\right):\\
                        \;\;\;\;x \cdot e^{\left(-y\right) \cdot t}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if t < -4.2e38 or 2.0500000000000002e29 < t

                          1. Initial program 97.3%

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

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

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

                              \[\leadsto x \cdot e^{\mathsf{neg}\left(\color{blue}{y \cdot t}\right)} \]
                            3. distribute-lft-neg-inN/A

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

                              \[\leadsto x \cdot e^{\color{blue}{\left(\mathsf{neg}\left(y\right)\right) \cdot t}} \]
                            5. lower-neg.f6482.3

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

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

                          if -4.2e38 < t < 2.0500000000000002e29

                          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. Add Preprocessing
                          3. Taylor expanded in z around 0

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

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

                              \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(\color{blue}{b \cdot a}\right)\right) + y \cdot \left(\log z - t\right)} \]
                            3. distribute-lft-neg-inN/A

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

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

                              \[\leadsto x \cdot e^{\mathsf{fma}\left(\color{blue}{-b}, a, y \cdot \left(\log z - t\right)\right)} \]
                            6. *-commutativeN/A

                              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right) \cdot y}\right)} \]
                            7. lower-*.f64N/A

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

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

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

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

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

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

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

                          Alternative 10: 59.1% accurate, 2.9× speedup?

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

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

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

                              \[\leadsto x \cdot e^{\left(\mathsf{neg}\left(\color{blue}{b \cdot a}\right)\right) + y \cdot \left(\log z - t\right)} \]
                            3. distribute-lft-neg-inN/A

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

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

                              \[\leadsto x \cdot e^{\mathsf{fma}\left(\color{blue}{-b}, a, y \cdot \left(\log z - t\right)\right)} \]
                            6. *-commutativeN/A

                              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right) \cdot y}\right)} \]
                            7. lower-*.f64N/A

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

                              \[\leadsto x \cdot e^{\mathsf{fma}\left(-b, a, \color{blue}{\left(\log z - t\right)} \cdot y\right)} \]
                            9. lower-log.f6497.1

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

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

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

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

                            Alternative 11: 33.9% accurate, 2.9× speedup?

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, \color{blue}{z + b}, y \cdot \left(\log z - t\right)\right)} \]
                              10. *-commutativeN/A

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

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

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

                                \[\leadsto x \cdot e^{\mathsf{fma}\left(-a, z + b, \left(\color{blue}{\log z} - t\right) \cdot y\right)} \]
                            5. Applied rewrites100.0%

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

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

                                \[\leadsto x \cdot e^{\left(-z\right) \cdot \color{blue}{a}} \]
                              2. Final simplification33.6%

                                \[\leadsto x \cdot e^{z \cdot \left(-a\right)} \]
                              3. Add Preprocessing

                              Reproduce

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