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

Percentage Accurate: 95.4% → 97.5%
Time: 5.2s
Alternatives: 21
Speedup: 1.0×

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}

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 21 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.4% 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.5% 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}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, b \cdot t\right)\\ \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 (fma (- y 2.0) b (* b 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 = fma((y - 2.0), b, (b * 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 = fma(Float64(y - 2.0), b, Float64(b * t));
	end
	return 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[(y - 2.0), $MachinePrecision] * b + N[(b * t), $MachinePrecision]), $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}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, b \cdot t\right)\\


\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 \]

    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. Taylor expanded in b around inf

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

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

        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
      3. lift--.f64N/A

        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lift-+.f64N/A

        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
      5. lift-*.f6449.9

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

        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
      7. +-commutativeN/A

        \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
      8. lower-+.f6449.9

        \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
    4. Applied rewrites49.9%

      \[\leadsto \color{blue}{\left(\left(t + y\right) - 2\right) \cdot b} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
      2. lift--.f64N/A

        \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
      3. lower-*.f64N/A

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

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

        \[\leadsto b \cdot \left(t + \color{blue}{\left(y - 2\right)}\right) \]
      6. distribute-lft-outN/A

        \[\leadsto b \cdot t + \color{blue}{b \cdot \left(y - 2\right)} \]
      7. +-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, \color{blue}{b}, b \cdot t\right) \]
      10. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, b \cdot t\right) \]
      11. lower-*.f6446.4

        \[\leadsto \mathsf{fma}\left(y - 2, b, b \cdot t\right) \]
    6. Applied rewrites46.4%

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

Alternative 2: 96.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+92}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) - \mathsf{fma}\left(y - 1, z, -a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1e92

    1. Initial program 96.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. 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)} \]
    3. Step-by-step derivation
      1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) - \mathsf{fma}\left(y - 1, z, \mathsf{neg}\left(a\right)\right)\right) \]
      16. lower-neg.f6497.5

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

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

    if 1e92 < y

    1. Initial program 90.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. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) - \mathsf{fma}\left(t - 1, a, \mathsf{neg}\left(z\right)\right)\right) \]
      16. lower-neg.f6493.9

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

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

Alternative 3: 96.2% accurate, 1.0× speedup?

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

\\
x + \left(\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) - \mathsf{fma}\left(y - 1, z, -a\right)\right)
\end{array}
Derivation
  1. Initial program 95.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. 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)} \]
  3. Step-by-step derivation
    1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 83.1% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.1 \cdot 10^{+126}:\\
