Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2

Percentage Accurate: 95.1% → 97.7%
Time: 7.1s
Alternatives: 22
Speedup: 1.1×

Specification

?
\[\begin{array}{l} \\ \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * 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 - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b):
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\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 22 alternatives:

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

Initial Program: 95.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * 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 - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b):
	return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b))
end
function tmp = code(x, y, z, t, a, b)
	tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 97.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1
         (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
   (if (<= t_1 INFINITY) t_1 (* (- b a) t))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (b - a) * t;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (b - a) * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (b - a) * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(b - a) * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (b - a) * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(b - a\right) \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b))

    1. Initial program 0.0%

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

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

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

        \[\leadsto \color{blue}{\left(b - a\right) \cdot t} \]
      3. lower--.f6470.0

        \[\leadsto \color{blue}{\left(b - a\right)} \cdot t \]
    5. Applied rewrites70.0%

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

Alternative 2: 88.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{+36} \lor \neg \left(t \leq 5.6 \cdot 10^{+47}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - \mathsf{fma}\left(z, y - 1, -a\right)\right) + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= t -3.6e+36) (not (<= t 5.6e+47)))
   (fma (- 1.0 t) a (fma (- (+ t y) 2.0) b x))
   (+ (- x (fma z (- y 1.0) (- a))) (fma y b (* (- t 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -3.6e+36) || !(t <= 5.6e+47)) {
		tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, x));
	} else {
		tmp = (x - fma(z, (y - 1.0), -a)) + fma(y, b, ((t - 2.0) * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -3.6e+36) || !(t <= 5.6e+47))
		tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, x));
	else
		tmp = Float64(Float64(x - fma(z, Float64(y - 1.0), Float64(-a))) + fma(y, b, Float64(Float64(t - 2.0) * b)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -3.6e+36], N[Not[LessEqual[t, 5.6e+47]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(z * N[(y - 1.0), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision] + N[(y * b + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+36} \lor \neg \left(t \leq 5.6 \cdot 10^{+47}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(x - \mathsf{fma}\left(z, y - 1, -a\right)\right) + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.5999999999999997e36 or 5.59999999999999976e47 < t

    1. Initial program 90.4%

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

      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
    5. Applied rewrites88.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]

    if -3.5999999999999997e36 < t < 5.59999999999999976e47

    1. Initial program 98.5%

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

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

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

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

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + b \cdot \left(\color{blue}{\left(y + t\right)} - 2\right) \]
      5. associate--l+N/A

        \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
      6. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x - \mathsf{fma}\left(z, y - 1, \color{blue}{\mathsf{neg}\left(a\right)}\right)\right) + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right) \]
      6. lower-neg.f6499.2

        \[\leadsto \left(x - \mathsf{fma}\left(z, y - 1, \color{blue}{-a}\right)\right) + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right) \]
    7. Applied rewrites99.2%

      \[\leadsto \color{blue}{\left(x - \mathsf{fma}\left(z, y - 1, -a\right)\right)} + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.6 \cdot 10^{+36} \lor \neg \left(t \leq 5.6 \cdot 10^{+47}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x - \mathsf{fma}\left(z, y - 1, -a\right)\right) + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.6% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+31} \lor \neg \left(t \leq 4.4 \cdot 10^{+47}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, \mathsf{fma}\left(1 - y, z, x\right) + a\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= t -8.5e+31) (not (<= t 4.4e+47)))
   (fma (- 1.0 t) a (fma (- (+ t y) 2.0) b x))
   (fma (- y 2.0) b (+ (fma (- 1.0 y) z x) a))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((t <= -8.5e+31) || !(t <= 4.4e+47)) {
		tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, x));
	} else {
		tmp = fma((y - 2.0), b, (fma((1.0 - y), z, x) + a));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((t <= -8.5e+31) || !(t <= 4.4e+47))
		tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, x));
	else
		tmp = fma(Float64(y - 2.0), b, Float64(fma(Float64(1.0 - y), z, x) + a));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.5e+31], N[Not[LessEqual[t, 4.4e+47]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(y - 2.0), $MachinePrecision] * b + N[(N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{+31} \lor \neg \left(t \leq 4.4 \cdot 10^{+47}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, \mathsf{fma}\left(1 - y, z, x\right) + a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.49999999999999947e31 or 4.3999999999999999e47 < t

    1. Initial program 90.4%

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

      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
    5. Applied rewrites88.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]

    if -8.49999999999999947e31 < t < 4.3999999999999999e47

    1. Initial program 98.5%

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

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

        \[\leadsto \color{blue}{\left(b \cdot \left(y - 2\right) + x\right)} - \left(-1 \cdot a + z \cdot \left(y - 1\right)\right) \]
      2. associate--l+N/A

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - 2, b, x - \left(-1 \cdot a + z \cdot \left(y - 1\right)\right)\right)} \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{y - 2}, b, x - \left(-1 \cdot a + z \cdot \left(y - 1\right)\right)\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x - \color{blue}{\left(z \cdot \left(y - 1\right) + -1 \cdot a\right)}\right) \]
      7. associate--r+N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, \color{blue}{\left(x - z \cdot \left(y - 1\right)\right) - -1 \cdot a}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, \left(x - z \cdot \left(y - 1\right)\right) - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)} \cdot a\right) \]
      9. fp-cancel-sign-subN/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, \color{blue}{\left(x - z \cdot \left(y - 1\right)\right) + 1 \cdot a}\right) \]
      10. *-lft-identityN/A

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - 2, b, \mathsf{fma}\left(1 - y, z, x\right) + a\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.5 \cdot 10^{+31} \lor \neg \left(t \leq 4.4 \cdot 10^{+47}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, \mathsf{fma}\left(1 - y, z, x\right) + a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 86.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{-63} \lor \neg \left(b \leq 8.5 \cdot 10^{-74}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - \left(y - 1\right) \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= b -1.7e-63) (not (<= b 8.5e-74)))
   (fma (- 1.0 t) a (fma (- (+ t y) 2.0) b x))
   (- (fma (- 1.0 t) a x) (* (- y 1.0) z))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.7e-63) || !(b <= 8.5e-74)) {
		tmp = fma((1.0 - t), a, fma(((t + y) - 2.0), b, x));
	} else {
		tmp = fma((1.0 - t), a, x) - ((y - 1.0) * z);
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((b <= -1.7e-63) || !(b <= 8.5e-74))
		tmp = fma(Float64(1.0 - t), a, fma(Float64(Float64(t + y) - 2.0), b, x));
	else
		tmp = Float64(fma(Float64(1.0 - t), a, x) - Float64(Float64(y - 1.0) * z));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.7e-63], N[Not[LessEqual[b, 8.5e-74]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{-63} \lor \neg \left(b \leq 8.5 \cdot 10^{-74}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - \left(y - 1\right) \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.69999999999999999e-63 or 8.50000000000000052e-74 < b

    1. Initial program 93.3%

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

      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
    4. Step-by-step derivation
      1. fp-cancel-sub-sign-invN/A

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

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
      3. mul-1-negN/A

        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
    5. Applied rewrites88.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]

    if -1.69999999999999999e-63 < b < 8.50000000000000052e-74

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\color{blue}{b - a}, t, x + b \cdot \left(y - 2\right)\right) + a\right) - z \cdot \left(y - 1\right) \]
      12. +-commutativeN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(1 - t, a, x\right) - \color{blue}{\left(y - 1\right)} \cdot z \]
    8. Recombined 2 regimes into one program.
    9. Final simplification90.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{-63} \lor \neg \left(b \leq 8.5 \cdot 10^{-74}\right):\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - \left(y - 1\right) \cdot z\\ \end{array} \]
    10. Add Preprocessing

    Alternative 5: 39.2% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - t\right) \cdot a\\ \mathbf{if}\;a \leq -5 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.55 \cdot 10^{+48}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-189}:\\ \;\;\;\;\left(y - 2\right) \cdot b\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+26}:\\ \;\;\;\;\left(1 - y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (let* ((t_1 (* (- 1.0 t) a)))
       (if (<= a -5e+114)
         t_1
         (if (<= a -1.55e+48)
           (+ a x)
           (if (<= a 9e-189)
             (* (- y 2.0) b)
             (if (<= a 6e+26) (* (- 1.0 y) z) t_1))))))
    double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (1.0 - t) * a;
    	double tmp;
    	if (a <= -5e+114) {
    		tmp = t_1;
    	} else if (a <= -1.55e+48) {
    		tmp = a + x;
    	} else if (a <= 9e-189) {
    		tmp = (y - 2.0) * b;
    	} else if (a <= 6e+26) {
    		tmp = (1.0 - y) * z;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8) :: t_1
        real(8) :: tmp
        t_1 = (1.0d0 - t) * a
        if (a <= (-5d+114)) then
            tmp = t_1
        else if (a <= (-1.55d+48)) then
            tmp = a + x
        else if (a <= 9d-189) then
            tmp = (y - 2.0d0) * b
        else if (a <= 6d+26) then
            tmp = (1.0d0 - y) * z
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	double t_1 = (1.0 - t) * a;
    	double tmp;
    	if (a <= -5e+114) {
    		tmp = t_1;
    	} else if (a <= -1.55e+48) {
    		tmp = a + x;
    	} else if (a <= 9e-189) {
    		tmp = (y - 2.0) * b;
    	} else if (a <= 6e+26) {
    		tmp = (1.0 - y) * z;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	t_1 = (1.0 - t) * a
    	tmp = 0
    	if a <= -5e+114:
    		tmp = t_1
    	elif a <= -1.55e+48:
    		tmp = a + x
    	elif a <= 9e-189:
    		tmp = (y - 2.0) * b
    	elif a <= 6e+26:
    		tmp = (1.0 - y) * z
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t, a, b)
    	t_1 = Float64(Float64(1.0 - t) * a)
    	tmp = 0.0
    	if (a <= -5e+114)
    		tmp = t_1;
    	elseif (a <= -1.55e+48)
    		tmp = Float64(a + x);
    	elseif (a <= 9e-189)
    		tmp = Float64(Float64(y - 2.0) * b);
    	elseif (a <= 6e+26)
    		tmp = Float64(Float64(1.0 - y) * z);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	t_1 = (1.0 - t) * a;
    	tmp = 0.0;
    	if (a <= -5e+114)
    		tmp = t_1;
    	elseif (a <= -1.55e+48)
    		tmp = a + x;
    	elseif (a <= 9e-189)
    		tmp = (y - 2.0) * b;
    	elseif (a <= 6e+26)
    		tmp = (1.0 - y) * z;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -5e+114], t$95$1, If[LessEqual[a, -1.55e+48], N[(a + x), $MachinePrecision], If[LessEqual[a, 9e-189], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 6e+26], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(1 - t\right) \cdot a\\
    \mathbf{if}\;a \leq -5 \cdot 10^{+114}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;a \leq -1.55 \cdot 10^{+48}:\\
    \;\;\;\;a + x\\
    
    \mathbf{elif}\;a \leq 9 \cdot 10^{-189}:\\
    \;\;\;\;\left(y - 2\right) \cdot b\\
    
    \mathbf{elif}\;a \leq 6 \cdot 10^{+26}:\\
    \;\;\;\;\left(1 - y\right) \cdot z\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if a < -5.0000000000000001e114 or 5.99999999999999994e26 < a

      1. Initial program 90.2%

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

        \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
        3. lower--.f6459.3

          \[\leadsto \color{blue}{\left(1 - t\right)} \cdot a \]
      5. Applied rewrites59.3%

        \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]

      if -5.0000000000000001e114 < a < -1.55000000000000003e48

      1. Initial program 94.7%

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

        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
      4. Step-by-step derivation
        1. fp-cancel-sub-sign-invN/A

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

          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
        3. mul-1-negN/A

          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
      5. Applied rewrites89.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
      6. Taylor expanded in b around 0

        \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites58.3%

          \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
        2. Taylor expanded in t around 0

          \[\leadsto a + x \]
        3. Step-by-step derivation
          1. Applied rewrites43.1%

            \[\leadsto a + x \]

          if -1.55000000000000003e48 < a < 8.9999999999999992e-189

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
          4. Step-by-step derivation
            1. fp-cancel-sub-sign-invN/A

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

              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
            3. mul-1-negN/A

              \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
          5. Applied rewrites83.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
          6. Taylor expanded in x around 0

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

              \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
            2. Taylor expanded in a around 0

              \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
            3. Step-by-step derivation
              1. Applied rewrites59.5%

                \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
              2. Taylor expanded in t around 0

                \[\leadsto b \cdot \left(y - 2\right) \]
              3. Step-by-step derivation
                1. Applied rewrites43.6%

                  \[\leadsto \left(y - 2\right) \cdot b \]

                if 8.9999999999999992e-189 < a < 5.99999999999999994e26

                1. Initial program 97.6%

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

                  \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

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

                    \[\leadsto \color{blue}{\left(1 - y\right) \cdot z} \]
                  3. lower--.f6445.8

                    \[\leadsto \color{blue}{\left(1 - y\right)} \cdot z \]
                5. Applied rewrites45.8%

                  \[\leadsto \color{blue}{\left(1 - y\right) \cdot z} \]
              4. Recombined 4 regimes into one program.
              5. Add Preprocessing

              Alternative 6: 82.5% accurate, 1.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.9 \cdot 10^{-62} \lor \neg \left(b \leq 4.8 \cdot 10^{+26}\right):\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - \left(y - 1\right) \cdot z\\ \end{array} \end{array} \]
              (FPCore (x y z t a b)
               :precision binary64
               (if (or (<= b -1.9e-62) (not (<= b 4.8e+26)))
                 (fma (- b a) t (fma (- y 2.0) b a))
                 (- (fma (- 1.0 t) a x) (* (- y 1.0) z))))
              double code(double x, double y, double z, double t, double a, double b) {
              	double tmp;
              	if ((b <= -1.9e-62) || !(b <= 4.8e+26)) {
              		tmp = fma((b - a), t, fma((y - 2.0), b, a));
              	} else {
              		tmp = fma((1.0 - t), a, x) - ((y - 1.0) * z);
              	}
              	return tmp;
              }
              
              function code(x, y, z, t, a, b)
              	tmp = 0.0
              	if ((b <= -1.9e-62) || !(b <= 4.8e+26))
              		tmp = fma(Float64(b - a), t, fma(Float64(y - 2.0), b, a));
              	else
              		tmp = Float64(fma(Float64(1.0 - t), a, x) - Float64(Float64(y - 1.0) * z));
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.9e-62], N[Not[LessEqual[b, 4.8e+26]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq -1.9 \cdot 10^{-62} \lor \neg \left(b \leq 4.8 \cdot 10^{+26}\right):\\
              \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - \left(y - 1\right) \cdot z\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < -1.90000000000000003e-62 or 4.80000000000000009e26 < b

                1. Initial program 91.7%

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

                  \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                4. Step-by-step derivation
                  1. fp-cancel-sub-sign-invN/A

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

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                  3. mul-1-negN/A

                    \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                5. Applied rewrites91.3%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                6. Taylor expanded in x around 0

                  \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites87.9%

                    \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]

                  if -1.90000000000000003e-62 < b < 4.80000000000000009e26

                  1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(\mathsf{fma}\left(\color{blue}{b - a}, t, x + b \cdot \left(y - 2\right)\right) + a\right) - z \cdot \left(y - 1\right) \]
                    12. +-commutativeN/A

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

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

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

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

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

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

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

                    \[\leadsto \left(a + \left(x + -1 \cdot \left(a \cdot t\right)\right)\right) - \color{blue}{\left(y - 1\right)} \cdot z \]
                  7. Step-by-step derivation
                    1. Applied rewrites87.3%

                      \[\leadsto \mathsf{fma}\left(1 - t, a, x\right) - \color{blue}{\left(y - 1\right)} \cdot z \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification87.6%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.9 \cdot 10^{-62} \lor \neg \left(b \leq 4.8 \cdot 10^{+26}\right):\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - \left(y - 1\right) \cdot z\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 7: 96.2% accurate, 1.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(\mathsf{fma}\left(\color{blue}{b - a}, t, x + b \cdot \left(y - 2\right)\right) + a\right) - z \cdot \left(y - 1\right) \]
                    12. +-commutativeN/A

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

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

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

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

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

                      \[\leadsto \left(\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, x\right)\right) + a\right) - \color{blue}{\left(y - 1\right) \cdot z} \]
                  5. Applied rewrites96.9%

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

                  Alternative 8: 68.3% accurate, 1.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.02 \cdot 10^{-14}:\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\ \mathbf{elif}\;t \leq 5.6 \cdot 10^{+47}:\\ \;\;\;\;\mathsf{fma}\left(1, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\ \end{array} \end{array} \]
                  (FPCore (x y z t a b)
                   :precision binary64
                   (if (<= t -1.02e-14)
                     (fma (- b a) t (fma (- y 2.0) b a))
                     (if (<= t 5.6e+47)
                       (fma 1.0 a (fma (- (+ t y) 2.0) b x))
                       (fma (- b a) t (* (- y 2.0) b)))))
                  double code(double x, double y, double z, double t, double a, double b) {
                  	double tmp;
                  	if (t <= -1.02e-14) {
                  		tmp = fma((b - a), t, fma((y - 2.0), b, a));
                  	} else if (t <= 5.6e+47) {
                  		tmp = fma(1.0, a, fma(((t + y) - 2.0), b, x));
                  	} else {
                  		tmp = fma((b - a), t, ((y - 2.0) * b));
                  	}
                  	return tmp;
                  }
                  
                  function code(x, y, z, t, a, b)
                  	tmp = 0.0
                  	if (t <= -1.02e-14)
                  		tmp = fma(Float64(b - a), t, fma(Float64(y - 2.0), b, a));
                  	elseif (t <= 5.6e+47)
                  		tmp = fma(1.0, a, fma(Float64(Float64(t + y) - 2.0), b, x));
                  	else
                  		tmp = fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b));
                  	end
                  	return tmp
                  end
                  
                  code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.02e-14], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e+47], N[(1.0 * a + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;t \leq -1.02 \cdot 10^{-14}:\\
                  \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\
                  
                  \mathbf{elif}\;t \leq 5.6 \cdot 10^{+47}:\\
                  \;\;\;\;\mathsf{fma}\left(1, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if t < -1.02e-14

                    1. Initial program 90.6%

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

                      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                    4. Step-by-step derivation
                      1. fp-cancel-sub-sign-invN/A

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

                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                      3. mul-1-negN/A

                        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                    5. Applied rewrites86.6%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                    6. Taylor expanded in x around 0

                      \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites79.0%

                        \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]

                      if -1.02e-14 < t < 5.59999999999999976e47

                      1. Initial program 98.5%

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

                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                      4. Step-by-step derivation
                        1. fp-cancel-sub-sign-invN/A

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

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                        3. mul-1-negN/A

                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                      5. Applied rewrites74.8%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                      6. Taylor expanded in t around 0

                        \[\leadsto \mathsf{fma}\left(1, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right) \]
                      7. Step-by-step derivation
                        1. Applied rewrites74.9%

                          \[\leadsto \mathsf{fma}\left(1, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right) \]

                        if 5.59999999999999976e47 < t

                        1. Initial program 91.0%

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

                          \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                        4. Step-by-step derivation
                          1. fp-cancel-sub-sign-invN/A

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

                            \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                          3. mul-1-negN/A

                            \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                        5. Applied rewrites88.0%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                        6. Taylor expanded in x around 0

                          \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites86.6%

                            \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                          2. Taylor expanded in a around 0

                            \[\leadsto \mathsf{fma}\left(b - a, t, b \cdot \left(y - 2\right)\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites86.6%

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

                          Alternative 9: 67.8% accurate, 1.2× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+24} \lor \neg \left(t \leq 10^{-16}\right):\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \end{array} \end{array} \]
                          (FPCore (x y z t a b)
                           :precision binary64
                           (if (or (<= t -1.8e+24) (not (<= t 1e-16)))
                             (fma (- b a) t (* (- y 2.0) b))
                             (+ (fma (- y 2.0) b x) a)))
                          double code(double x, double y, double z, double t, double a, double b) {
                          	double tmp;
                          	if ((t <= -1.8e+24) || !(t <= 1e-16)) {
                          		tmp = fma((b - a), t, ((y - 2.0) * b));
                          	} else {
                          		tmp = fma((y - 2.0), b, x) + a;
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z, t, a, b)
                          	tmp = 0.0
                          	if ((t <= -1.8e+24) || !(t <= 1e-16))
                          		tmp = fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b));
                          	else
                          		tmp = Float64(fma(Float64(y - 2.0), b, x) + a);
                          	end
                          	return tmp
                          end
                          
                          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.8e+24], N[Not[LessEqual[t, 1e-16]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;t \leq -1.8 \cdot 10^{+24} \lor \neg \left(t \leq 10^{-16}\right):\\
                          \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if t < -1.79999999999999992e24 or 9.9999999999999998e-17 < t

                            1. Initial program 90.4%

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

                              \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                            4. Step-by-step derivation
                              1. fp-cancel-sub-sign-invN/A

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

                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                              3. mul-1-negN/A

                                \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                            5. Applied rewrites86.7%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                            6. Taylor expanded in x around 0

                              \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                            7. Step-by-step derivation
                              1. Applied rewrites80.8%

                                \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                              2. Taylor expanded in a around 0

                                \[\leadsto \mathsf{fma}\left(b - a, t, b \cdot \left(y - 2\right)\right) \]
                              3. Step-by-step derivation
                                1. Applied rewrites80.8%

                                  \[\leadsto \mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) \]

                                if -1.79999999999999992e24 < t < 9.9999999999999998e-17

                                1. Initial program 99.2%

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

                                  \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                4. Step-by-step derivation
                                  1. fp-cancel-sub-sign-invN/A

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

                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                  3. mul-1-negN/A

                                    \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                5. Applied rewrites74.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                6. Taylor expanded in b around 0

                                  \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites38.5%

                                    \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                  2. Taylor expanded in t around 0

                                    \[\leadsto a + \color{blue}{\left(x + b \cdot \left(y - 2\right)\right)} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites74.7%

                                      \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) + \color{blue}{a} \]
                                  4. Recombined 2 regimes into one program.
                                  5. Final simplification77.7%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{+24} \lor \neg \left(t \leq 10^{-16}\right):\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \end{array} \]
                                  6. Add Preprocessing

                                  Alternative 10: 68.0% accurate, 1.2× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.02 \cdot 10^{-14}:\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\ \mathbf{elif}\;t \leq 10^{-16}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\ \end{array} \end{array} \]
                                  (FPCore (x y z t a b)
                                   :precision binary64
                                   (if (<= t -1.02e-14)
                                     (fma (- b a) t (fma (- y 2.0) b a))
                                     (if (<= t 1e-16)
                                       (+ (fma (- y 2.0) b x) a)
                                       (fma (- b a) t (* (- y 2.0) b)))))
                                  double code(double x, double y, double z, double t, double a, double b) {
                                  	double tmp;
                                  	if (t <= -1.02e-14) {
                                  		tmp = fma((b - a), t, fma((y - 2.0), b, a));
                                  	} else if (t <= 1e-16) {
                                  		tmp = fma((y - 2.0), b, x) + a;
                                  	} else {
                                  		tmp = fma((b - a), t, ((y - 2.0) * b));
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(x, y, z, t, a, b)
                                  	tmp = 0.0
                                  	if (t <= -1.02e-14)
                                  		tmp = fma(Float64(b - a), t, fma(Float64(y - 2.0), b, a));
                                  	elseif (t <= 1e-16)
                                  		tmp = Float64(fma(Float64(y - 2.0), b, x) + a);
                                  	else
                                  		tmp = fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b));
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.02e-14], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-16], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;t \leq -1.02 \cdot 10^{-14}:\\
                                  \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(y - 2, b, a\right)\right)\\
                                  
                                  \mathbf{elif}\;t \leq 10^{-16}:\\
                                  \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if t < -1.02e-14

                                    1. Initial program 90.6%

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

                                      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                    4. Step-by-step derivation
                                      1. fp-cancel-sub-sign-invN/A

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

                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                      3. mul-1-negN/A

                                        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                    5. Applied rewrites86.6%

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                    6. Taylor expanded in x around 0

                                      \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites79.0%

                                        \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]

                                      if -1.02e-14 < t < 9.9999999999999998e-17

                                      1. Initial program 99.2%

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

                                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                      4. Step-by-step derivation
                                        1. fp-cancel-sub-sign-invN/A

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

                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                        3. mul-1-negN/A

                                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                      5. Applied rewrites75.4%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                      6. Taylor expanded in b around 0

                                        \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites39.1%

                                          \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                        2. Taylor expanded in t around 0

                                          \[\leadsto a + \color{blue}{\left(x + b \cdot \left(y - 2\right)\right)} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites75.4%

                                            \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) + \color{blue}{a} \]

                                          if 9.9999999999999998e-17 < t

                                          1. Initial program 90.9%

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

                                            \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                          4. Step-by-step derivation
                                            1. fp-cancel-sub-sign-invN/A

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

                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                            3. mul-1-negN/A

                                              \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                          5. Applied rewrites84.9%

                                            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                          6. Taylor expanded in x around 0

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

                                              \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                            2. Taylor expanded in a around 0

                                              \[\leadsto \mathsf{fma}\left(b - a, t, b \cdot \left(y - 2\right)\right) \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites81.2%

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

                                            Alternative 11: 64.9% accurate, 1.3× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+33}:\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, a\right)\right)\\ \end{array} \end{array} \]
                                            (FPCore (x y z t a b)
                                             :precision binary64
                                             (if (<= t -1.7e+33)
                                               (* (- b a) t)
                                               (if (<= t 7.8e+95)
                                                 (+ (fma (- y 2.0) b x) a)
                                                 (fma (- b a) t (fma -2.0 b a)))))
                                            double code(double x, double y, double z, double t, double a, double b) {
                                            	double tmp;
                                            	if (t <= -1.7e+33) {
                                            		tmp = (b - a) * t;
                                            	} else if (t <= 7.8e+95) {
                                            		tmp = fma((y - 2.0), b, x) + a;
                                            	} else {
                                            		tmp = fma((b - a), t, fma(-2.0, b, a));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            function code(x, y, z, t, a, b)
                                            	tmp = 0.0
                                            	if (t <= -1.7e+33)
                                            		tmp = Float64(Float64(b - a) * t);
                                            	elseif (t <= 7.8e+95)
                                            		tmp = Float64(fma(Float64(y - 2.0), b, x) + a);
                                            	else
                                            		tmp = fma(Float64(b - a), t, fma(-2.0, b, a));
                                            	end
                                            	return tmp
                                            end
                                            
                                            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.7e+33], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 7.8e+95], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t + N[(-2.0 * b + a), $MachinePrecision]), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;t \leq -1.7 \cdot 10^{+33}:\\
                                            \;\;\;\;\left(b - a\right) \cdot t\\
                                            
                                            \mathbf{elif}\;t \leq 7.8 \cdot 10^{+95}:\\
                                            \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, a\right)\right)\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if t < -1.7e33

                                              1. Initial program 89.8%

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

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

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

                                                  \[\leadsto \color{blue}{\left(b - a\right) \cdot t} \]
                                                3. lower--.f6477.1

                                                  \[\leadsto \color{blue}{\left(b - a\right)} \cdot t \]
                                              5. Applied rewrites77.1%

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

                                              if -1.7e33 < t < 7.7999999999999994e95

                                              1. Initial program 98.6%

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

                                                \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                              4. Step-by-step derivation
                                                1. fp-cancel-sub-sign-invN/A

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

                                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                3. mul-1-negN/A

                                                  \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                              5. Applied rewrites75.8%

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                              6. Taylor expanded in b around 0

                                                \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites36.9%

                                                  \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                2. Taylor expanded in t around 0

                                                  \[\leadsto a + \color{blue}{\left(x + b \cdot \left(y - 2\right)\right)} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites72.5%

                                                    \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) + \color{blue}{a} \]

                                                  if 7.7999999999999994e95 < t

                                                  1. Initial program 89.3%

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

                                                    \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                  4. Step-by-step derivation
                                                    1. fp-cancel-sub-sign-invN/A

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

                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                    3. mul-1-negN/A

                                                      \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                  5. Applied rewrites85.7%

                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                  6. Taylor expanded in x around 0

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

                                                      \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                    2. Taylor expanded in y around 0

                                                      \[\leadsto \mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, a\right)\right) \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites76.9%

                                                        \[\leadsto \mathsf{fma}\left(b - a, t, \mathsf{fma}\left(-2, b, a\right)\right) \]
                                                    4. Recombined 3 regimes into one program.
                                                    5. Add Preprocessing

                                                    Alternative 12: 48.9% accurate, 1.4× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -2.55 \cdot 10^{-8}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2 \cdot 10^{-185}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+95}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                    (FPCore (x y z t a b)
                                                     :precision binary64
                                                     (let* ((t_1 (* (- b a) t)))
                                                       (if (<= t -2.55e-8)
                                                         t_1
                                                         (if (<= t 2e-185) (+ a x) (if (<= t 7.8e+95) (* (- b z) y) t_1)))))
                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                    	double t_1 = (b - a) * t;
                                                    	double tmp;
                                                    	if (t <= -2.55e-8) {
                                                    		tmp = t_1;
                                                    	} else if (t <= 2e-185) {
                                                    		tmp = a + x;
                                                    	} else if (t <= 7.8e+95) {
                                                    		tmp = (b - z) * y;
                                                    	} else {
                                                    		tmp = t_1;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    module fmin_fmax_functions
                                                        implicit none
                                                        private
                                                        public fmax
                                                        public fmin
                                                    
                                                        interface fmax
                                                            module procedure fmax88
                                                            module procedure fmax44
                                                            module procedure fmax84
                                                            module procedure fmax48
                                                        end interface
                                                        interface fmin
                                                            module procedure fmin88
                                                            module procedure fmin44
                                                            module procedure fmin84
                                                            module procedure fmin48
                                                        end interface
                                                    contains
                                                        real(8) function fmax88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmax44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmax48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin88(x, y) result (res)
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(4) function fmin44(x, y) result (res)
                                                            real(4), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin84(x, y) result(res)
                                                            real(8), intent (in) :: x
                                                            real(4), intent (in) :: y
                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                        end function
                                                        real(8) function fmin48(x, y) result(res)
                                                            real(4), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                        end function
                                                    end module
                                                    
                                                    real(8) function code(x, y, z, t, a, b)
                                                    use fmin_fmax_functions
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        real(8), intent (in) :: z
                                                        real(8), intent (in) :: t
                                                        real(8), intent (in) :: a
                                                        real(8), intent (in) :: b
                                                        real(8) :: t_1
                                                        real(8) :: tmp
                                                        t_1 = (b - a) * t
                                                        if (t <= (-2.55d-8)) then
                                                            tmp = t_1
                                                        else if (t <= 2d-185) then
                                                            tmp = a + x
                                                        else if (t <= 7.8d+95) then
                                                            tmp = (b - z) * y
                                                        else
                                                            tmp = t_1
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double x, double y, double z, double t, double a, double b) {
                                                    	double t_1 = (b - a) * t;
                                                    	double tmp;
                                                    	if (t <= -2.55e-8) {
                                                    		tmp = t_1;
                                                    	} else if (t <= 2e-185) {
                                                    		tmp = a + x;
                                                    	} else if (t <= 7.8e+95) {
                                                    		tmp = (b - z) * y;
                                                    	} else {
                                                    		tmp = t_1;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(x, y, z, t, a, b):
                                                    	t_1 = (b - a) * t
                                                    	tmp = 0
                                                    	if t <= -2.55e-8:
                                                    		tmp = t_1
                                                    	elif t <= 2e-185:
                                                    		tmp = a + x
                                                    	elif t <= 7.8e+95:
                                                    		tmp = (b - z) * y
                                                    	else:
                                                    		tmp = t_1
                                                    	return tmp
                                                    
                                                    function code(x, y, z, t, a, b)
                                                    	t_1 = Float64(Float64(b - a) * t)
                                                    	tmp = 0.0
                                                    	if (t <= -2.55e-8)
                                                    		tmp = t_1;
                                                    	elseif (t <= 2e-185)
                                                    		tmp = Float64(a + x);
                                                    	elseif (t <= 7.8e+95)
                                                    		tmp = Float64(Float64(b - z) * y);
                                                    	else
                                                    		tmp = t_1;
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(x, y, z, t, a, b)
                                                    	t_1 = (b - a) * t;
                                                    	tmp = 0.0;
                                                    	if (t <= -2.55e-8)
                                                    		tmp = t_1;
                                                    	elseif (t <= 2e-185)
                                                    		tmp = a + x;
                                                    	elseif (t <= 7.8e+95)
                                                    		tmp = (b - z) * y;
                                                    	else
                                                    		tmp = t_1;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.55e-8], t$95$1, If[LessEqual[t, 2e-185], N[(a + x), $MachinePrecision], If[LessEqual[t, 7.8e+95], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_1 := \left(b - a\right) \cdot t\\
                                                    \mathbf{if}\;t \leq -2.55 \cdot 10^{-8}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    \mathbf{elif}\;t \leq 2 \cdot 10^{-185}:\\
                                                    \;\;\;\;a + x\\
                                                    
                                                    \mathbf{elif}\;t \leq 7.8 \cdot 10^{+95}:\\
                                                    \;\;\;\;\left(b - z\right) \cdot y\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if t < -2.55e-8 or 7.7999999999999994e95 < t

                                                      1. Initial program 89.9%

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

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

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

                                                          \[\leadsto \color{blue}{\left(b - a\right) \cdot t} \]
                                                        3. lower--.f6475.0

                                                          \[\leadsto \color{blue}{\left(b - a\right)} \cdot t \]
                                                      5. Applied rewrites75.0%

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

                                                      if -2.55e-8 < t < 2e-185

                                                      1. Initial program 98.9%

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

                                                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                      4. Step-by-step derivation
                                                        1. fp-cancel-sub-sign-invN/A

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

                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                        3. mul-1-negN/A

                                                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                      5. Applied rewrites77.4%

                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                      6. Taylor expanded in b around 0

                                                        \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites43.7%

                                                          \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                        2. Taylor expanded in t around 0

                                                          \[\leadsto a + x \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites43.6%

                                                            \[\leadsto a + x \]

                                                          if 2e-185 < t < 7.7999999999999994e95

                                                          1. Initial program 98.1%

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

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

                                                              \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]
                                                            2. lower-*.f64N/A

                                                              \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]
                                                            3. lower--.f6454.1

                                                              \[\leadsto \color{blue}{\left(b - z\right)} \cdot y \]
                                                          5. Applied rewrites54.1%

                                                            \[\leadsto \color{blue}{\left(b - z\right) \cdot y} \]
                                                        4. Recombined 3 regimes into one program.
                                                        5. Add Preprocessing

                                                        Alternative 13: 46.4% accurate, 1.4× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -2.55 \cdot 10^{-8}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{-289}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;t \leq 7.8 \cdot 10^{+95}:\\ \;\;\;\;\left(y - 2\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                        (FPCore (x y z t a b)
                                                         :precision binary64
                                                         (let* ((t_1 (* (- b a) t)))
                                                           (if (<= t -2.55e-8)
                                                             t_1
                                                             (if (<= t 1.02e-289) (+ a x) (if (<= t 7.8e+95) (* (- y 2.0) b) t_1)))))
                                                        double code(double x, double y, double z, double t, double a, double b) {
                                                        	double t_1 = (b - a) * t;
                                                        	double tmp;
                                                        	if (t <= -2.55e-8) {
                                                        		tmp = t_1;
                                                        	} else if (t <= 1.02e-289) {
                                                        		tmp = a + x;
                                                        	} else if (t <= 7.8e+95) {
                                                        		tmp = (y - 2.0) * b;
                                                        	} else {
                                                        		tmp = t_1;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        module fmin_fmax_functions
                                                            implicit none
                                                            private
                                                            public fmax
                                                            public fmin
                                                        
                                                            interface fmax
                                                                module procedure fmax88
                                                                module procedure fmax44
                                                                module procedure fmax84
                                                                module procedure fmax48
                                                            end interface
                                                            interface fmin
                                                                module procedure fmin88
                                                                module procedure fmin44
                                                                module procedure fmin84
                                                                module procedure fmin48
                                                            end interface
                                                        contains
                                                            real(8) function fmax88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmax44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmin44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                            end function
                                                        end module
                                                        
                                                        real(8) function code(x, y, z, t, a, b)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: x
                                                            real(8), intent (in) :: y
                                                            real(8), intent (in) :: z
                                                            real(8), intent (in) :: t
                                                            real(8), intent (in) :: a
                                                            real(8), intent (in) :: b
                                                            real(8) :: t_1
                                                            real(8) :: tmp
                                                            t_1 = (b - a) * t
                                                            if (t <= (-2.55d-8)) then
                                                                tmp = t_1
                                                            else if (t <= 1.02d-289) then
                                                                tmp = a + x
                                                            else if (t <= 7.8d+95) then
                                                                tmp = (y - 2.0d0) * b
                                                            else
                                                                tmp = t_1
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double x, double y, double z, double t, double a, double b) {
                                                        	double t_1 = (b - a) * t;
                                                        	double tmp;
                                                        	if (t <= -2.55e-8) {
                                                        		tmp = t_1;
                                                        	} else if (t <= 1.02e-289) {
                                                        		tmp = a + x;
                                                        	} else if (t <= 7.8e+95) {
                                                        		tmp = (y - 2.0) * b;
                                                        	} else {
                                                        		tmp = t_1;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(x, y, z, t, a, b):
                                                        	t_1 = (b - a) * t
                                                        	tmp = 0
                                                        	if t <= -2.55e-8:
                                                        		tmp = t_1
                                                        	elif t <= 1.02e-289:
                                                        		tmp = a + x
                                                        	elif t <= 7.8e+95:
                                                        		tmp = (y - 2.0) * b
                                                        	else:
                                                        		tmp = t_1
                                                        	return tmp
                                                        
                                                        function code(x, y, z, t, a, b)
                                                        	t_1 = Float64(Float64(b - a) * t)
                                                        	tmp = 0.0
                                                        	if (t <= -2.55e-8)
                                                        		tmp = t_1;
                                                        	elseif (t <= 1.02e-289)
                                                        		tmp = Float64(a + x);
                                                        	elseif (t <= 7.8e+95)
                                                        		tmp = Float64(Float64(y - 2.0) * b);
                                                        	else
                                                        		tmp = t_1;
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(x, y, z, t, a, b)
                                                        	t_1 = (b - a) * t;
                                                        	tmp = 0.0;
                                                        	if (t <= -2.55e-8)
                                                        		tmp = t_1;
                                                        	elseif (t <= 1.02e-289)
                                                        		tmp = a + x;
                                                        	elseif (t <= 7.8e+95)
                                                        		tmp = (y - 2.0) * b;
                                                        	else
                                                        		tmp = t_1;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.55e-8], t$95$1, If[LessEqual[t, 1.02e-289], N[(a + x), $MachinePrecision], If[LessEqual[t, 7.8e+95], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        t_1 := \left(b - a\right) \cdot t\\
                                                        \mathbf{if}\;t \leq -2.55 \cdot 10^{-8}:\\
                                                        \;\;\;\;t\_1\\
                                                        
                                                        \mathbf{elif}\;t \leq 1.02 \cdot 10^{-289}:\\
                                                        \;\;\;\;a + x\\
                                                        
                                                        \mathbf{elif}\;t \leq 7.8 \cdot 10^{+95}:\\
                                                        \;\;\;\;\left(y - 2\right) \cdot b\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;t\_1\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 3 regimes
                                                        2. if t < -2.55e-8 or 7.7999999999999994e95 < t

                                                          1. Initial program 89.9%

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

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

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

                                                              \[\leadsto \color{blue}{\left(b - a\right) \cdot t} \]
                                                            3. lower--.f6475.0

                                                              \[\leadsto \color{blue}{\left(b - a\right)} \cdot t \]
                                                          5. Applied rewrites75.0%

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

                                                          if -2.55e-8 < t < 1.02e-289

                                                          1. Initial program 100.0%

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

                                                            \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                          4. Step-by-step derivation
                                                            1. fp-cancel-sub-sign-invN/A

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

                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                            3. mul-1-negN/A

                                                              \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                          5. Applied rewrites78.8%

                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                          6. Taylor expanded in b around 0

                                                            \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites46.2%

                                                              \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                            2. Taylor expanded in t around 0

                                                              \[\leadsto a + x \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites46.1%

                                                                \[\leadsto a + x \]

                                                              if 1.02e-289 < t < 7.7999999999999994e95

                                                              1. Initial program 97.3%

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

                                                                \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                              4. Step-by-step derivation
                                                                1. fp-cancel-sub-sign-invN/A

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

                                                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                3. mul-1-negN/A

                                                                  \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                              5. Applied rewrites74.5%

                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                              6. Taylor expanded in x around 0

                                                                \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites60.8%

                                                                  \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                2. Taylor expanded in a around 0

                                                                  \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites47.6%

                                                                    \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                                  2. Taylor expanded in t around 0

                                                                    \[\leadsto b \cdot \left(y - 2\right) \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites44.9%

                                                                      \[\leadsto \left(y - 2\right) \cdot b \]
                                                                  4. Recombined 3 regimes into one program.
                                                                  5. Add Preprocessing

                                                                  Alternative 14: 36.0% accurate, 1.4× speedup?

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

                                                                    1. Initial program 95.0%

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

                                                                      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                    4. Step-by-step derivation
                                                                      1. fp-cancel-sub-sign-invN/A

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

                                                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                      3. mul-1-negN/A

                                                                        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                    5. Applied rewrites98.3%

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                    6. Taylor expanded in x around 0

                                                                      \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites92.3%

                                                                        \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                      2. Taylor expanded in a around 0

                                                                        \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites86.1%

                                                                          \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                                        2. Taylor expanded in t around 0

                                                                          \[\leadsto b \cdot \left(y - 2\right) \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites59.2%

                                                                            \[\leadsto \left(y - 2\right) \cdot b \]

                                                                          if -1.3e41 < b < 4.59999999999999989e-117

                                                                          1. Initial program 98.1%

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

                                                                            \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                          4. Step-by-step derivation
                                                                            1. fp-cancel-sub-sign-invN/A

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

                                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                            3. mul-1-negN/A

                                                                              \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                          5. Applied rewrites72.8%

                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                          6. Taylor expanded in b around 0

                                                                            \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                          7. Step-by-step derivation
                                                                            1. Applied rewrites61.2%

                                                                              \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                            2. Taylor expanded in t around 0

                                                                              \[\leadsto a + x \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites40.6%

                                                                                \[\leadsto a + x \]

                                                                              if 4.59999999999999989e-117 < b < 1.95000000000000016e116

                                                                              1. Initial program 96.0%

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

                                                                                \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                              4. Step-by-step derivation
                                                                                1. *-commutativeN/A

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

                                                                                  \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                                3. lower--.f6434.4

                                                                                  \[\leadsto \color{blue}{\left(1 - t\right)} \cdot a \]
                                                                              5. Applied rewrites34.4%

                                                                                \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                              6. Taylor expanded in t around inf

                                                                                \[\leadsto \left(-1 \cdot t\right) \cdot a \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites32.0%

                                                                                  \[\leadsto \left(-t\right) \cdot a \]

                                                                                if 1.95000000000000016e116 < b

                                                                                1. Initial program 84.2%

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

                                                                                  \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                4. Step-by-step derivation
                                                                                  1. fp-cancel-sub-sign-invN/A

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

                                                                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                  3. mul-1-negN/A

                                                                                    \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                5. Applied rewrites85.1%

                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                6. Taylor expanded in x around 0

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

                                                                                    \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                                  2. Taylor expanded in a around 0

                                                                                    \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites77.5%

                                                                                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                                                    2. Taylor expanded in y around 0

                                                                                      \[\leadsto \left(t - 2\right) \cdot b \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites62.1%

                                                                                        \[\leadsto \left(t - 2\right) \cdot b \]
                                                                                    4. Recombined 4 regimes into one program.
                                                                                    5. Add Preprocessing

                                                                                    Alternative 15: 37.3% accurate, 1.4× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - 2\right) \cdot b\\ \mathbf{if}\;b \leq -1.3 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-117}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;b \leq 5.4 \cdot 10^{-18}:\\ \;\;\;\;\left(-t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                                    (FPCore (x y z t a b)
                                                                                     :precision binary64
                                                                                     (let* ((t_1 (* (- y 2.0) b)))
                                                                                       (if (<= b -1.3e+41)
                                                                                         t_1
                                                                                         (if (<= b 4.6e-117) (+ a x) (if (<= b 5.4e-18) (* (- t) a) t_1)))))
                                                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                                                    	double t_1 = (y - 2.0) * b;
                                                                                    	double tmp;
                                                                                    	if (b <= -1.3e+41) {
                                                                                    		tmp = t_1;
                                                                                    	} else if (b <= 4.6e-117) {
                                                                                    		tmp = a + x;
                                                                                    	} else if (b <= 5.4e-18) {
                                                                                    		tmp = -t * a;
                                                                                    	} else {
                                                                                    		tmp = t_1;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    module fmin_fmax_functions
                                                                                        implicit none
                                                                                        private
                                                                                        public fmax
                                                                                        public fmin
                                                                                    
                                                                                        interface fmax
                                                                                            module procedure fmax88
                                                                                            module procedure fmax44
                                                                                            module procedure fmax84
                                                                                            module procedure fmax48
                                                                                        end interface
                                                                                        interface fmin
                                                                                            module procedure fmin88
                                                                                            module procedure fmin44
                                                                                            module procedure fmin84
                                                                                            module procedure fmin48
                                                                                        end interface
                                                                                    contains
                                                                                        real(8) function fmax88(x, y) result (res)
                                                                                            real(8), intent (in) :: x
                                                                                            real(8), intent (in) :: y
                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                        end function
                                                                                        real(4) function fmax44(x, y) result (res)
                                                                                            real(4), intent (in) :: x
                                                                                            real(4), intent (in) :: y
                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                        end function
                                                                                        real(8) function fmax84(x, y) result(res)
                                                                                            real(8), intent (in) :: x
                                                                                            real(4), intent (in) :: y
                                                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                        end function
                                                                                        real(8) function fmax48(x, y) result(res)
                                                                                            real(4), intent (in) :: x
                                                                                            real(8), intent (in) :: y
                                                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                        end function
                                                                                        real(8) function fmin88(x, y) result (res)
                                                                                            real(8), intent (in) :: x
                                                                                            real(8), intent (in) :: y
                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                        end function
                                                                                        real(4) function fmin44(x, y) result (res)
                                                                                            real(4), intent (in) :: x
                                                                                            real(4), intent (in) :: y
                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                        end function
                                                                                        real(8) function fmin84(x, y) result(res)
                                                                                            real(8), intent (in) :: x
                                                                                            real(4), intent (in) :: y
                                                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                        end function
                                                                                        real(8) function fmin48(x, y) result(res)
                                                                                            real(4), intent (in) :: x
                                                                                            real(8), intent (in) :: y
                                                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                        end function
                                                                                    end module
                                                                                    
                                                                                    real(8) function code(x, y, z, t, a, b)
                                                                                    use fmin_fmax_functions
                                                                                        real(8), intent (in) :: x
                                                                                        real(8), intent (in) :: y
                                                                                        real(8), intent (in) :: z
                                                                                        real(8), intent (in) :: t
                                                                                        real(8), intent (in) :: a
                                                                                        real(8), intent (in) :: b
                                                                                        real(8) :: t_1
                                                                                        real(8) :: tmp
                                                                                        t_1 = (y - 2.0d0) * b
                                                                                        if (b <= (-1.3d+41)) then
                                                                                            tmp = t_1
                                                                                        else if (b <= 4.6d-117) then
                                                                                            tmp = a + x
                                                                                        else if (b <= 5.4d-18) then
                                                                                            tmp = -t * a
                                                                                        else
                                                                                            tmp = t_1
                                                                                        end if
                                                                                        code = tmp
                                                                                    end function
                                                                                    
                                                                                    public static double code(double x, double y, double z, double t, double a, double b) {
                                                                                    	double t_1 = (y - 2.0) * b;
                                                                                    	double tmp;
                                                                                    	if (b <= -1.3e+41) {
                                                                                    		tmp = t_1;
                                                                                    	} else if (b <= 4.6e-117) {
                                                                                    		tmp = a + x;
                                                                                    	} else if (b <= 5.4e-18) {
                                                                                    		tmp = -t * a;
                                                                                    	} else {
                                                                                    		tmp = t_1;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    def code(x, y, z, t, a, b):
                                                                                    	t_1 = (y - 2.0) * b
                                                                                    	tmp = 0
                                                                                    	if b <= -1.3e+41:
                                                                                    		tmp = t_1
                                                                                    	elif b <= 4.6e-117:
                                                                                    		tmp = a + x
                                                                                    	elif b <= 5.4e-18:
                                                                                    		tmp = -t * a
                                                                                    	else:
                                                                                    		tmp = t_1
                                                                                    	return tmp
                                                                                    
                                                                                    function code(x, y, z, t, a, b)
                                                                                    	t_1 = Float64(Float64(y - 2.0) * b)
                                                                                    	tmp = 0.0
                                                                                    	if (b <= -1.3e+41)
                                                                                    		tmp = t_1;
                                                                                    	elseif (b <= 4.6e-117)
                                                                                    		tmp = Float64(a + x);
                                                                                    	elseif (b <= 5.4e-18)
                                                                                    		tmp = Float64(Float64(-t) * a);
                                                                                    	else
                                                                                    		tmp = t_1;
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    function tmp_2 = code(x, y, z, t, a, b)
                                                                                    	t_1 = (y - 2.0) * b;
                                                                                    	tmp = 0.0;
                                                                                    	if (b <= -1.3e+41)
                                                                                    		tmp = t_1;
                                                                                    	elseif (b <= 4.6e-117)
                                                                                    		tmp = a + x;
                                                                                    	elseif (b <= 5.4e-18)
                                                                                    		tmp = -t * a;
                                                                                    	else
                                                                                    		tmp = t_1;
                                                                                    	end
                                                                                    	tmp_2 = tmp;
                                                                                    end
                                                                                    
                                                                                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.3e+41], t$95$1, If[LessEqual[b, 4.6e-117], N[(a + x), $MachinePrecision], If[LessEqual[b, 5.4e-18], N[((-t) * a), $MachinePrecision], t$95$1]]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_1 := \left(y - 2\right) \cdot b\\
                                                                                    \mathbf{if}\;b \leq -1.3 \cdot 10^{+41}:\\
                                                                                    \;\;\;\;t\_1\\
                                                                                    
                                                                                    \mathbf{elif}\;b \leq 4.6 \cdot 10^{-117}:\\
                                                                                    \;\;\;\;a + x\\
                                                                                    
                                                                                    \mathbf{elif}\;b \leq 5.4 \cdot 10^{-18}:\\
                                                                                    \;\;\;\;\left(-t\right) \cdot a\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;t\_1\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 3 regimes
                                                                                    2. if b < -1.3e41 or 5.39999999999999977e-18 < b

                                                                                      1. Initial program 91.2%

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

                                                                                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. fp-cancel-sub-sign-invN/A

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

                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                        3. mul-1-negN/A

                                                                                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                      5. Applied rewrites89.9%

                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                      6. Taylor expanded in x around 0

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

                                                                                          \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                                        2. Taylor expanded in a around 0

                                                                                          \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                                        3. Step-by-step derivation
                                                                                          1. Applied rewrites72.8%

                                                                                            \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                                                          2. Taylor expanded in t around 0

                                                                                            \[\leadsto b \cdot \left(y - 2\right) \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites51.4%

                                                                                              \[\leadsto \left(y - 2\right) \cdot b \]

                                                                                            if -1.3e41 < b < 4.59999999999999989e-117

                                                                                            1. Initial program 98.1%

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

                                                                                              \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. fp-cancel-sub-sign-invN/A

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

                                                                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                              3. mul-1-negN/A

                                                                                                \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                            5. Applied rewrites72.8%

                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                            6. Taylor expanded in b around 0

                                                                                              \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Applied rewrites61.2%

                                                                                                \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                                              2. Taylor expanded in t around 0

                                                                                                \[\leadsto a + x \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites40.6%

                                                                                                  \[\leadsto a + x \]

                                                                                                if 4.59999999999999989e-117 < b < 5.39999999999999977e-18

                                                                                                1. Initial program 99.9%

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

                                                                                                  \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. *-commutativeN/A

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

                                                                                                    \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                                                  3. lower--.f6439.5

                                                                                                    \[\leadsto \color{blue}{\left(1 - t\right)} \cdot a \]
                                                                                                5. Applied rewrites39.5%

                                                                                                  \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                                                6. Taylor expanded in t around inf

                                                                                                  \[\leadsto \left(-1 \cdot t\right) \cdot a \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites35.6%

                                                                                                    \[\leadsto \left(-t\right) \cdot a \]
                                                                                                8. Recombined 3 regimes into one program.
                                                                                                9. Add Preprocessing

                                                                                                Alternative 16: 64.9% accurate, 1.5× speedup?

                                                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+33} \lor \neg \left(t \leq 7.8 \cdot 10^{+95}\right):\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \end{array} \end{array} \]
                                                                                                (FPCore (x y z t a b)
                                                                                                 :precision binary64
                                                                                                 (if (or (<= t -1.7e+33) (not (<= t 7.8e+95)))
                                                                                                   (* (- b a) t)
                                                                                                   (+ (fma (- y 2.0) b x) a)))
                                                                                                double code(double x, double y, double z, double t, double a, double b) {
                                                                                                	double tmp;
                                                                                                	if ((t <= -1.7e+33) || !(t <= 7.8e+95)) {
                                                                                                		tmp = (b - a) * t;
                                                                                                	} else {
                                                                                                		tmp = fma((y - 2.0), b, x) + a;
                                                                                                	}
                                                                                                	return tmp;
                                                                                                }
                                                                                                
                                                                                                function code(x, y, z, t, a, b)
                                                                                                	tmp = 0.0
                                                                                                	if ((t <= -1.7e+33) || !(t <= 7.8e+95))
                                                                                                		tmp = Float64(Float64(b - a) * t);
                                                                                                	else
                                                                                                		tmp = Float64(fma(Float64(y - 2.0), b, x) + a);
                                                                                                	end
                                                                                                	return tmp
                                                                                                end
                                                                                                
                                                                                                code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.7e+33], N[Not[LessEqual[t, 7.8e+95]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision]]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                \begin{array}{l}
                                                                                                \mathbf{if}\;t \leq -1.7 \cdot 10^{+33} \lor \neg \left(t \leq 7.8 \cdot 10^{+95}\right):\\
                                                                                                \;\;\;\;\left(b - a\right) \cdot t\\
                                                                                                
                                                                                                \mathbf{else}:\\
                                                                                                \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\
                                                                                                
                                                                                                
                                                                                                \end{array}
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Split input into 2 regimes
                                                                                                2. if t < -1.7e33 or 7.7999999999999994e95 < t

                                                                                                  1. Initial program 89.6%

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

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

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

                                                                                                      \[\leadsto \color{blue}{\left(b - a\right) \cdot t} \]
                                                                                                    3. lower--.f6477.0

                                                                                                      \[\leadsto \color{blue}{\left(b - a\right)} \cdot t \]
                                                                                                  5. Applied rewrites77.0%

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

                                                                                                  if -1.7e33 < t < 7.7999999999999994e95

                                                                                                  1. Initial program 98.6%

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

                                                                                                    \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. fp-cancel-sub-sign-invN/A

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

                                                                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                    3. mul-1-negN/A

                                                                                                      \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                  5. Applied rewrites75.8%

                                                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                  6. Taylor expanded in b around 0

                                                                                                    \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                  7. Step-by-step derivation
                                                                                                    1. Applied rewrites36.9%

                                                                                                      \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                                                    2. Taylor expanded in t around 0

                                                                                                      \[\leadsto a + \color{blue}{\left(x + b \cdot \left(y - 2\right)\right)} \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites72.5%

                                                                                                        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) + \color{blue}{a} \]
                                                                                                    4. Recombined 2 regimes into one program.
                                                                                                    5. Final simplification74.3%

                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.7 \cdot 10^{+33} \lor \neg \left(t \leq 7.8 \cdot 10^{+95}\right):\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \end{array} \]
                                                                                                    6. Add Preprocessing

                                                                                                    Alternative 17: 61.4% accurate, 1.5× speedup?

                                                                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{+41} \lor \neg \left(b \leq 8.2 \cdot 10^{+47}\right):\\ \;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right)\\ \end{array} \end{array} \]
                                                                                                    (FPCore (x y z t a b)
                                                                                                     :precision binary64
                                                                                                     (if (or (<= b -1.3e+41) (not (<= b 8.2e+47)))
                                                                                                       (* (- (+ t y) 2.0) b)
                                                                                                       (fma (- 1.0 t) a x)))
                                                                                                    double code(double x, double y, double z, double t, double a, double b) {
                                                                                                    	double tmp;
                                                                                                    	if ((b <= -1.3e+41) || !(b <= 8.2e+47)) {
                                                                                                    		tmp = ((t + y) - 2.0) * b;
                                                                                                    	} else {
                                                                                                    		tmp = fma((1.0 - t), a, x);
                                                                                                    	}
                                                                                                    	return tmp;
                                                                                                    }
                                                                                                    
                                                                                                    function code(x, y, z, t, a, b)
                                                                                                    	tmp = 0.0
                                                                                                    	if ((b <= -1.3e+41) || !(b <= 8.2e+47))
                                                                                                    		tmp = Float64(Float64(Float64(t + y) - 2.0) * b);
                                                                                                    	else
                                                                                                    		tmp = fma(Float64(1.0 - t), a, x);
                                                                                                    	end
                                                                                                    	return tmp
                                                                                                    end
                                                                                                    
                                                                                                    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.3e+41], N[Not[LessEqual[b, 8.2e+47]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]]
                                                                                                    
                                                                                                    \begin{array}{l}
                                                                                                    
                                                                                                    \\
                                                                                                    \begin{array}{l}
                                                                                                    \mathbf{if}\;b \leq -1.3 \cdot 10^{+41} \lor \neg \left(b \leq 8.2 \cdot 10^{+47}\right):\\
                                                                                                    \;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
                                                                                                    
                                                                                                    \mathbf{else}:\\
                                                                                                    \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right)\\
                                                                                                    
                                                                                                    
                                                                                                    \end{array}
                                                                                                    \end{array}
                                                                                                    
                                                                                                    Derivation
                                                                                                    1. Split input into 2 regimes
                                                                                                    2. if b < -1.3e41 or 8.2000000000000002e47 < b

                                                                                                      1. Initial program 90.6%

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

                                                                                                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                      4. Step-by-step derivation
                                                                                                        1. fp-cancel-sub-sign-invN/A

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

                                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                        3. mul-1-negN/A

                                                                                                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                      5. Applied rewrites92.8%

                                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                      6. Taylor expanded in x around 0

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

                                                                                                          \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                                                        2. Taylor expanded in a around 0

                                                                                                          \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                                                        3. Step-by-step derivation
                                                                                                          1. Applied rewrites80.6%

                                                                                                            \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]

                                                                                                          if -1.3e41 < b < 8.2000000000000002e47

                                                                                                          1. Initial program 97.9%

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

                                                                                                            \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. fp-cancel-sub-sign-invN/A

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

                                                                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                            3. mul-1-negN/A

                                                                                                              \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                          5. Applied rewrites71.9%

                                                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                          6. Taylor expanded in b around 0

                                                                                                            \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                          7. Step-by-step derivation
                                                                                                            1. Applied rewrites57.3%

                                                                                                              \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                                                          8. Recombined 2 regimes into one program.
                                                                                                          9. Final simplification67.0%

                                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{+41} \lor \neg \left(b \leq 8.2 \cdot 10^{+47}\right):\\ \;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1 - t, a, x\right)\\ \end{array} \]
                                                                                                          10. Add Preprocessing

                                                                                                          Alternative 18: 54.5% accurate, 1.7× speedup?

                                                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -140000 \lor \neg \left(t \leq 7.8 \cdot 10^{+95}\right):\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\ \end{array} \end{array} \]
                                                                                                          (FPCore (x y z t a b)
                                                                                                           :precision binary64
                                                                                                           (if (or (<= t -140000.0) (not (<= t 7.8e+95)))
                                                                                                             (* (- b a) t)
                                                                                                             (fma (- y 2.0) b a)))
                                                                                                          double code(double x, double y, double z, double t, double a, double b) {
                                                                                                          	double tmp;
                                                                                                          	if ((t <= -140000.0) || !(t <= 7.8e+95)) {
                                                                                                          		tmp = (b - a) * t;
                                                                                                          	} else {
                                                                                                          		tmp = fma((y - 2.0), b, a);
                                                                                                          	}
                                                                                                          	return tmp;
                                                                                                          }
                                                                                                          
                                                                                                          function code(x, y, z, t, a, b)
                                                                                                          	tmp = 0.0
                                                                                                          	if ((t <= -140000.0) || !(t <= 7.8e+95))
                                                                                                          		tmp = Float64(Float64(b - a) * t);
                                                                                                          	else
                                                                                                          		tmp = fma(Float64(y - 2.0), b, a);
                                                                                                          	end
                                                                                                          	return tmp
                                                                                                          end
                                                                                                          
                                                                                                          code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -140000.0], N[Not[LessEqual[t, 7.8e+95]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision]]
                                                                                                          
                                                                                                          \begin{array}{l}
                                                                                                          
                                                                                                          \\
                                                                                                          \begin{array}{l}
                                                                                                          \mathbf{if}\;t \leq -140000 \lor \neg \left(t \leq 7.8 \cdot 10^{+95}\right):\\
                                                                                                          \;\;\;\;\left(b - a\right) \cdot t\\
                                                                                                          
                                                                                                          \mathbf{else}:\\
                                                                                                          \;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\
                                                                                                          
                                                                                                          
                                                                                                          \end{array}
                                                                                                          \end{array}
                                                                                                          
                                                                                                          Derivation
                                                                                                          1. Split input into 2 regimes
                                                                                                          2. if t < -1.4e5 or 7.7999999999999994e95 < t

                                                                                                            1. Initial program 89.8%

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

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

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

                                                                                                                \[\leadsto \color{blue}{\left(b - a\right) \cdot t} \]
                                                                                                              3. lower--.f6475.6

                                                                                                                \[\leadsto \color{blue}{\left(b - a\right)} \cdot t \]
                                                                                                            5. Applied rewrites75.6%

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

                                                                                                            if -1.4e5 < t < 7.7999999999999994e95

                                                                                                            1. Initial program 98.6%

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

                                                                                                              \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                            4. Step-by-step derivation
                                                                                                              1. fp-cancel-sub-sign-invN/A

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

                                                                                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                              3. mul-1-negN/A

                                                                                                                \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                            5. Applied rewrites76.8%

                                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                            6. Taylor expanded in x around 0

                                                                                                              \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                                                                                                            7. Step-by-step derivation
                                                                                                              1. Applied rewrites59.6%

                                                                                                                \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                                                              2. Taylor expanded in t around 0

                                                                                                                \[\leadsto a + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                                                              3. Step-by-step derivation
                                                                                                                1. Applied rewrites56.1%

                                                                                                                  \[\leadsto \mathsf{fma}\left(y - 2, b, a\right) \]
                                                                                                              4. Recombined 2 regimes into one program.
                                                                                                              5. Final simplification64.4%

                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -140000 \lor \neg \left(t \leq 7.8 \cdot 10^{+95}\right):\\ \;\;\;\;\left(b - a\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\ \end{array} \]
                                                                                                              6. Add Preprocessing

                                                                                                              Alternative 19: 38.9% accurate, 1.8× speedup?

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

                                                                                                                1. Initial program 95.0%

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

                                                                                                                  \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                                4. Step-by-step derivation
                                                                                                                  1. fp-cancel-sub-sign-invN/A

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

                                                                                                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                                  3. mul-1-negN/A

                                                                                                                    \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                                5. Applied rewrites98.3%

                                                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                                6. Taylor expanded in x around 0

                                                                                                                  \[\leadsto a \cdot \left(1 - t\right) + \color{blue}{b \cdot \left(\left(t + y\right) - 2\right)} \]
                                                                                                                7. Step-by-step derivation
                                                                                                                  1. Applied rewrites92.3%

                                                                                                                    \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                                                                  2. Taylor expanded in a around 0

                                                                                                                    \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites86.1%

                                                                                                                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                                                                                    2. Taylor expanded in t around 0

                                                                                                                      \[\leadsto b \cdot \left(y - 2\right) \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites59.2%

                                                                                                                        \[\leadsto \left(y - 2\right) \cdot b \]

                                                                                                                      if -2.4000000000000002e41 < b < 3.09999999999999996e116

                                                                                                                      1. Initial program 97.4%

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

                                                                                                                        \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                                      4. Step-by-step derivation
                                                                                                                        1. *-commutativeN/A

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

                                                                                                                          \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                                                                        3. lower--.f6439.4

                                                                                                                          \[\leadsto \color{blue}{\left(1 - t\right)} \cdot a \]
                                                                                                                      5. Applied rewrites39.4%

                                                                                                                        \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]

                                                                                                                      if 3.09999999999999996e116 < b

                                                                                                                      1. Initial program 84.2%

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

                                                                                                                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                                      4. Step-by-step derivation
                                                                                                                        1. fp-cancel-sub-sign-invN/A

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

                                                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                                        3. mul-1-negN/A

                                                                                                                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                                      5. Applied rewrites85.1%

                                                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                                      6. Taylor expanded in x around 0

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

                                                                                                                          \[\leadsto \mathsf{fma}\left(b - a, \color{blue}{t}, \mathsf{fma}\left(y - 2, b, a\right)\right) \]
                                                                                                                        2. Taylor expanded in a around 0

                                                                                                                          \[\leadsto b \cdot t + b \cdot \color{blue}{\left(y - 2\right)} \]
                                                                                                                        3. Step-by-step derivation
                                                                                                                          1. Applied rewrites77.5%

                                                                                                                            \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                                                                                          2. Taylor expanded in y around 0

                                                                                                                            \[\leadsto \left(t - 2\right) \cdot b \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites62.1%

                                                                                                                              \[\leadsto \left(t - 2\right) \cdot b \]
                                                                                                                          4. Recombined 3 regimes into one program.
                                                                                                                          5. Add Preprocessing

                                                                                                                          Alternative 20: 36.1% accurate, 1.8× speedup?

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

                                                                                                                            1. Initial program 90.7%

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

                                                                                                                              \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. *-commutativeN/A

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

                                                                                                                                \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                                                                              3. lower--.f6443.5

                                                                                                                                \[\leadsto \color{blue}{\left(1 - t\right)} \cdot a \]
                                                                                                                            5. Applied rewrites43.5%

                                                                                                                              \[\leadsto \color{blue}{\left(1 - t\right) \cdot a} \]
                                                                                                                            6. Taylor expanded in t around inf

                                                                                                                              \[\leadsto \left(-1 \cdot t\right) \cdot a \]
                                                                                                                            7. Step-by-step derivation
                                                                                                                              1. Applied rewrites43.5%

                                                                                                                                \[\leadsto \left(-t\right) \cdot a \]

                                                                                                                              if -2.55e-8 < t < 5.59999999999999976e47

                                                                                                                              1. Initial program 98.5%

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

                                                                                                                                \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                                              4. Step-by-step derivation
                                                                                                                                1. fp-cancel-sub-sign-invN/A

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

                                                                                                                                  \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                                                3. mul-1-negN/A

                                                                                                                                  \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                                              5. Applied rewrites75.1%

                                                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                                              6. Taylor expanded in b around 0

                                                                                                                                \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                                              7. Step-by-step derivation
                                                                                                                                1. Applied rewrites37.8%

                                                                                                                                  \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                                                                                2. Taylor expanded in t around 0

                                                                                                                                  \[\leadsto a + x \]
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. Applied rewrites37.8%

                                                                                                                                    \[\leadsto a + x \]
                                                                                                                                4. Recombined 2 regimes into one program.
                                                                                                                                5. Final simplification40.4%

                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.55 \cdot 10^{-8} \lor \neg \left(t \leq 5.6 \cdot 10^{+47}\right):\\ \;\;\;\;\left(-t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;a + x\\ \end{array} \]
                                                                                                                                6. Add Preprocessing

                                                                                                                                Alternative 21: 27.3% accurate, 3.1× speedup?

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

                                                                                                                                  1. Initial program 80.6%

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

                                                                                                                                    \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
                                                                                                                                  4. Step-by-step derivation
                                                                                                                                    1. *-commutativeN/A

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

                                                                                                                                      \[\leadsto \color{blue}{\left(1 - y\right) \cdot z} \]
                                                                                                                                    3. lower--.f6458.6

                                                                                                                                      \[\leadsto \color{blue}{\left(1 - y\right)} \cdot z \]
                                                                                                                                  5. Applied rewrites58.6%

                                                                                                                                    \[\leadsto \color{blue}{\left(1 - y\right) \cdot z} \]
                                                                                                                                  6. Taylor expanded in y around 0

                                                                                                                                    \[\leadsto 1 \cdot z \]
                                                                                                                                  7. Step-by-step derivation
                                                                                                                                    1. Applied rewrites28.4%

                                                                                                                                      \[\leadsto 1 \cdot z \]

                                                                                                                                    if -3.30000000000000005e125 < z

                                                                                                                                    1. Initial program 96.9%

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

                                                                                                                                      \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                                                    4. Step-by-step derivation
                                                                                                                                      1. fp-cancel-sub-sign-invN/A

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

                                                                                                                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                                                      3. mul-1-negN/A

                                                                                                                                        \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                                                    5. Applied rewrites85.5%

                                                                                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                                                    6. Taylor expanded in b around 0

                                                                                                                                      \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                                                    7. Step-by-step derivation
                                                                                                                                      1. Applied rewrites45.9%

                                                                                                                                        \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                                                                                      2. Taylor expanded in t around 0

                                                                                                                                        \[\leadsto a + x \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites25.9%

                                                                                                                                          \[\leadsto a + x \]
                                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                                      5. Add Preprocessing

                                                                                                                                      Alternative 22: 25.1% accurate, 9.3× speedup?

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

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

                                                                                                                                        \[\leadsto \color{blue}{\left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) - a \cdot \left(t - 1\right)} \]
                                                                                                                                      4. Step-by-step derivation
                                                                                                                                        1. fp-cancel-sub-sign-invN/A

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

                                                                                                                                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(a\right)\right) \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right)} \]
                                                                                                                                        3. mul-1-negN/A

                                                                                                                                          \[\leadsto \color{blue}{\left(-1 \cdot a\right)} \cdot \left(t - 1\right) + \left(x + b \cdot \left(\left(t + y\right) - 2\right)\right) \]
                                                                                                                                      5. Applied rewrites80.6%

                                                                                                                                        \[\leadsto \color{blue}{\mathsf{fma}\left(1 - t, a, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)} \]
                                                                                                                                      6. Taylor expanded in b around 0

                                                                                                                                        \[\leadsto x + \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                                                                                      7. Step-by-step derivation
                                                                                                                                        1. Applied rewrites42.7%

                                                                                                                                          \[\leadsto \mathsf{fma}\left(1 - t, \color{blue}{a}, x\right) \]
                                                                                                                                        2. Taylor expanded in t around 0

                                                                                                                                          \[\leadsto a + x \]
                                                                                                                                        3. Step-by-step derivation
                                                                                                                                          1. Applied rewrites23.8%

                                                                                                                                            \[\leadsto a + x \]
                                                                                                                                          2. Add Preprocessing

                                                                                                                                          Reproduce

                                                                                                                                          ?
                                                                                                                                          herbie shell --seed 2025017 
                                                                                                                                          (FPCore (x y z t a b)
                                                                                                                                            :name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
                                                                                                                                            :precision binary64
                                                                                                                                            (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))