\;\;\;\;x + \mathsf{fma}\left(t - 2, b, b \cdot y\right)\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{+83}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - 1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.1000000000000001e126

    1. Initial program 90.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. Taylor expanded in x around inf

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

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

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

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

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

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

          \[\leadsto x + b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
        6. distribute-lft-outN/A

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

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

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

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

          \[\leadsto x + \mathsf{fma}\left(\color{blue}{t - 2}, b, b \cdot y\right) \]
        11. lower-*.f6482.6

          \[\leadsto x + \mathsf{fma}\left(t - 2, b, \color{blue}{b \cdot y}\right) \]
      3. Applied rewrites82.6%

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

      if -5.1000000000000001e126 < b < 1.9000000000000001e83

      1. Initial program 98.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. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x + \left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) - \mathsf{fma}\left(t - 1, a, \mathsf{neg}\left(z\right)\right)\right) \]
        16. lower-neg.f6498.8

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

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

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

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

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

          \[\leadsto x + \left(\left(\left(-1 \cdot y\right) \cdot z + z\right) - a \cdot \left(t - 1\right)\right) \]
        4. lower-fma.f64N/A

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

          \[\leadsto x + \left(\mathsf{fma}\left(\mathsf{neg}\left(y\right), z, z\right) - a \cdot \left(t - 1\right)\right) \]
        6. lower-neg.f64N/A

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

          \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - \color{blue}{1}\right)\right) \]
        8. lift--.f6484.0

          \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - 1\right)\right) \]
      7. Applied rewrites84.0%

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

      if 1.9000000000000001e83 < b

      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. Taylor expanded in x around inf

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

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

      Alternative 5: 83.1% accurate, 1.2× speedup?

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

        1. Initial program 90.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. Taylor expanded in x around inf

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

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

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

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

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

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

              \[\leadsto x + b \cdot \color{blue}{\left(y + \left(t - 2\right)\right)} \]
            6. distribute-lft-outN/A

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

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

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

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

              \[\leadsto x + \mathsf{fma}\left(\color{blue}{t - 2}, b, b \cdot y\right) \]
            11. lower-*.f6482.6

              \[\leadsto x + \mathsf{fma}\left(t - 2, b, \color{blue}{b \cdot y}\right) \]
          3. Applied rewrites82.6%

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

          if -5.1000000000000001e126 < b < 1.9000000000000001e83

          1. Initial program 98.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. Taylor expanded in b around 0

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

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

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

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

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

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

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

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

              \[\leadsto \left(x + \left(-1 \cdot \left(y - 1\right)\right) \cdot z\right) - a \cdot \left(t - 1\right) \]
            9. *-commutativeN/A

              \[\leadsto \left(x + z \cdot \left(-1 \cdot \left(y - 1\right)\right)\right) - a \cdot \left(t - 1\right) \]
            10. mul-1-negN/A

              \[\leadsto \left(x + z \cdot \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right)\right) - a \cdot \left(t - 1\right) \]
            11. sub-negate-revN/A

              \[\leadsto \left(x + z \cdot \left(1 - y\right)\right) - a \cdot \left(t - 1\right) \]
            12. +-commutativeN/A

              \[\leadsto \left(z \cdot \left(1 - y\right) + x\right) - \color{blue}{a} \cdot \left(t - 1\right) \]
            13. sub-negate-revN/A

              \[\leadsto \left(z \cdot \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) + x\right) - a \cdot \left(t - 1\right) \]
            14. mul-1-negN/A

              \[\leadsto \left(z \cdot \left(-1 \cdot \left(y - 1\right)\right) + x\right) - a \cdot \left(t - 1\right) \]
            15. *-commutativeN/A

              \[\leadsto \left(\left(-1 \cdot \left(y - 1\right)\right) \cdot z + x\right) - a \cdot \left(t - 1\right) \]
            16. lower-fma.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\left(y - 1\right)\right), z, x\right) - a \cdot \left(t - 1\right) \]
            18. sub-negate-revN/A

              \[\leadsto \mathsf{fma}\left(1 - y, z, x\right) - a \cdot \left(t - 1\right) \]
            19. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(1 - y, z, x\right) - a \cdot \left(t - 1\right) \]
          4. Applied rewrites84.0%

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

          if 1.9000000000000001e83 < b

          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. Taylor expanded in x around inf

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

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

          Alternative 6: 71.9% accurate, 1.4× speedup?

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

            1. Initial program 90.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. Taylor expanded in x around inf

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

                \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]

              if -4.80000000000000021e93 < b < 3.4e9

              1. Initial program 98.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. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x + \left(\left(\left(-1 \cdot y\right) \cdot z + z\right) - a \cdot \left(t - 1\right)\right) \]
                4. lower-fma.f64N/A

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

                  \[\leadsto x + \left(\mathsf{fma}\left(\mathsf{neg}\left(y\right), z, z\right) - a \cdot \left(t - 1\right)\right) \]
                6. lower-neg.f64N/A

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

                  \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - \color{blue}{1}\right)\right) \]
                8. lift--.f6487.9

                  \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - 1\right)\right) \]
              7. Applied rewrites87.9%

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

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

                  \[\leadsto x + \left(z - a \cdot \left(\color{blue}{t} - 1\right)\right) \]
              10. Recombined 2 regimes into one program.
              11. Add Preprocessing

              Alternative 7: 68.7% accurate, 1.5× speedup?

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

                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. Taylor expanded in b around inf

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

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

                    \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                  3. lift--.f64N/A

                    \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                  4. lift-+.f64N/A

                    \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                  5. lift-*.f6477.7

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

                    \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                  7. +-commutativeN/A

                    \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                  8. lower-+.f6477.7

                    \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                4. Applied rewrites77.7%

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

                if -3.2999999999999998e95 < b < 1.06e11

                1. Initial program 98.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. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto x + \left(\left(\left(-1 \cdot y\right) \cdot z + z\right) - a \cdot \left(t - 1\right)\right) \]
                  4. lower-fma.f64N/A

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

                    \[\leadsto x + \left(\mathsf{fma}\left(\mathsf{neg}\left(y\right), z, z\right) - a \cdot \left(t - 1\right)\right) \]
                  6. lower-neg.f64N/A

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

                    \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - \color{blue}{1}\right)\right) \]
                  8. lift--.f6487.8

                    \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - 1\right)\right) \]
                7. Applied rewrites87.8%

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

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

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

                  if 1.06e11 < b

                  1. Initial program 90.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. Taylor expanded in b around inf

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

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    3. lift--.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    4. lift-+.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    5. lift-*.f6466.5

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    7. +-commutativeN/A

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    8. lower-+.f6466.5

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                  4. Applied rewrites66.5%

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

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

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    3. lift--.f64N/A

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    4. *-commutativeN/A

                      \[\leadsto b \cdot \color{blue}{\left(\left(t + y\right) - 2\right)} \]
                    5. +-commutativeN/A

                      \[\leadsto b \cdot \left(\left(y + t\right) - 2\right) \]
                    6. associate--l+N/A

                      \[\leadsto b \cdot \left(y + \color{blue}{\left(t - 2\right)}\right) \]
                    7. distribute-lft-outN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(t - 2, \color{blue}{b}, b \cdot y\right) \]
                    11. lift--.f64N/A

                      \[\leadsto \mathsf{fma}\left(t - 2, b, b \cdot y\right) \]
                    12. lift-*.f6464.4

                      \[\leadsto \mathsf{fma}\left(t - 2, b, b \cdot y\right) \]
                  6. Applied rewrites64.4%

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

                Alternative 8: 62.4% accurate, 1.7× speedup?

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

                  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. Taylor expanded in b around inf

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

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    3. lift--.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    4. lift-+.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    5. lift-*.f6470.2

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    7. +-commutativeN/A

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    8. lower-+.f6470.2

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                  4. Applied rewrites70.2%

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

                  if -2.6000000000000001e88 < b < 0.819999999999999951

                  1. Initial program 98.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. 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)} \]
                  3. Step-by-step derivation
                    1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto x + \left(1 + -1 \cdot t\right) \cdot a \]
                    2. mul-1-negN/A

                      \[\leadsto x + \left(1 + \left(\mathsf{neg}\left(t\right)\right)\right) \cdot a \]
                    3. sub-flipN/A

                      \[\leadsto x + \left(1 - t\right) \cdot a \]
                    4. sub-negate-revN/A

                      \[\leadsto x + \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                    5. mul-1-negN/A

                      \[\leadsto x + \left(-1 \cdot \left(t - 1\right)\right) \cdot a \]
                    6. lower-*.f64N/A

                      \[\leadsto x + \left(-1 \cdot \left(t - 1\right)\right) \cdot a \]
                    7. mul-1-negN/A

                      \[\leadsto x + \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                    8. sub-negate-revN/A

                      \[\leadsto x + \left(1 - t\right) \cdot a \]
                    9. lower--.f6456.3

                      \[\leadsto x + \left(1 - t\right) \cdot a \]
                  7. Applied rewrites56.3%

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

                Alternative 9: 61.8% accurate, 1.5× speedup?

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

                  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. Taylor expanded in b around inf

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

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    3. lift--.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    4. lift-+.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    5. lift-*.f6476.9

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    7. +-commutativeN/A

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    8. lower-+.f6476.9

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                  4. Applied rewrites76.9%

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

                  if -2.6000000000000001e88 < b < 0.819999999999999951

                  1. Initial program 98.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. 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)} \]
                  3. Step-by-step derivation
                    1. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto x + \left(1 + -1 \cdot t\right) \cdot a \]
                    2. mul-1-negN/A

                      \[\leadsto x + \left(1 + \left(\mathsf{neg}\left(t\right)\right)\right) \cdot a \]
                    3. sub-flipN/A

                      \[\leadsto x + \left(1 - t\right) \cdot a \]
                    4. sub-negate-revN/A

                      \[\leadsto x + \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                    5. mul-1-negN/A

                      \[\leadsto x + \left(-1 \cdot \left(t - 1\right)\right) \cdot a \]
                    6. lower-*.f64N/A

                      \[\leadsto x + \left(-1 \cdot \left(t - 1\right)\right) \cdot a \]
                    7. mul-1-negN/A

                      \[\leadsto x + \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                    8. sub-negate-revN/A

                      \[\leadsto x + \left(1 - t\right) \cdot a \]
                    9. lower--.f6456.3

                      \[\leadsto x + \left(1 - t\right) \cdot a \]
                  7. Applied rewrites56.3%

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

                  if 0.819999999999999951 < b

                  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. Taylor expanded in b around inf

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

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    3. lift--.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    4. lift-+.f64N/A

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    5. lift-*.f6465.6

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

                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                    7. +-commutativeN/A

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    8. lower-+.f6465.6

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                  4. Applied rewrites65.6%

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

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

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    3. lift--.f64N/A

                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                    4. *-commutativeN/A

                      \[\leadsto b \cdot \color{blue}{\left(\left(t + y\right) - 2\right)} \]
                    5. +-commutativeN/A

                      \[\leadsto b \cdot \left(\left(y + t\right) - 2\right) \]
                    6. associate--l+N/A

                      \[\leadsto b \cdot \left(y + \color{blue}{\left(t - 2\right)}\right) \]
                    7. distribute-lft-outN/A

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

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

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

                      \[\leadsto \mathsf{fma}\left(t - 2, \color{blue}{b}, b \cdot y\right) \]
                    11. lift--.f64N/A

                      \[\leadsto \mathsf{fma}\left(t - 2, b, b \cdot y\right) \]
                    12. lift-*.f6463.6

                      \[\leadsto \mathsf{fma}\left(t - 2, b, b \cdot y\right) \]
                  6. Applied rewrites63.6%

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

                Alternative 10: 57.3% accurate, 1.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -680000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.45 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+137}:\\ \;\;\;\;x + \left(-a\right) \cdot t\\ \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 -680000000.0)
                     t_1
                     (if (<= t 3.45e+19)
                       (fma (- y 2.0) b x)
                       (if (<= t 4.5e+137) (+ x (* (- a) t)) 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 <= -680000000.0) {
                		tmp = t_1;
                	} else if (t <= 3.45e+19) {
                		tmp = fma((y - 2.0), b, x);
                	} else if (t <= 4.5e+137) {
                		tmp = x + (-a * t);
                	} 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 <= -680000000.0)
                		tmp = t_1;
                	elseif (t <= 3.45e+19)
                		tmp = fma(Float64(y - 2.0), b, x);
                	elseif (t <= 4.5e+137)
                		tmp = Float64(x + Float64(Float64(-a) * t));
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -680000000.0], t$95$1, If[LessEqual[t, 3.45e+19], N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision], If[LessEqual[t, 4.5e+137], N[(x + N[((-a) * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_1 := \left(b - a\right) \cdot t\\
                \mathbf{if}\;t \leq -680000000:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;t \leq 3.45 \cdot 10^{+19}:\\
                \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right)\\
                
                \mathbf{elif}\;t \leq 4.5 \cdot 10^{+137}:\\
                \;\;\;\;x + \left(-a\right) \cdot t\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if t < -6.8e8 or 4.5000000000000001e137 < t

                  1. Initial program 92.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. Taylor expanded in t around inf

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

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

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

                      \[\leadsto \left(b - a\right) \cdot t \]
                  4. Applied rewrites69.7%

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

                  if -6.8e8 < t < 3.45e19

                  1. Initial program 97.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. Taylor expanded in x around inf

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

                      \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]
                    2. Taylor expanded in y around inf

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

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

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

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

                          \[\leadsto \color{blue}{\left(y - 2\right) \cdot b} + x \]
                        4. lower-fma.f6451.2

                          \[\leadsto \color{blue}{\mathsf{fma}\left(y - 2, b, x\right)} \]
                      3. Applied rewrites51.2%

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

                      if 3.45e19 < t < 4.5000000000000001e137

                      1. Initial program 96.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. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto x + \left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) - \mathsf{fma}\left(t - 1, a, \mathsf{neg}\left(z\right)\right)\right) \]
                        16. lower-neg.f6495.3

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

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

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

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

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

                          \[\leadsto x + \left(\left(\left(-1 \cdot y\right) \cdot z + z\right) - a \cdot \left(t - 1\right)\right) \]
                        4. lower-fma.f64N/A

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

                          \[\leadsto x + \left(\mathsf{fma}\left(\mathsf{neg}\left(y\right), z, z\right) - a \cdot \left(t - 1\right)\right) \]
                        6. lower-neg.f64N/A

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

                          \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - \color{blue}{1}\right)\right) \]
                        8. lift--.f6465.6

                          \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - 1\right)\right) \]
                      7. Applied rewrites65.6%

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

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

                          \[\leadsto x + \left(-1 \cdot a\right) \cdot t \]
                        2. lower-*.f64N/A

                          \[\leadsto x + \left(-1 \cdot a\right) \cdot t \]
                        3. mul-1-negN/A

                          \[\leadsto x + \left(\mathsf{neg}\left(a\right)\right) \cdot t \]
                        4. lower-neg.f6440.5

                          \[\leadsto x + \left(-a\right) \cdot t \]
                      10. Applied rewrites40.5%

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

                    Alternative 11: 51.6% accurate, 1.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -265000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{+25}:\\ \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+137}:\\ \;\;\;\;x + \left(-a\right) \cdot t\\ \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 -265000000.0)
                         t_1
                         (if (<= t 1.7e+25)
                           (fma y b x)
                           (if (<= t 4.5e+137) (+ x (* (- a) t)) 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 <= -265000000.0) {
                    		tmp = t_1;
                    	} else if (t <= 1.7e+25) {
                    		tmp = fma(y, b, x);
                    	} else if (t <= 4.5e+137) {
                    		tmp = x + (-a * t);
                    	} 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 <= -265000000.0)
                    		tmp = t_1;
                    	elseif (t <= 1.7e+25)
                    		tmp = fma(y, b, x);
                    	elseif (t <= 4.5e+137)
                    		tmp = Float64(x + Float64(Float64(-a) * t));
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -265000000.0], t$95$1, If[LessEqual[t, 1.7e+25], N[(y * b + x), $MachinePrecision], If[LessEqual[t, 4.5e+137], N[(x + N[((-a) * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_1 := \left(b - a\right) \cdot t\\
                    \mathbf{if}\;t \leq -265000000:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;t \leq 1.7 \cdot 10^{+25}:\\
                    \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
                    
                    \mathbf{elif}\;t \leq 4.5 \cdot 10^{+137}:\\
                    \;\;\;\;x + \left(-a\right) \cdot t\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if t < -2.65e8 or 4.5000000000000001e137 < t

                      1. Initial program 92.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. Taylor expanded in t around inf

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

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

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

                          \[\leadsto \left(b - a\right) \cdot t \]
                      4. Applied rewrites69.7%

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

                      if -2.65e8 < t < 1.69999999999999992e25

                      1. Initial program 97.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. Taylor expanded in x around inf

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

                          \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]
                        2. Taylor expanded in y around inf

                          \[\leadsto x + \color{blue}{y} \cdot b \]
                        3. Step-by-step derivation
                          1. Applied rewrites39.3%

                            \[\leadsto x + \color{blue}{y} \cdot b \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \color{blue}{x + y \cdot b} \]
                            2. +-commutativeN/A

                              \[\leadsto \color{blue}{y \cdot b + x} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{y \cdot b} + x \]
                            4. lower-fma.f6439.3

                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, b, x\right)} \]
                          3. Applied rewrites39.3%

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

                          if 1.69999999999999992e25 < t < 4.5000000000000001e137

                          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. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto x + \left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) - \mathsf{fma}\left(t - 1, a, \mathsf{neg}\left(z\right)\right)\right) \]
                            16. lower-neg.f6495.0

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

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

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

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

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

                              \[\leadsto x + \left(\left(\left(-1 \cdot y\right) \cdot z + z\right) - a \cdot \left(t - 1\right)\right) \]
                            4. lower-fma.f64N/A

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

                              \[\leadsto x + \left(\mathsf{fma}\left(\mathsf{neg}\left(y\right), z, z\right) - a \cdot \left(t - 1\right)\right) \]
                            6. lower-neg.f64N/A

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

                              \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot \left(t - \color{blue}{1}\right)\right) \]
                            8. lift--.f6465.2

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

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

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

                              \[\leadsto x + \left(-1 \cdot a\right) \cdot t \]
                            2. lower-*.f64N/A

                              \[\leadsto x + \left(-1 \cdot a\right) \cdot t \]
                            3. mul-1-negN/A

                              \[\leadsto x + \left(\mathsf{neg}\left(a\right)\right) \cdot t \]
                            4. lower-neg.f6440.4

                              \[\leadsto x + \left(-a\right) \cdot t \]
                          10. Applied rewrites40.4%

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

                        Alternative 12: 51.2% accurate, 2.0× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -265000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.35 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\ \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 -265000000.0) t_1 (if (<= t 2.35e+70) (fma y b x) 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 <= -265000000.0) {
                        		tmp = t_1;
                        	} else if (t <= 2.35e+70) {
                        		tmp = fma(y, b, x);
                        	} 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 <= -265000000.0)
                        		tmp = t_1;
                        	elseif (t <= 2.35e+70)
                        		tmp = fma(y, b, x);
                        	else
                        		tmp = t_1;
                        	end
                        	return tmp
                        end
                        
                        code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -265000000.0], t$95$1, If[LessEqual[t, 2.35e+70], N[(y * b + x), $MachinePrecision], t$95$1]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_1 := \left(b - a\right) \cdot t\\
                        \mathbf{if}\;t \leq -265000000:\\
                        \;\;\;\;t\_1\\
                        
                        \mathbf{elif}\;t \leq 2.35 \cdot 10^{+70}:\\
                        \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if t < -2.65e8 or 2.3499999999999999e70 < t

                          1. Initial program 92.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. Taylor expanded in t around inf

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

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

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

                              \[\leadsto \left(b - a\right) \cdot t \]
                          4. Applied rewrites67.5%

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

                          if -2.65e8 < t < 2.3499999999999999e70

                          1. Initial program 97.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. Taylor expanded in x around inf

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

                              \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]
                            2. Taylor expanded in y around inf

                              \[\leadsto x + \color{blue}{y} \cdot b \]
                            3. Step-by-step derivation
                              1. Applied rewrites39.0%

                                \[\leadsto x + \color{blue}{y} \cdot b \]
                              2. Step-by-step derivation
                                1. lift-+.f64N/A

                                  \[\leadsto \color{blue}{x + y \cdot b} \]
                                2. +-commutativeN/A

                                  \[\leadsto \color{blue}{y \cdot b + x} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \color{blue}{y \cdot b} + x \]
                                4. lower-fma.f6439.0

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(y, b, x\right)} \]
                              3. Applied rewrites39.0%

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

                            Alternative 13: 45.2% accurate, 1.6× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - y\right) \cdot z\\ \mathbf{if}\;z \leq -1.15 \cdot 10^{+150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{-59}:\\ \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\ \mathbf{elif}\;z \leq 5.3 \cdot 10^{+181}:\\ \;\;\;\;\left(1 - t\right) \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                            (FPCore (x y z t a b)
                             :precision binary64
                             (let* ((t_1 (* (- 1.0 y) z)))
                               (if (<= z -1.15e+150)
                                 t_1
                                 (if (<= z 1.5e-59)
                                   (fma y b x)
                                   (if (<= z 5.3e+181) (* (- 1.0 t) a) t_1)))))
                            double code(double x, double y, double z, double t, double a, double b) {
                            	double t_1 = (1.0 - y) * z;
                            	double tmp;
                            	if (z <= -1.15e+150) {
                            		tmp = t_1;
                            	} else if (z <= 1.5e-59) {
                            		tmp = fma(y, b, x);
                            	} else if (z <= 5.3e+181) {
                            		tmp = (1.0 - t) * a;
                            	} else {
                            		tmp = t_1;
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, t, a, b)
                            	t_1 = Float64(Float64(1.0 - y) * z)
                            	tmp = 0.0
                            	if (z <= -1.15e+150)
                            		tmp = t_1;
                            	elseif (z <= 1.5e-59)
                            		tmp = fma(y, b, x);
                            	elseif (z <= 5.3e+181)
                            		tmp = Float64(Float64(1.0 - t) * a);
                            	else
                            		tmp = t_1;
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.15e+150], t$95$1, If[LessEqual[z, 1.5e-59], N[(y * b + x), $MachinePrecision], If[LessEqual[z, 5.3e+181], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_1 := \left(1 - y\right) \cdot z\\
                            \mathbf{if}\;z \leq -1.15 \cdot 10^{+150}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;z \leq 1.5 \cdot 10^{-59}:\\
                            \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
                            
                            \mathbf{elif}\;z \leq 5.3 \cdot 10^{+181}:\\
                            \;\;\;\;\left(1 - t\right) \cdot a\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_1\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if z < -1.15000000000000001e150 or 5.2999999999999996e181 < z

                              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. Taylor expanded in z around inf

                                \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
                              3. Step-by-step derivation
                                1. sub-negate-revN/A

                                  \[\leadsto z \cdot \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) \]
                                2. mul-1-negN/A

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

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

                                  \[\leadsto \left(-1 \cdot \left(y - 1\right)\right) \cdot \color{blue}{z} \]
                                5. mul-1-negN/A

                                  \[\leadsto \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) \cdot z \]
                                6. sub-negate-revN/A

                                  \[\leadsto \left(1 - y\right) \cdot z \]
                                7. lower--.f6469.4

                                  \[\leadsto \left(1 - y\right) \cdot z \]
                              4. Applied rewrites69.4%

                                \[\leadsto \color{blue}{\left(1 - y\right) \cdot z} \]

                              if -1.15000000000000001e150 < z < 1.5e-59

                              1. Initial program 97.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. Taylor expanded in x around inf

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

                                  \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]
                                2. Taylor expanded in y around inf

                                  \[\leadsto x + \color{blue}{y} \cdot b \]
                                3. Step-by-step derivation
                                  1. Applied rewrites38.9%

                                    \[\leadsto x + \color{blue}{y} \cdot b \]
                                  2. Step-by-step derivation
                                    1. lift-+.f64N/A

                                      \[\leadsto \color{blue}{x + y \cdot b} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \color{blue}{y \cdot b + x} \]
                                    3. lift-*.f64N/A

                                      \[\leadsto \color{blue}{y \cdot b} + x \]
                                    4. lower-fma.f6438.9

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(y, b, x\right)} \]
                                  3. Applied rewrites38.9%

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

                                  if 1.5e-59 < z < 5.2999999999999996e181

                                  1. Initial program 94.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. Taylor expanded in a around inf

                                    \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                  3. Step-by-step derivation
                                    1. sub-negate-revN/A

                                      \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \]
                                    2. mul-1-negN/A

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

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

                                      \[\leadsto \left(-1 \cdot \left(t - 1\right)\right) \cdot \color{blue}{a} \]
                                    5. mul-1-negN/A

                                      \[\leadsto \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                                    6. sub-negate-revN/A

                                      \[\leadsto \left(1 - t\right) \cdot a \]
                                    7. lower--.f6428.4

                                      \[\leadsto \left(1 - t\right) \cdot a \]
                                  4. Applied rewrites28.4%

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

                                Alternative 14: 44.0% accurate, 2.0× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - t\right) \cdot a\\ \mathbf{if}\;a \leq -5.1 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\ \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 -5.1e+14) t_1 (if (<= a 3.2e+71) (fma y b x) 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 <= -5.1e+14) {
                                		tmp = t_1;
                                	} else if (a <= 3.2e+71) {
                                		tmp = fma(y, b, x);
                                	} 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 <= -5.1e+14)
                                		tmp = t_1;
                                	elseif (a <= 3.2e+71)
                                		tmp = fma(y, b, x);
                                	else
                                		tmp = t_1;
                                	end
                                	return tmp
                                end
                                
                                code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -5.1e+14], t$95$1, If[LessEqual[a, 3.2e+71], N[(y * b + x), $MachinePrecision], t$95$1]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_1 := \left(1 - t\right) \cdot a\\
                                \mathbf{if}\;a \leq -5.1 \cdot 10^{+14}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;a \leq 3.2 \cdot 10^{+71}:\\
                                \;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_1\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if a < -5.1e14 or 3.20000000000000023e71 < a

                                  1. Initial program 92.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. Taylor expanded in a around inf

                                    \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                  3. Step-by-step derivation
                                    1. sub-negate-revN/A

                                      \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \]
                                    2. mul-1-negN/A

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

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

                                      \[\leadsto \left(-1 \cdot \left(t - 1\right)\right) \cdot \color{blue}{a} \]
                                    5. mul-1-negN/A

                                      \[\leadsto \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                                    6. sub-negate-revN/A

                                      \[\leadsto \left(1 - t\right) \cdot a \]
                                    7. lower--.f6454.4

                                      \[\leadsto \left(1 - t\right) \cdot a \]
                                  4. Applied rewrites54.4%

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

                                  if -5.1e14 < a < 3.20000000000000023e71

                                  1. Initial program 98.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. Taylor expanded in x around inf

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

                                      \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]
                                    2. Taylor expanded in y around inf

                                      \[\leadsto x + \color{blue}{y} \cdot b \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites38.1%

                                        \[\leadsto x + \color{blue}{y} \cdot b \]
                                      2. Step-by-step derivation
                                        1. lift-+.f64N/A

                                          \[\leadsto \color{blue}{x + y \cdot b} \]
                                        2. +-commutativeN/A

                                          \[\leadsto \color{blue}{y \cdot b + x} \]
                                        3. lift-*.f64N/A

                                          \[\leadsto \color{blue}{y \cdot b} + x \]
                                        4. lower-fma.f6438.1

                                          \[\leadsto \color{blue}{\mathsf{fma}\left(y, b, x\right)} \]
                                      3. Applied rewrites38.1%

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

                                    Alternative 15: 39.0% accurate, 2.1× speedup?

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

                                      1. Initial program 92.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. Taylor expanded in t around inf

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

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

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

                                          \[\leadsto \left(b - a\right) \cdot t \]
                                      4. Applied rewrites71.8%

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

                                        \[\leadsto \left(-1 \cdot a\right) \cdot t \]
                                      6. Step-by-step derivation
                                        1. mul-1-negN/A

                                          \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot t \]
                                        2. lower-neg.f6441.2

                                          \[\leadsto \left(-a\right) \cdot t \]
                                      7. Applied rewrites41.2%

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

                                      if -3.2000000000000002e70 < t < 8.19999999999999994e137

                                      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. Taylor expanded in x around inf

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

                                          \[\leadsto \color{blue}{x} + \left(\left(y + t\right) - 2\right) \cdot b \]
                                        2. Taylor expanded in y around inf

                                          \[\leadsto x + \color{blue}{y} \cdot b \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites37.8%

                                            \[\leadsto x + \color{blue}{y} \cdot b \]
                                          2. Step-by-step derivation
                                            1. lift-+.f64N/A

                                              \[\leadsto \color{blue}{x + y \cdot b} \]
                                            2. +-commutativeN/A

                                              \[\leadsto \color{blue}{y \cdot b + x} \]
                                            3. lift-*.f64N/A

                                              \[\leadsto \color{blue}{y \cdot b} + x \]
                                            4. lower-fma.f6437.8

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(y, b, x\right)} \]
                                          3. Applied rewrites37.8%

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

                                          if 8.19999999999999994e137 < t

                                          1. Initial program 89.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. Taylor expanded in b around inf

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

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

                                              \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                            3. lift--.f64N/A

                                              \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                            4. lift-+.f64N/A

                                              \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                            5. lift-*.f6444.7

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

                                              \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                            7. +-commutativeN/A

                                              \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                            8. lower-+.f6444.7

                                              \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                          4. Applied rewrites44.7%

                                            \[\leadsto \color{blue}{\left(\left(t + y\right) - 2\right) \cdot b} \]
                                          5. Taylor expanded in t around inf

                                            \[\leadsto t \cdot b \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites41.2%

                                              \[\leadsto t \cdot b \]
                                          7. Recombined 3 regimes into one program.
                                          8. Add Preprocessing

                                          Alternative 16: 27.7% accurate, 1.5× speedup?

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

                                            1. Initial program 92.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. Taylor expanded in t around inf

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

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

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

                                                \[\leadsto \left(b - a\right) \cdot t \]
                                            4. Applied rewrites72.8%

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

                                              \[\leadsto \left(-1 \cdot a\right) \cdot t \]
                                            6. Step-by-step derivation
                                              1. mul-1-negN/A

                                                \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot t \]
                                              2. lower-neg.f6441.6

                                                \[\leadsto \left(-a\right) \cdot t \]
                                            7. Applied rewrites41.6%

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

                                            if -1.7499999999999999e75 < t < 6.60000000000000004e-222

                                            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. Taylor expanded in y around inf

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

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

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

                                                \[\leadsto \left(b - z\right) \cdot y \]
                                            4. Applied rewrites39.7%

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

                                              \[\leadsto b \cdot y \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites22.0%

                                                \[\leadsto b \cdot y \]

                                              if 6.60000000000000004e-222 < t < 6.4000000000000002e-12

                                              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. Taylor expanded in a around inf

                                                \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                              3. Step-by-step derivation
                                                1. sub-negate-revN/A

                                                  \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \]
                                                2. mul-1-negN/A

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

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

                                                  \[\leadsto \left(-1 \cdot \left(t - 1\right)\right) \cdot \color{blue}{a} \]
                                                5. mul-1-negN/A

                                                  \[\leadsto \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                                                6. sub-negate-revN/A

                                                  \[\leadsto \left(1 - t\right) \cdot a \]
                                                7. lower--.f6419.9

                                                  \[\leadsto \left(1 - t\right) \cdot a \]
                                              4. Applied rewrites19.9%

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

                                                \[\leadsto a \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites19.8%

                                                  \[\leadsto a \]

                                                if 6.4000000000000002e-12 < t < 7.5999999999999996e107

                                                1. Initial program 97.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. Taylor expanded in x around inf

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

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

                                                  if 7.5999999999999996e107 < 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. Taylor expanded in b around inf

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

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

                                                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                    3. lift--.f64N/A

                                                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                    4. lift-+.f64N/A

                                                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                    5. lift-*.f6444.1

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

                                                      \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                    7. +-commutativeN/A

                                                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                    8. lower-+.f6444.1

                                                      \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                  4. Applied rewrites44.1%

                                                    \[\leadsto \color{blue}{\left(\left(t + y\right) - 2\right) \cdot b} \]
                                                  5. Taylor expanded in t around inf

                                                    \[\leadsto t \cdot b \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites39.4%

                                                      \[\leadsto t \cdot b \]
                                                  7. Recombined 5 regimes into one program.
                                                  8. Add Preprocessing

                                                  Alternative 17: 26.3% accurate, 1.5× speedup?

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

                                                    1. Initial program 92.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. Taylor expanded in b around inf

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

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

                                                        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                      3. lift--.f64N/A

                                                        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                      4. lift-+.f64N/A

                                                        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                      5. lift-*.f6441.3

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

                                                        \[\leadsto \left(\left(y + t\right) - 2\right) \cdot b \]
                                                      7. +-commutativeN/A

                                                        \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                      8. lower-+.f6441.3

                                                        \[\leadsto \left(\left(t + y\right) - 2\right) \cdot b \]
                                                    4. Applied rewrites41.3%

                                                      \[\leadsto \color{blue}{\left(\left(t + y\right) - 2\right) \cdot b} \]
                                                    5. Taylor expanded in t around inf

                                                      \[\leadsto t \cdot b \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites33.5%

                                                        \[\leadsto t \cdot b \]

                                                      if -2.3000000000000001e-32 < t < 6.60000000000000004e-222

                                                      1. Initial program 97.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. Taylor expanded in y around inf

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

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

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

                                                          \[\leadsto \left(b - z\right) \cdot y \]
                                                      4. Applied rewrites39.9%

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

                                                        \[\leadsto b \cdot y \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites22.5%

                                                          \[\leadsto b \cdot y \]

                                                        if 6.60000000000000004e-222 < t < 6.4000000000000002e-12

                                                        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. Taylor expanded in a around inf

                                                          \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                        3. Step-by-step derivation
                                                          1. sub-negate-revN/A

                                                            \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \]
                                                          2. mul-1-negN/A

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

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

                                                            \[\leadsto \left(-1 \cdot \left(t - 1\right)\right) \cdot \color{blue}{a} \]
                                                          5. mul-1-negN/A

                                                            \[\leadsto \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                                                          6. sub-negate-revN/A

                                                            \[\leadsto \left(1 - t\right) \cdot a \]
                                                          7. lower--.f6419.9

                                                            \[\leadsto \left(1 - t\right) \cdot a \]
                                                        4. Applied rewrites19.9%

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

                                                          \[\leadsto a \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites19.8%

                                                            \[\leadsto a \]

                                                          if 6.4000000000000002e-12 < t < 7.5999999999999996e107

                                                          1. Initial program 97.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. Taylor expanded in x around inf

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

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

                                                          Alternative 18: 26.2% accurate, 1.9× speedup?

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

                                                            1. Initial program 92.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. Taylor expanded in y around inf

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

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

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

                                                                \[\leadsto \left(b - z\right) \cdot y \]
                                                            4. Applied rewrites68.1%

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

                                                              \[\leadsto b \cdot y \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites36.8%

                                                                \[\leadsto b \cdot y \]

                                                              if -1.35000000000000002e48 < y < -9.19999999999999979e-218

                                                              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. Taylor expanded in z around inf

                                                                \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
                                                              3. Step-by-step derivation
                                                                1. sub-negate-revN/A

                                                                  \[\leadsto z \cdot \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) \]
                                                                2. mul-1-negN/A

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

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

                                                                  \[\leadsto \left(-1 \cdot \left(y - 1\right)\right) \cdot \color{blue}{z} \]
                                                                5. mul-1-negN/A

                                                                  \[\leadsto \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) \cdot z \]
                                                                6. sub-negate-revN/A

                                                                  \[\leadsto \left(1 - y\right) \cdot z \]
                                                                7. lower--.f6420.5

                                                                  \[\leadsto \left(1 - y\right) \cdot z \]
                                                              4. Applied rewrites20.5%

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

                                                                \[\leadsto z \]
                                                              6. Step-by-step derivation
                                                                1. Applied rewrites17.0%

                                                                  \[\leadsto z \]

                                                                if -9.19999999999999979e-218 < y < 3e39

                                                                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. Taylor expanded in x around inf

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

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

                                                                Alternative 19: 20.3% accurate, 2.3× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+150}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-60}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+96}:\\ \;\;\;\;a\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
                                                                (FPCore (x y z t a b)
                                                                 :precision binary64
                                                                 (if (<= z -1.4e+150) z (if (<= z 6e-60) x (if (<= z 4.5e+96) a z))))
                                                                double code(double x, double y, double z, double t, double a, double b) {
                                                                	double tmp;
                                                                	if (z <= -1.4e+150) {
                                                                		tmp = z;
                                                                	} else if (z <= 6e-60) {
                                                                		tmp = x;
                                                                	} else if (z <= 4.5e+96) {
                                                                		tmp = a;
                                                                	} else {
                                                                		tmp = z;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                module fmin_fmax_functions
                                                                    implicit none
                                                                    private
                                                                    public fmax
                                                                    public fmin
                                                                
                                                                    interface fmax
                                                                        module procedure fmax88
                                                                        module procedure fmax44
                                                                        module procedure fmax84
                                                                        module procedure fmax48
                                                                    end interface
                                                                    interface fmin
                                                                        module procedure fmin88
                                                                        module procedure fmin44
                                                                        module procedure fmin84
                                                                        module procedure fmin48
                                                                    end interface
                                                                contains
                                                                    real(8) function fmax88(x, y) result (res)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(4) function fmax44(x, y) result (res)
                                                                        real(4), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmax84(x, y) result(res)
                                                                        real(8), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmax48(x, y) result(res)
                                                                        real(4), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin88(x, y) result (res)
                                                                        real(8), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(4) function fmin44(x, y) result (res)
                                                                        real(4), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin84(x, y) result(res)
                                                                        real(8), intent (in) :: x
                                                                        real(4), intent (in) :: y
                                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                    end function
                                                                    real(8) function fmin48(x, y) result(res)
                                                                        real(4), intent (in) :: x
                                                                        real(8), intent (in) :: y
                                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                    end function
                                                                end module
                                                                
                                                                real(8) function code(x, y, z, t, a, b)
                                                                use fmin_fmax_functions
                                                                    real(8), intent (in) :: x
                                                                    real(8), intent (in) :: y
                                                                    real(8), intent (in) :: z
                                                                    real(8), intent (in) :: t
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8) :: tmp
                                                                    if (z <= (-1.4d+150)) then
                                                                        tmp = z
                                                                    else if (z <= 6d-60) then
                                                                        tmp = x
                                                                    else if (z <= 4.5d+96) then
                                                                        tmp = a
                                                                    else
                                                                        tmp = z
                                                                    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 <= -1.4e+150) {
                                                                		tmp = z;
                                                                	} else if (z <= 6e-60) {
                                                                		tmp = x;
                                                                	} else if (z <= 4.5e+96) {
                                                                		tmp = a;
                                                                	} else {
                                                                		tmp = z;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(x, y, z, t, a, b):
                                                                	tmp = 0
                                                                	if z <= -1.4e+150:
                                                                		tmp = z
                                                                	elif z <= 6e-60:
                                                                		tmp = x
                                                                	elif z <= 4.5e+96:
                                                                		tmp = a
                                                                	else:
                                                                		tmp = z
                                                                	return tmp
                                                                
                                                                function code(x, y, z, t, a, b)
                                                                	tmp = 0.0
                                                                	if (z <= -1.4e+150)
                                                                		tmp = z;
                                                                	elseif (z <= 6e-60)
                                                                		tmp = x;
                                                                	elseif (z <= 4.5e+96)
                                                                		tmp = a;
                                                                	else
                                                                		tmp = z;
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(x, y, z, t, a, b)
                                                                	tmp = 0.0;
                                                                	if (z <= -1.4e+150)
                                                                		tmp = z;
                                                                	elseif (z <= 6e-60)
                                                                		tmp = x;
                                                                	elseif (z <= 4.5e+96)
                                                                		tmp = a;
                                                                	else
                                                                		tmp = z;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.4e+150], z, If[LessEqual[z, 6e-60], x, If[LessEqual[z, 4.5e+96], a, z]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;z \leq -1.4 \cdot 10^{+150}:\\
                                                                \;\;\;\;z\\
                                                                
                                                                \mathbf{elif}\;z \leq 6 \cdot 10^{-60}:\\
                                                                \;\;\;\;x\\
                                                                
                                                                \mathbf{elif}\;z \leq 4.5 \cdot 10^{+96}:\\
                                                                \;\;\;\;a\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;z\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 3 regimes
                                                                2. if z < -1.40000000000000005e150 or 4.49999999999999957e96 < z

                                                                  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. Taylor expanded in z around inf

                                                                    \[\leadsto \color{blue}{z \cdot \left(1 - y\right)} \]
                                                                  3. Step-by-step derivation
                                                                    1. sub-negate-revN/A

                                                                      \[\leadsto z \cdot \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) \]
                                                                    2. mul-1-negN/A

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

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

                                                                      \[\leadsto \left(-1 \cdot \left(y - 1\right)\right) \cdot \color{blue}{z} \]
                                                                    5. mul-1-negN/A

                                                                      \[\leadsto \left(\mathsf{neg}\left(\left(y - 1\right)\right)\right) \cdot z \]
                                                                    6. sub-negate-revN/A

                                                                      \[\leadsto \left(1 - y\right) \cdot z \]
                                                                    7. lower--.f6463.6

                                                                      \[\leadsto \left(1 - y\right) \cdot z \]
                                                                  4. Applied rewrites63.6%

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

                                                                    \[\leadsto z \]
                                                                  6. Step-by-step derivation
                                                                    1. Applied rewrites24.9%

                                                                      \[\leadsto z \]

                                                                    if -1.40000000000000005e150 < z < 6.00000000000000038e-60

                                                                    1. Initial program 97.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. Taylor expanded in x around inf

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

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

                                                                      if 6.00000000000000038e-60 < z < 4.49999999999999957e96

                                                                      1. Initial program 96.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. Taylor expanded in a around inf

                                                                        \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                      3. Step-by-step derivation
                                                                        1. sub-negate-revN/A

                                                                          \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \]
                                                                        2. mul-1-negN/A

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

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

                                                                          \[\leadsto \left(-1 \cdot \left(t - 1\right)\right) \cdot \color{blue}{a} \]
                                                                        5. mul-1-negN/A

                                                                          \[\leadsto \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                                                                        6. sub-negate-revN/A

                                                                          \[\leadsto \left(1 - t\right) \cdot a \]
                                                                        7. lower--.f6431.7

                                                                          \[\leadsto \left(1 - t\right) \cdot a \]
                                                                      4. Applied rewrites31.7%

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

                                                                        \[\leadsto a \]
                                                                      6. Step-by-step derivation
                                                                        1. Applied rewrites12.0%

                                                                          \[\leadsto a \]
                                                                      7. Recombined 3 regimes into one program.
                                                                      8. Add Preprocessing

                                                                      Alternative 20: 19.8% accurate, 3.3× speedup?

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

                                                                        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. Taylor expanded in a around inf

                                                                          \[\leadsto \color{blue}{a \cdot \left(1 - t\right)} \]
                                                                        3. Step-by-step derivation
                                                                          1. sub-negate-revN/A

                                                                            \[\leadsto a \cdot \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \]
                                                                          2. mul-1-negN/A

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

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

                                                                            \[\leadsto \left(-1 \cdot \left(t - 1\right)\right) \cdot \color{blue}{a} \]
                                                                          5. mul-1-negN/A

                                                                            \[\leadsto \left(\mathsf{neg}\left(\left(t - 1\right)\right)\right) \cdot a \]
                                                                          6. sub-negate-revN/A

                                                                            \[\leadsto \left(1 - t\right) \cdot a \]
                                                                          7. lower--.f6466.4

                                                                            \[\leadsto \left(1 - t\right) \cdot a \]
                                                                        4. Applied rewrites66.4%

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

                                                                          \[\leadsto a \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites27.1%

                                                                            \[\leadsto a \]

                                                                          if -2.05000000000000002e245 < a < 1.8000000000000001e111

                                                                          1. Initial program 96.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. Taylor expanded in x around inf

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

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

                                                                          Alternative 21: 15.5% accurate, 28.4× speedup?

                                                                          \[\begin{array}{l} \\ x \end{array} \]
                                                                          (FPCore (x y z t a b) :precision binary64 x)
                                                                          double code(double x, double y, double z, double t, double a, double b) {
                                                                          	return x;
                                                                          }
                                                                          
                                                                          module fmin_fmax_functions
                                                                              implicit none
                                                                              private
                                                                              public fmax
                                                                              public fmin
                                                                          
                                                                              interface fmax
                                                                                  module procedure fmax88
                                                                                  module procedure fmax44
                                                                                  module procedure fmax84
                                                                                  module procedure fmax48
                                                                              end interface
                                                                              interface fmin
                                                                                  module procedure fmin88
                                                                                  module procedure fmin44
                                                                                  module procedure fmin84
                                                                                  module procedure fmin48
                                                                              end interface
                                                                          contains
                                                                              real(8) function fmax88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmax44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmin44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                          end module
                                                                          
                                                                          real(8) function code(x, y, z, 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
                                                                          end function
                                                                          
                                                                          public static double code(double x, double y, double z, double t, double a, double b) {
                                                                          	return x;
                                                                          }
                                                                          
                                                                          def code(x, y, z, t, a, b):
                                                                          	return x
                                                                          
                                                                          function code(x, y, z, t, a, b)
                                                                          	return x
                                                                          end
                                                                          
                                                                          function tmp = code(x, y, z, t, a, b)
                                                                          	tmp = x;
                                                                          end
                                                                          
                                                                          code[x_, y_, z_, t_, a_, b_] := x
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          x
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Initial program 95.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. Taylor expanded in x around inf

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

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

                                                                            Reproduce

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