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

Percentage Accurate: 94.9% → 97.7%
Time: 5.6s
Alternatives: 25
Speedup: 0.5×

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 25 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: 94.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 97.7% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(b - z\right) \cdot y\\


\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 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    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 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6433.1

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

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

Alternative 2: 90.8% accurate, 0.9× 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) + b \cdot y\\ \mathbf{if}\;y \leq -1.1 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 10^{+21}:\\ \;\;\;\;\mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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)) (* b y))))
   (if (<= y -1.1e+40)
     t_1
     (if (<= y 1e+21) (- (fma (- t 2.0) b x) (- (* a (- t 1.0)) z)) t_1))))
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)) + (b * y);
	double tmp;
	if (y <= -1.1e+40) {
		tmp = t_1;
	} else if (y <= 1e+21) {
		tmp = fma((t - 2.0), b, x) - ((a * (t - 1.0)) - z);
	} else {
		tmp = t_1;
	}
	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(b * y))
	tmp = 0.0
	if (y <= -1.1e+40)
		tmp = t_1;
	elseif (y <= 1e+21)
		tmp = Float64(fma(Float64(t - 2.0), b, x) - Float64(Float64(a * Float64(t - 1.0)) - z));
	else
		tmp = t_1;
	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[(b * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e+40], t$95$1, If[LessEqual[y, 1e+21], N[(N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - N[(N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\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) + b \cdot y\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.0999999999999999e40 or 1e21 < y

    1. Initial program 94.9%

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

      \[\leadsto \left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \color{blue}{b \cdot y} \]
    3. Step-by-step derivation
      1. lower-*.f6478.8

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

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

    if -1.0999999999999999e40 < y < 1e21

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

Alternative 3: 86.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;a \leq 4.3 \cdot 10^{+92}:\\
\;\;\;\;t\_1 - \left(y - 1\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.5000000000000004e97

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right) \]
      5. lower--.f6468.5

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

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

    if -7.5000000000000004e97 < a < 4.2999999999999998e92

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(y - 1\right) \cdot z \]
      11. lift-*.f6472.5

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

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

    if 4.2999999999999998e92 < a

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

Alternative 4: 86.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.2999999999999999e89

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right) \]
      5. lower--.f6468.5

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

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

    if -2.2999999999999999e89 < z < 4.70000000000000009e80

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

    if 4.70000000000000009e80 < z

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

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

Alternative 5: 86.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right)\\ \mathbf{if}\;b \leq -1.2 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{+41}:\\ \;\;\;\;x + \left(\mathsf{fma}\left(-y, z, z\right) - 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 (- (fma (- (+ t y) 2.0) b x) (- a))))
   (if (<= b -1.2e+48)
     t_1
     (if (<= b 2.4e+41) (+ x (- (fma (- y) z z) (* a (- t 1.0)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = fma(((t + y) - 2.0), b, x) - -a;
	double tmp;
	if (b <= -1.2e+48) {
		tmp = t_1;
	} else if (b <= 2.4e+41) {
		tmp = x + (fma(-y, z, z) - (a * (t - 1.0)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	t_1 = Float64(fma(Float64(Float64(t + y) - 2.0), b, x) - Float64(-a))
	tmp = 0.0
	if (b <= -1.2e+48)
		tmp = t_1;
	elseif (b <= 2.4e+41)
		tmp = Float64(x + Float64(fma(Float64(-y), z, z) - Float64(a * Float64(t - 1.0))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision]}, If[LessEqual[b, -1.2e+48], t$95$1, If[LessEqual[b, 2.4e+41], N[(x + N[(N[((-y) * z + z), $MachinePrecision] - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right)\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.4 \cdot 10^{+41}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(-y, z, z\right) - 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 < -1.2000000000000001e48 or 2.4000000000000002e41 < b

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites59.9%

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

    if -1.2000000000000001e48 < b < 2.4000000000000002e41

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

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

Alternative 6: 85.7% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right)\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.2000000000000001e48 or 2.4000000000000002e41 < b

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites59.9%

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

    if -1.2000000000000001e48 < b < 2.4000000000000002e41

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

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

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

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

        \[\leadsto x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right) \]
      5. lower--.f6468.5

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

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

Alternative 7: 73.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot t\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 17:\\
\;\;\;\;\left(-a\right) \cdot t + \left(\left(y + t\right) - 2\right) \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.50000000000000014e74 or 17 < z

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

      \[\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 + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot t\right) \]
    9. Step-by-step derivation
      1. lower-*.f6458.6

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

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

    if -3.50000000000000014e74 < z < 2.0999999999999999e-141

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites59.9%

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

    if 2.0999999999999999e-141 < z < 17

    1. Initial program 94.9%

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

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

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

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

        \[\leadsto \left(\mathsf{neg}\left(a\right)\right) \cdot t + \left(\left(y + t\right) - 2\right) \cdot b \]
      4. lower-neg.f6449.7

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

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

Alternative 8: 72.0% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
t_1 := x + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot t\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.50000000000000014e74 or 1.6e21 < z

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

      \[\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 + \left(\mathsf{fma}\left(-y, z, z\right) - a \cdot t\right) \]
    9. Step-by-step derivation
      1. lower-*.f6458.6

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

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

    if -3.50000000000000014e74 < z < 1.6e21

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites59.9%

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

Alternative 9: 71.6% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + \left(\mathsf{fma}\left(-y, z, z\right) - \left(-a\right)\right)\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.70000000000000002e88 or 7.09999999999999964e139 < z

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

      \[\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 0

      \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - -1 \cdot a\right) \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - \left(\mathsf{neg}\left(a\right)\right)\right) \]
      2. lower-neg.f6451.8

        \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - \left(-a\right)\right) \]
    10. Applied rewrites51.8%

      \[\leadsto x + \left(\mathsf{fma}\left(-y, z, z\right) - \left(-a\right)\right) \]

    if -1.70000000000000002e88 < z < 7.09999999999999964e139

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites59.9%

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

Alternative 10: 66.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -1.15 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\ \;\;\;\;\left(\mathsf{fma}\left(-2, b, b \cdot y\right) + x\right) + a\\ \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 -1.15e+41)
     t_1
     (if (<= t 1.1e+53) (+ (+ (fma -2.0 b (* b y)) x) a) 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 <= -1.15e+41) {
		tmp = t_1;
	} else if (t <= 1.1e+53) {
		tmp = (fma(-2.0, b, (b * y)) + x) + a;
	} 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 <= -1.15e+41)
		tmp = t_1;
	elseif (t <= 1.1e+53)
		tmp = Float64(Float64(fma(-2.0, b, Float64(b * y)) + x) + a);
	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, -1.15e+41], t$95$1, If[LessEqual[t, 1.1e+53], N[(N[(N[(-2.0 * b + N[(b * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\
\;\;\;\;\left(\mathsf{fma}\left(-2, b, b \cdot y\right) + x\right) + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1499999999999999e41 or 1.09999999999999999e53 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6432.9

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

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

    if -1.1499999999999999e41 < t < 1.09999999999999999e53

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

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

        \[\leadsto \left(x + \left(-2 \cdot b + b \cdot y\right)\right) + a \]
      2. lower-+.f64N/A

        \[\leadsto \left(x + \left(-2 \cdot b + b \cdot y\right)\right) + a \]
      3. +-commutativeN/A

        \[\leadsto \left(\left(-2 \cdot b + b \cdot y\right) + x\right) + a \]
      4. lower-+.f64N/A

        \[\leadsto \left(\left(-2 \cdot b + b \cdot y\right) + x\right) + a \]
      5. lower-fma.f64N/A

        \[\leadsto \left(\mathsf{fma}\left(-2, b, b \cdot y\right) + x\right) + a \]
      6. lower-*.f6447.2

        \[\leadsto \left(\mathsf{fma}\left(-2, b, b \cdot y\right) + x\right) + a \]
    10. Applied rewrites47.2%

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

Alternative 11: 66.8% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -1.15 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\ \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 -1.15e+41)
     t_1
     (if (<= t 1.1e+53) (+ (fma (- y 2.0) b x) a) 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 <= -1.15e+41) {
		tmp = t_1;
	} else if (t <= 1.1e+53) {
		tmp = fma((y - 2.0), b, x) + a;
	} 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 <= -1.15e+41)
		tmp = t_1;
	elseif (t <= 1.1e+53)
		tmp = Float64(fma(Float64(y - 2.0), b, x) + a);
	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, -1.15e+41], t$95$1, If[LessEqual[t, 1.1e+53], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) + a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.1499999999999999e41 or 1.09999999999999999e53 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6432.9

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

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

    if -1.1499999999999999e41 < t < 1.09999999999999999e53

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

      \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \color{blue}{\left(-a\right)} \]
    8. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
      2. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
      3. lift-fma.f64N/A

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

        \[\leadsto \left(\left(y - 2\right) \cdot b + x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      5. add-flip-revN/A

        \[\leadsto \left(\left(y - 2\right) \cdot b + x\right) + a \]
      6. *-commutativeN/A

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

        \[\leadsto \left(x + b \cdot \left(y - 2\right)\right) + a \]
      8. lower-+.f64N/A

        \[\leadsto \left(x + b \cdot \left(y - 2\right)\right) + a \]
      9. +-commutativeN/A

        \[\leadsto \left(b \cdot \left(y - 2\right) + x\right) + a \]
      10. *-commutativeN/A

        \[\leadsto \left(\left(y - 2\right) \cdot b + x\right) + a \]
      11. lift-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) + a \]
      12. lift--.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) + a \]
    9. Applied rewrites47.2%

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

Alternative 12: 62.1% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-b\right) \cdot \left(-\left(\left(t + y\right) - 2\right)\right)\\ \mathbf{if}\;b \leq -4 \cdot 10^{+48}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+38}:\\ \;\;\;\;x - a \cdot \left(t - 1\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- b) (- (- (+ t y) 2.0)))))
   (if (<= b -4e+48) t_1 (if (<= b 2.3e+38) (- x (* a (- t 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -b * -((t + y) - 2.0);
	double tmp;
	if (b <= -4e+48) {
		tmp = t_1;
	} else if (b <= 2.3e+38) {
		tmp = x - (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 = -b * -((t + y) - 2.0d0)
    if (b <= (-4d+48)) then
        tmp = t_1
    else if (b <= 2.3d+38) then
        tmp = x - (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 = -b * -((t + y) - 2.0);
	double tmp;
	if (b <= -4e+48) {
		tmp = t_1;
	} else if (b <= 2.3e+38) {
		tmp = x - (a * (t - 1.0));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = -b * -((t + y) - 2.0)
	tmp = 0
	if b <= -4e+48:
		tmp = t_1
	elif b <= 2.3e+38:
		tmp = x - (a * (t - 1.0))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(-b) * Float64(-Float64(Float64(t + y) - 2.0)))
	tmp = 0.0
	if (b <= -4e+48)
		tmp = t_1;
	elseif (b <= 2.3e+38)
		tmp = Float64(x - 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 = -b * -((t + y) - 2.0);
	tmp = 0.0;
	if (b <= -4e+48)
		tmp = t_1;
	elseif (b <= 2.3e+38)
		tmp = x - (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[((-b) * (-N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[b, -4e+48], t$95$1, If[LessEqual[b, 2.3e+38], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(-\left(\left(t + y\right) - 2\right)\right)\\
\mathbf{if}\;b \leq -4 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 2.3 \cdot 10^{+38}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.00000000000000018e48 or 2.3000000000000001e38 < b

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 -inf

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000018e48 < b < 2.3000000000000001e38

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

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

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

        \[\leadsto x - a \cdot \left(t - 1\right) \]
      3. lift-*.f6443.0

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

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

Alternative 13: 56.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -3.7 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-20}:\\ \;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\ \;\;\;\;x + \left(-y\right) \cdot z\\ \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 -3.7e+39)
     t_1
     (if (<= t 1.7e-20)
       (fma (- y 2.0) b a)
       (if (<= t 1.1e+53) (+ x (* (- y) z)) 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 <= -3.7e+39) {
		tmp = t_1;
	} else if (t <= 1.7e-20) {
		tmp = fma((y - 2.0), b, a);
	} else if (t <= 1.1e+53) {
		tmp = x + (-y * z);
	} 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 <= -3.7e+39)
		tmp = t_1;
	elseif (t <= 1.7e-20)
		tmp = fma(Float64(y - 2.0), b, a);
	elseif (t <= 1.1e+53)
		tmp = Float64(x + Float64(Float64(-y) * z));
	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, -3.7e+39], t$95$1, If[LessEqual[t, 1.7e-20], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision], If[LessEqual[t, 1.1e+53], N[(x + N[((-y) * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\
\;\;\;\;x + \left(-y\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.70000000000000012e39 or 1.09999999999999999e53 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6432.9

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

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

    if -3.70000000000000012e39 < t < 1.6999999999999999e-20

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, a\right) \]
      4. lift--.f6433.0

        \[\leadsto \mathsf{fma}\left(y - 2, b, a\right) \]
    10. Applied rewrites33.0%

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

    if 1.6999999999999999e-20 < t < 1.09999999999999999e53

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

      \[\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 inf

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(y\right)\right) \cdot z \]
      4. lift-neg.f6433.7

        \[\leadsto x + \left(-y\right) \cdot z \]
    10. Applied rewrites33.7%

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

Alternative 14: 51.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -2.35 \cdot 10^{+43}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-105}:\\ \;\;\;\;\left(b - z\right) \cdot y\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-20}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\ \;\;\;\;x + \left(-y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- b a) t)))
   (if (<= t -2.35e+43)
     t_1
     (if (<= t -1.12e-105)
       (* (- b z) y)
       (if (<= t 1.7e-20)
         (+ a x)
         (if (<= t 1.1e+53) (+ x (* (- y) z)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (b - a) * t;
	double tmp;
	if (t <= -2.35e+43) {
		tmp = t_1;
	} else if (t <= -1.12e-105) {
		tmp = (b - z) * y;
	} else if (t <= 1.7e-20) {
		tmp = a + x;
	} else if (t <= 1.1e+53) {
		tmp = x + (-y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (b - a) * t
    if (t <= (-2.35d+43)) then
        tmp = t_1
    else if (t <= (-1.12d-105)) then
        tmp = (b - z) * y
    else if (t <= 1.7d-20) then
        tmp = a + x
    else if (t <= 1.1d+53) then
        tmp = x + (-y * z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (b - a) * t;
	double tmp;
	if (t <= -2.35e+43) {
		tmp = t_1;
	} else if (t <= -1.12e-105) {
		tmp = (b - z) * y;
	} else if (t <= 1.7e-20) {
		tmp = a + x;
	} else if (t <= 1.1e+53) {
		tmp = x + (-y * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (b - a) * t
	tmp = 0
	if t <= -2.35e+43:
		tmp = t_1
	elif t <= -1.12e-105:
		tmp = (b - z) * y
	elif t <= 1.7e-20:
		tmp = a + x
	elif t <= 1.1e+53:
		tmp = x + (-y * z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(b - a) * t)
	tmp = 0.0
	if (t <= -2.35e+43)
		tmp = t_1;
	elseif (t <= -1.12e-105)
		tmp = Float64(Float64(b - z) * y);
	elseif (t <= 1.7e-20)
		tmp = Float64(a + x);
	elseif (t <= 1.1e+53)
		tmp = Float64(x + Float64(Float64(-y) * z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (b - a) * t;
	tmp = 0.0;
	if (t <= -2.35e+43)
		tmp = t_1;
	elseif (t <= -1.12e-105)
		tmp = (b - z) * y;
	elseif (t <= 1.7e-20)
		tmp = a + x;
	elseif (t <= 1.1e+53)
		tmp = x + (-y * z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.35e+43], t$95$1, If[LessEqual[t, -1.12e-105], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.7e-20], N[(a + x), $MachinePrecision], If[LessEqual[t, 1.1e+53], N[(x + N[((-y) * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.12 \cdot 10^{-105}:\\
\;\;\;\;\left(b - z\right) \cdot y\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{-20}:\\
\;\;\;\;a + x\\

\mathbf{elif}\;t \leq 1.1 \cdot 10^{+53}:\\
\;\;\;\;x + \left(-y\right) \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.34999999999999999e43 or 1.09999999999999999e53 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6432.9

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

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

    if -2.34999999999999999e43 < t < -1.11999999999999995e-105

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6433.1

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

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

    if -1.11999999999999995e-105 < t < 1.6999999999999999e-20

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]

    if 1.6999999999999999e-20 < t < 1.09999999999999999e53

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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--.f6468.1

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

      \[\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 inf

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

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

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

        \[\leadsto x + \left(\mathsf{neg}\left(y\right)\right) \cdot z \]
      4. lift-neg.f6433.7

        \[\leadsto x + \left(-y\right) \cdot z \]
    10. Applied rewrites33.7%

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

Alternative 15: 51.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - z\right) \cdot y\\ t_2 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -2.35 \cdot 10^{+43}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq -1.12 \cdot 10^{-105}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 2.05 \cdot 10^{-16}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- b z) y)) (t_2 (* (- b a) t)))
   (if (<= t -2.35e+43)
     t_2
     (if (<= t -1.12e-105)
       t_1
       (if (<= t 2.05e-16) (+ a x) (if (<= t 5.8e+31) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (b - z) * y;
	double t_2 = (b - a) * t;
	double tmp;
	if (t <= -2.35e+43) {
		tmp = t_2;
	} else if (t <= -1.12e-105) {
		tmp = t_1;
	} else if (t <= 2.05e-16) {
		tmp = a + x;
	} else if (t <= 5.8e+31) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (b - z) * y
    t_2 = (b - a) * t
    if (t <= (-2.35d+43)) then
        tmp = t_2
    else if (t <= (-1.12d-105)) then
        tmp = t_1
    else if (t <= 2.05d-16) then
        tmp = a + x
    else if (t <= 5.8d+31) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (b - z) * y;
	double t_2 = (b - a) * t;
	double tmp;
	if (t <= -2.35e+43) {
		tmp = t_2;
	} else if (t <= -1.12e-105) {
		tmp = t_1;
	} else if (t <= 2.05e-16) {
		tmp = a + x;
	} else if (t <= 5.8e+31) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (b - z) * y
	t_2 = (b - a) * t
	tmp = 0
	if t <= -2.35e+43:
		tmp = t_2
	elif t <= -1.12e-105:
		tmp = t_1
	elif t <= 2.05e-16:
		tmp = a + x
	elif t <= 5.8e+31:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(b - z) * y)
	t_2 = Float64(Float64(b - a) * t)
	tmp = 0.0
	if (t <= -2.35e+43)
		tmp = t_2;
	elseif (t <= -1.12e-105)
		tmp = t_1;
	elseif (t <= 2.05e-16)
		tmp = Float64(a + x);
	elseif (t <= 5.8e+31)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (b - z) * y;
	t_2 = (b - a) * t;
	tmp = 0.0;
	if (t <= -2.35e+43)
		tmp = t_2;
	elseif (t <= -1.12e-105)
		tmp = t_1;
	elseif (t <= 2.05e-16)
		tmp = a + x;
	elseif (t <= 5.8e+31)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.35e+43], t$95$2, If[LessEqual[t, -1.12e-105], t$95$1, If[LessEqual[t, 2.05e-16], N[(a + x), $MachinePrecision], If[LessEqual[t, 5.8e+31], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.35 \cdot 10^{+43}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq -1.12 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 2.05 \cdot 10^{-16}:\\
\;\;\;\;a + x\\

\mathbf{elif}\;t \leq 5.8 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.34999999999999999e43 or 5.8000000000000001e31 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6432.9

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

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

    if -2.34999999999999999e43 < t < -1.11999999999999995e-105 or 2.05000000000000003e-16 < t < 5.8000000000000001e31

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6433.1

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

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

    if -1.11999999999999995e-105 < t < 2.05000000000000003e-16

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

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

Alternative 16: 49.8% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(b - a\right) \cdot t\\ \mathbf{if}\;t \leq -3.7 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -4.6 \cdot 10^{-71}:\\ \;\;\;\;\left(y - 2\right) \cdot b\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+53}:\\ \;\;\;\;a + x\\ \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 -3.7e+39)
     t_1
     (if (<= t -4.6e-71) (* (- y 2.0) b) (if (<= t 1.02e+53) (+ a 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 <= -3.7e+39) {
		tmp = t_1;
	} else if (t <= -4.6e-71) {
		tmp = (y - 2.0) * b;
	} else if (t <= 1.02e+53) {
		tmp = a + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (b - a) * t
    if (t <= (-3.7d+39)) then
        tmp = t_1
    else if (t <= (-4.6d-71)) then
        tmp = (y - 2.0d0) * b
    else if (t <= 1.02d+53) then
        tmp = a + x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (b - a) * t;
	double tmp;
	if (t <= -3.7e+39) {
		tmp = t_1;
	} else if (t <= -4.6e-71) {
		tmp = (y - 2.0) * b;
	} else if (t <= 1.02e+53) {
		tmp = a + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (b - a) * t
	tmp = 0
	if t <= -3.7e+39:
		tmp = t_1
	elif t <= -4.6e-71:
		tmp = (y - 2.0) * b
	elif t <= 1.02e+53:
		tmp = a + 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 <= -3.7e+39)
		tmp = t_1;
	elseif (t <= -4.6e-71)
		tmp = Float64(Float64(y - 2.0) * b);
	elseif (t <= 1.02e+53)
		tmp = Float64(a + x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (b - a) * t;
	tmp = 0.0;
	if (t <= -3.7e+39)
		tmp = t_1;
	elseif (t <= -4.6e-71)
		tmp = (y - 2.0) * b;
	elseif (t <= 1.02e+53)
		tmp = a + x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.7e+39], t$95$1, If[LessEqual[t, -4.6e-71], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 1.02e+53], N[(a + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -3.7 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -4.6 \cdot 10^{-71}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\

\mathbf{elif}\;t \leq 1.02 \cdot 10^{+53}:\\
\;\;\;\;a + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.70000000000000012e39 or 1.01999999999999999e53 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6432.9

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

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

    if -3.70000000000000012e39 < t < -4.5999999999999997e-71

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]
    11. Taylor expanded in b around inf

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

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

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

        \[\leadsto \left(y - 2\right) \cdot b \]
    13. Applied rewrites23.8%

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

    if -4.5999999999999997e-71 < t < 1.01999999999999999e53

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

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

Alternative 17: 40.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - t\right) \cdot a\\ \mathbf{if}\;a \leq -7.4 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 8 \cdot 10^{-275}:\\ \;\;\;\;\left(y - 2\right) \cdot b\\ \mathbf{elif}\;a \leq 1.2 \cdot 10^{+34}:\\ \;\;\;\;\left(1 - y\right) \cdot z\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{+89}:\\ \;\;\;\;a + x\\ \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 -7.4e+56)
     t_1
     (if (<= a 8e-275)
       (* (- y 2.0) b)
       (if (<= a 1.2e+34) (* (- 1.0 y) z) (if (<= a 5.5e+89) (+ a 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 <= -7.4e+56) {
		tmp = t_1;
	} else if (a <= 8e-275) {
		tmp = (y - 2.0) * b;
	} else if (a <= 1.2e+34) {
		tmp = (1.0 - y) * z;
	} else if (a <= 5.5e+89) {
		tmp = a + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (1.0d0 - t) * a
    if (a <= (-7.4d+56)) then
        tmp = t_1
    else if (a <= 8d-275) then
        tmp = (y - 2.0d0) * b
    else if (a <= 1.2d+34) then
        tmp = (1.0d0 - y) * z
    else if (a <= 5.5d+89) then
        tmp = a + x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (1.0 - t) * a;
	double tmp;
	if (a <= -7.4e+56) {
		tmp = t_1;
	} else if (a <= 8e-275) {
		tmp = (y - 2.0) * b;
	} else if (a <= 1.2e+34) {
		tmp = (1.0 - y) * z;
	} else if (a <= 5.5e+89) {
		tmp = a + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (1.0 - t) * a
	tmp = 0
	if a <= -7.4e+56:
		tmp = t_1
	elif a <= 8e-275:
		tmp = (y - 2.0) * b
	elif a <= 1.2e+34:
		tmp = (1.0 - y) * z
	elif a <= 5.5e+89:
		tmp = a + 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 <= -7.4e+56)
		tmp = t_1;
	elseif (a <= 8e-275)
		tmp = Float64(Float64(y - 2.0) * b);
	elseif (a <= 1.2e+34)
		tmp = Float64(Float64(1.0 - y) * z);
	elseif (a <= 5.5e+89)
		tmp = Float64(a + x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (1.0 - t) * a;
	tmp = 0.0;
	if (a <= -7.4e+56)
		tmp = t_1;
	elseif (a <= 8e-275)
		tmp = (y - 2.0) * b;
	elseif (a <= 1.2e+34)
		tmp = (1.0 - y) * z;
	elseif (a <= 5.5e+89)
		tmp = a + x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -7.4e+56], t$95$1, If[LessEqual[a, 8e-275], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 1.2e+34], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 5.5e+89], N[(a + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -7.4 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 8 \cdot 10^{-275}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\

\mathbf{elif}\;a \leq 1.2 \cdot 10^{+34}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\

\mathbf{elif}\;a \leq 5.5 \cdot 10^{+89}:\\
\;\;\;\;a + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -7.39999999999999994e56 or 5.49999999999999976e89 < a

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.8

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

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

    if -7.39999999999999994e56 < a < 7.99999999999999947e-275

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]
    11. Taylor expanded in b around inf

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

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

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

        \[\leadsto \left(y - 2\right) \cdot b \]
    13. Applied rewrites23.8%

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

    if 7.99999999999999947e-275 < a < 1.19999999999999993e34

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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--.f6428.4

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

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

    if 1.19999999999999993e34 < a < 5.49999999999999976e89

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

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

Alternative 18: 39.9% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(1 - t\right) \cdot a\\ \mathbf{if}\;a \leq -7.4 \cdot 10^{+56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-304}:\\ \;\;\;\;\left(y - 2\right) \cdot b\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{+132}:\\ \;\;\;\;z + x\\ \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 -7.4e+56)
     t_1
     (if (<= a 5.8e-304) (* (- y 2.0) b) (if (<= a 9.5e+132) (+ z 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 <= -7.4e+56) {
		tmp = t_1;
	} else if (a <= 5.8e-304) {
		tmp = (y - 2.0) * b;
	} else if (a <= 9.5e+132) {
		tmp = z + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (1.0d0 - t) * a
    if (a <= (-7.4d+56)) then
        tmp = t_1
    else if (a <= 5.8d-304) then
        tmp = (y - 2.0d0) * b
    else if (a <= 9.5d+132) then
        tmp = z + x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (1.0 - t) * a;
	double tmp;
	if (a <= -7.4e+56) {
		tmp = t_1;
	} else if (a <= 5.8e-304) {
		tmp = (y - 2.0) * b;
	} else if (a <= 9.5e+132) {
		tmp = z + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (1.0 - t) * a
	tmp = 0
	if a <= -7.4e+56:
		tmp = t_1
	elif a <= 5.8e-304:
		tmp = (y - 2.0) * b
	elif a <= 9.5e+132:
		tmp = z + 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 <= -7.4e+56)
		tmp = t_1;
	elseif (a <= 5.8e-304)
		tmp = Float64(Float64(y - 2.0) * b);
	elseif (a <= 9.5e+132)
		tmp = Float64(z + x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (1.0 - t) * a;
	tmp = 0.0;
	if (a <= -7.4e+56)
		tmp = t_1;
	elseif (a <= 5.8e-304)
		tmp = (y - 2.0) * b;
	elseif (a <= 9.5e+132)
		tmp = z + x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -7.4e+56], t$95$1, If[LessEqual[a, 5.8e-304], N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[a, 9.5e+132], N[(z + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -7.4 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{-304}:\\
\;\;\;\;\left(y - 2\right) \cdot b\\

\mathbf{elif}\;a \leq 9.5 \cdot 10^{+132}:\\
\;\;\;\;z + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.39999999999999994e56 or 9.5000000000000005e132 < a

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.8

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

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

    if -7.39999999999999994e56 < a < 5.8e-304

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]
    11. Taylor expanded in b around inf

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

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

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

        \[\leadsto \left(y - 2\right) \cdot b \]
    13. Applied rewrites23.8%

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

    if 5.8e-304 < a < 9.5000000000000005e132

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      2. lower-+.f64N/A

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      3. +-commutativeN/A

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

        \[\leadsto \left(\left(t - 2\right) \cdot b + z\right) + x \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
      6. lift--.f6446.0

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
    10. Applied rewrites46.0%

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

      \[\leadsto x + z \]
    12. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto z + x \]
      2. lower-+.f6425.1

        \[\leadsto z + x \]
    13. Applied rewrites25.1%

      \[\leadsto z + x \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 39.0% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-t\right) \cdot a\\ \mathbf{if}\;t \leq -8.5 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 1.02 \cdot 10^{+53}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{+190}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;b \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- t) a)))
   (if (<= t -8.5e+39)
     t_1
     (if (<= t 1.02e+53) (+ a x) (if (<= t 1.35e+190) t_1 (* b t))))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -t * a;
	double tmp;
	if (t <= -8.5e+39) {
		tmp = t_1;
	} else if (t <= 1.02e+53) {
		tmp = a + x;
	} else if (t <= 1.35e+190) {
		tmp = t_1;
	} else {
		tmp = b * t;
	}
	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 * a
    if (t <= (-8.5d+39)) then
        tmp = t_1
    else if (t <= 1.02d+53) then
        tmp = a + x
    else if (t <= 1.35d+190) then
        tmp = t_1
    else
        tmp = b * t
    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 * a;
	double tmp;
	if (t <= -8.5e+39) {
		tmp = t_1;
	} else if (t <= 1.02e+53) {
		tmp = a + x;
	} else if (t <= 1.35e+190) {
		tmp = t_1;
	} else {
		tmp = b * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = -t * a
	tmp = 0
	if t <= -8.5e+39:
		tmp = t_1
	elif t <= 1.02e+53:
		tmp = a + x
	elif t <= 1.35e+190:
		tmp = t_1
	else:
		tmp = b * t
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(-t) * a)
	tmp = 0.0
	if (t <= -8.5e+39)
		tmp = t_1;
	elseif (t <= 1.02e+53)
		tmp = Float64(a + x);
	elseif (t <= 1.35e+190)
		tmp = t_1;
	else
		tmp = Float64(b * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = -t * a;
	tmp = 0.0;
	if (t <= -8.5e+39)
		tmp = t_1;
	elseif (t <= 1.02e+53)
		tmp = a + x;
	elseif (t <= 1.35e+190)
		tmp = t_1;
	else
		tmp = b * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-t) * a), $MachinePrecision]}, If[LessEqual[t, -8.5e+39], t$95$1, If[LessEqual[t, 1.02e+53], N[(a + x), $MachinePrecision], If[LessEqual[t, 1.35e+190], t$95$1, N[(b * t), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot a\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.02 \cdot 10^{+53}:\\
\;\;\;\;a + x\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{+190}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;b \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.49999999999999971e39 or 1.01999999999999999e53 < t < 1.35000000000000002e190

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.8

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

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

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

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

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

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

    if -8.49999999999999971e39 < t < 1.01999999999999999e53

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]

    if 1.35000000000000002e190 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      2. lower-+.f64N/A

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      3. +-commutativeN/A

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

        \[\leadsto \left(\left(t - 2\right) \cdot b + z\right) + x \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
      6. lift--.f6446.0

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
    10. Applied rewrites46.0%

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

      \[\leadsto b \cdot t \]
    12. Step-by-step derivation
      1. lower-*.f6417.0

        \[\leadsto b \cdot t \]
    13. Applied rewrites17.0%

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

Alternative 20: 37.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - 2\right) \cdot b\\ \mathbf{if}\;b \leq -4.8 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 4 \cdot 10^{+78}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* (- y 2.0) b)))
   (if (<= b -4.8e+64) t_1 (if (<= b 4e+78) (+ a x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y - 2.0) * b;
	double tmp;
	if (b <= -4.8e+64) {
		tmp = t_1;
	} else if (b <= 4e+78) {
		tmp = a + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (y - 2.0d0) * b
    if (b <= (-4.8d+64)) then
        tmp = t_1
    else if (b <= 4d+78) then
        tmp = a + x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (y - 2.0) * b;
	double tmp;
	if (b <= -4.8e+64) {
		tmp = t_1;
	} else if (b <= 4e+78) {
		tmp = a + x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = (y - 2.0) * b
	tmp = 0
	if b <= -4.8e+64:
		tmp = t_1
	elif b <= 4e+78:
		tmp = a + x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(y - 2.0) * b)
	tmp = 0.0
	if (b <= -4.8e+64)
		tmp = t_1;
	elseif (b <= 4e+78)
		tmp = Float64(a + x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (y - 2.0) * b;
	tmp = 0.0;
	if (b <= -4.8e+64)
		tmp = t_1;
	elseif (b <= 4e+78)
		tmp = a + x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -4.8e+64], t$95$1, If[LessEqual[b, 4e+78], N[(a + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - 2\right) \cdot b\\
\mathbf{if}\;b \leq -4.8 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 4 \cdot 10^{+78}:\\
\;\;\;\;a + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.79999999999999999e64 or 4.00000000000000003e78 < b

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]
    11. Taylor expanded in b around inf

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

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

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

        \[\leadsto \left(y - 2\right) \cdot b \]
    13. Applied rewrites23.8%

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

    if -4.79999999999999999e64 < b < 4.00000000000000003e78

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

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

Alternative 21: 34.6% accurate, 0.4× 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 -2 \cdot 10^{+298}:\\ \;\;\;\;b \cdot y\\ \mathbf{elif}\;t\_1 \leq 10^{+307}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;b \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1
         (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
   (if (<= t_1 -2e+298) (* b y) (if (<= t_1 1e+307) (+ a x) (* 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 <= -2e+298) {
		tmp = b * y;
	} else if (t_1 <= 1e+307) {
		tmp = a + x;
	} else {
		tmp = b * t;
	}
	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 - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
    if (t_1 <= (-2d+298)) then
        tmp = b * y
    else if (t_1 <= 1d+307) then
        tmp = a + x
    else
        tmp = b * t
    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 - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
	double tmp;
	if (t_1 <= -2e+298) {
		tmp = b * y;
	} else if (t_1 <= 1e+307) {
		tmp = a + x;
	} else {
		tmp = b * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
	tmp = 0
	if t_1 <= -2e+298:
		tmp = b * y
	elif t_1 <= 1e+307:
		tmp = a + x
	else:
		tmp = 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 <= -2e+298)
		tmp = Float64(b * y);
	elseif (t_1 <= 1e+307)
		tmp = Float64(a + x);
	else
		tmp = Float64(b * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
	tmp = 0.0;
	if (t_1 <= -2e+298)
		tmp = b * y;
	elseif (t_1 <= 1e+307)
		tmp = a + x;
	else
		tmp = b * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+298], N[(b * y), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], N[(a + x), $MachinePrecision], N[(b * t), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;a + x\\

\mathbf{else}:\\
\;\;\;\;b \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 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)) < -1.9999999999999999e298

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto b \cdot \color{blue}{y} \]
    9. Step-by-step derivation
      1. lower-*.f6417.9

        \[\leadsto b \cdot y \]
    10. Applied rewrites17.9%

      \[\leadsto b \cdot \color{blue}{y} \]

    if -1.9999999999999999e298 < (+.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)) < 9.99999999999999986e306

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]

    if 9.99999999999999986e306 < (+.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 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      2. lower-+.f64N/A

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      3. +-commutativeN/A

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

        \[\leadsto \left(\left(t - 2\right) \cdot b + z\right) + x \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
      6. lift--.f6446.0

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
    10. Applied rewrites46.0%

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

      \[\leadsto b \cdot t \]
    12. Step-by-step derivation
      1. lower-*.f6417.0

        \[\leadsto b \cdot t \]
    13. Applied rewrites17.0%

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

Alternative 22: 32.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.8 \cdot 10^{+229}:\\ \;\;\;\;b \cdot t\\ \mathbf{elif}\;t \leq 4.5 \cdot 10^{+53}:\\ \;\;\;\;a + x\\ \mathbf{else}:\\ \;\;\;\;b \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -5.8e+229) (* b t) (if (<= t 4.5e+53) (+ a x) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -5.8e+229) {
		tmp = b * t;
	} else if (t <= 4.5e+53) {
		tmp = a + x;
	} else {
		tmp = b * t;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-5.8d+229)) then
        tmp = b * t
    else if (t <= 4.5d+53) then
        tmp = a + x
    else
        tmp = b * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -5.8e+229) {
		tmp = b * t;
	} else if (t <= 4.5e+53) {
		tmp = a + x;
	} else {
		tmp = b * t;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -5.8e+229:
		tmp = b * t
	elif t <= 4.5e+53:
		tmp = a + x
	else:
		tmp = b * t
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -5.8e+229)
		tmp = Float64(b * t);
	elseif (t <= 4.5e+53)
		tmp = Float64(a + x);
	else
		tmp = Float64(b * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -5.8e+229)
		tmp = b * t;
	elseif (t <= 4.5e+53)
		tmp = a + x;
	else
		tmp = b * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5.8e+229], N[(b * t), $MachinePrecision], If[LessEqual[t, 4.5e+53], N[(a + x), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+229}:\\
\;\;\;\;b \cdot t\\

\mathbf{elif}\;t \leq 4.5 \cdot 10^{+53}:\\
\;\;\;\;a + x\\

\mathbf{else}:\\
\;\;\;\;b \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.79999999999999963e229 or 4.5000000000000002e53 < t

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

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

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

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

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      2. lower-+.f64N/A

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      3. +-commutativeN/A

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

        \[\leadsto \left(\left(t - 2\right) \cdot b + z\right) + x \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
      6. lift--.f6446.0

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
    10. Applied rewrites46.0%

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

      \[\leadsto b \cdot t \]
    12. Step-by-step derivation
      1. lower-*.f6417.0

        \[\leadsto b \cdot t \]
    13. Applied rewrites17.0%

      \[\leadsto b \cdot t \]

    if -5.79999999999999963e229 < t < 4.5000000000000002e53

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

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

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

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

Alternative 23: 31.0% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -8 \cdot 10^{+91}:\\ \;\;\;\;a + x\\ \mathbf{elif}\;a \leq 56000:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;a + x\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -8e+91) (+ a x) (if (<= a 56000.0) (+ z x) (+ a x))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -8e+91) {
		tmp = a + x;
	} else if (a <= 56000.0) {
		tmp = z + x;
	} else {
		tmp = a + x;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (a <= (-8d+91)) then
        tmp = a + x
    else if (a <= 56000.0d0) then
        tmp = z + x
    else
        tmp = a + x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -8e+91) {
		tmp = a + x;
	} else if (a <= 56000.0) {
		tmp = z + x;
	} else {
		tmp = a + x;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -8e+91:
		tmp = a + x
	elif a <= 56000.0:
		tmp = z + x
	else:
		tmp = a + x
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -8e+91)
		tmp = Float64(a + x);
	elseif (a <= 56000.0)
		tmp = Float64(z + x);
	else
		tmp = Float64(a + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -8e+91)
		tmp = a + x;
	elseif (a <= 56000.0)
		tmp = z + x;
	else
		tmp = a + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -8e+91], N[(a + x), $MachinePrecision], If[LessEqual[a, 56000.0], N[(z + x), $MachinePrecision], N[(a + x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8 \cdot 10^{+91}:\\
\;\;\;\;a + x\\

\mathbf{elif}\;a \leq 56000:\\
\;\;\;\;z + x\\

\mathbf{else}:\\
\;\;\;\;a + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -8.00000000000000064e91 or 56000 < a

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a \]
      11. lift-*.f6473.3

        \[\leadsto \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot \color{blue}{a} \]
    4. Applied rewrites73.3%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(t + y\right) - 2, b, x\right) - \left(t - 1\right) \cdot a} \]
    5. Taylor expanded in t around 0

      \[\leadsto \left(x + b \cdot \left(y - 2\right)\right) - \color{blue}{-1 \cdot a} \]
    6. Step-by-step derivation
      1. lower--.f64N/A

        \[\leadsto \left(x + b \cdot \left(y - 2\right)\right) - -1 \cdot \color{blue}{a} \]
      2. +-commutativeN/A

        \[\leadsto \left(b \cdot \left(y - 2\right) + x\right) - -1 \cdot a \]
      3. *-commutativeN/A

        \[\leadsto \left(\left(y - 2\right) \cdot b + x\right) - -1 \cdot a \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - -1 \cdot a \]
      5. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - -1 \cdot a \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(\mathsf{neg}\left(a\right)\right) \]
      7. lower-neg.f6447.2

        \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right) \]
    7. Applied rewrites47.2%

      \[\leadsto \mathsf{fma}\left(y - 2, b, x\right) - \color{blue}{\left(-a\right)} \]
    8. Taylor expanded in b around 0

      \[\leadsto a + x \]
    9. Step-by-step derivation
      1. lower-+.f6425.4

        \[\leadsto a + x \]
    10. Applied rewrites25.4%

      \[\leadsto a + x \]

    if -8.00000000000000064e91 < a < 56000

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.f6496.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 rewrites96.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 y around 0

      \[\leadsto \color{blue}{\left(x + b \cdot \left(t - 2\right)\right) - \left(-1 \cdot z + a \cdot \left(t - 1\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(\mathsf{neg}\left(z\right)\right) + \color{blue}{a} \cdot \left(t - 1\right)\right) \]
      2. lift-neg.f64N/A

        \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(-z\right) + \color{blue}{a} \cdot \left(t - 1\right)\right) \]
      3. +-commutativeN/A

        \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(a \cdot \left(t - 1\right) + \color{blue}{\left(-z\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(t - 1\right) \cdot a + \left(-\color{blue}{z}\right)\right) \]
      5. lift-neg.f64N/A

        \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(t - 1\right) \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right) \]
      6. lower--.f64N/A

        \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \color{blue}{\left(\left(t - 1\right) \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right)} \]
      7. +-commutativeN/A

        \[\leadsto \left(b \cdot \left(t - 2\right) + x\right) - \left(\color{blue}{\left(t - 1\right) \cdot a} + \left(\mathsf{neg}\left(z\right)\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \left(\left(t - 2\right) \cdot b + x\right) - \left(\color{blue}{\left(t - 1\right)} \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right) \]
      9. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(\color{blue}{\left(t - 1\right) \cdot a} + \left(\mathsf{neg}\left(z\right)\right)\right) \]
      10. lift--.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(\color{blue}{\left(t - 1\right)} \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right) \]
      11. sub-flip-reverseN/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(\left(t - 1\right) \cdot a - \color{blue}{z}\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      13. lower--.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - \color{blue}{z}\right) \]
      14. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      15. lift--.f6469.1

        \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
    7. Applied rewrites69.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right)} \]
    8. Taylor expanded in a around 0

      \[\leadsto x + \color{blue}{\left(z + b \cdot \left(t - 2\right)\right)} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      2. lower-+.f64N/A

        \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
      3. +-commutativeN/A

        \[\leadsto \left(b \cdot \left(t - 2\right) + z\right) + x \]
      4. *-commutativeN/A

        \[\leadsto \left(\left(t - 2\right) \cdot b + z\right) + x \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
      6. lift--.f6446.0

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
    10. Applied rewrites46.0%

      \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + \color{blue}{x} \]
    11. Taylor expanded in b around 0

      \[\leadsto x + z \]
    12. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto z + x \]
      2. lower-+.f6425.1

        \[\leadsto z + x \]
    13. Applied rewrites25.1%

      \[\leadsto z + x \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 24: 29.2% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.18 \cdot 10^{+92}:\\ \;\;\;\;a\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{+166}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;a\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= a -1.18e+92) a (if (<= a 2.1e+166) (+ z x) a)))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (a <= -1.18e+92) {
		tmp = a;
	} else if (a <= 2.1e+166) {
		tmp = z + 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 <= (-1.18d+92)) then
        tmp = a
    else if (a <= 2.1d+166) then
        tmp = z + 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 <= -1.18e+92) {
		tmp = a;
	} else if (a <= 2.1e+166) {
		tmp = z + x;
	} else {
		tmp = a;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if a <= -1.18e+92:
		tmp = a
	elif a <= 2.1e+166:
		tmp = z + x
	else:
		tmp = a
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (a <= -1.18e+92)
		tmp = a;
	elseif (a <= 2.1e+166)
		tmp = Float64(z + x);
	else
		tmp = a;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (a <= -1.18e+92)
		tmp = a;
	elseif (a <= 2.1e+166)
		tmp = z + x;
	else
		tmp = a;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.18e+92], a, If[LessEqual[a, 2.1e+166], N[(z + x), $MachinePrecision], a]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.18 \cdot 10^{+92}:\\
\;\;\;\;a\\

\mathbf{elif}\;a \leq 2.1 \cdot 10^{+166}:\\
\;\;\;\;z + x\\

\mathbf{else}:\\
\;\;\;\;a\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.18e92 or 2.1000000000000001e166 < a

    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.8

        \[\leadsto \left(1 - t\right) \cdot a \]
    4. Applied rewrites28.8%

      \[\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 rewrites11.2%

        \[\leadsto a \]

      if -1.18e92 < a < 2.1000000000000001e166

      1. Initial program 94.9%

        \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
      2. 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.f6496.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 rewrites96.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 y around 0

        \[\leadsto \color{blue}{\left(x + b \cdot \left(t - 2\right)\right) - \left(-1 \cdot z + a \cdot \left(t - 1\right)\right)} \]
      6. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(\mathsf{neg}\left(z\right)\right) + \color{blue}{a} \cdot \left(t - 1\right)\right) \]
        2. lift-neg.f64N/A

          \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(-z\right) + \color{blue}{a} \cdot \left(t - 1\right)\right) \]
        3. +-commutativeN/A

          \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(a \cdot \left(t - 1\right) + \color{blue}{\left(-z\right)}\right) \]
        4. *-commutativeN/A

          \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(t - 1\right) \cdot a + \left(-\color{blue}{z}\right)\right) \]
        5. lift-neg.f64N/A

          \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \left(\left(t - 1\right) \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right) \]
        6. lower--.f64N/A

          \[\leadsto \left(x + b \cdot \left(t - 2\right)\right) - \color{blue}{\left(\left(t - 1\right) \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right)} \]
        7. +-commutativeN/A

          \[\leadsto \left(b \cdot \left(t - 2\right) + x\right) - \left(\color{blue}{\left(t - 1\right) \cdot a} + \left(\mathsf{neg}\left(z\right)\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \left(\left(t - 2\right) \cdot b + x\right) - \left(\color{blue}{\left(t - 1\right)} \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right) \]
        9. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(\color{blue}{\left(t - 1\right) \cdot a} + \left(\mathsf{neg}\left(z\right)\right)\right) \]
        10. lift--.f64N/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(\color{blue}{\left(t - 1\right)} \cdot a + \left(\mathsf{neg}\left(z\right)\right)\right) \]
        11. sub-flip-reverseN/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(\left(t - 1\right) \cdot a - \color{blue}{z}\right) \]
        12. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
        13. lower--.f64N/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - \color{blue}{z}\right) \]
        14. lower-*.f64N/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
        15. lift--.f6469.1

          \[\leadsto \mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right) \]
      7. Applied rewrites69.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t - 2, b, x\right) - \left(a \cdot \left(t - 1\right) - z\right)} \]
      8. Taylor expanded in a around 0

        \[\leadsto x + \color{blue}{\left(z + b \cdot \left(t - 2\right)\right)} \]
      9. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
        2. lower-+.f64N/A

          \[\leadsto \left(z + b \cdot \left(t - 2\right)\right) + x \]
        3. +-commutativeN/A

          \[\leadsto \left(b \cdot \left(t - 2\right) + z\right) + x \]
        4. *-commutativeN/A

          \[\leadsto \left(\left(t - 2\right) \cdot b + z\right) + x \]
        5. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
        6. lift--.f6446.0

          \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + x \]
      10. Applied rewrites46.0%

        \[\leadsto \mathsf{fma}\left(t - 2, b, z\right) + \color{blue}{x} \]
      11. Taylor expanded in b around 0

        \[\leadsto x + z \]
      12. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto z + x \]
        2. lower-+.f6425.1

          \[\leadsto z + x \]
      13. Applied rewrites25.1%

        \[\leadsto z + x \]
    7. Recombined 2 regimes into one program.
    8. Add Preprocessing

    Alternative 25: 11.2% accurate, 28.4× speedup?

    \[\begin{array}{l} \\ a \end{array} \]
    (FPCore (x y z t a b) :precision binary64 a)
    double code(double x, double y, double z, double t, double a, double b) {
    	return a;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, t, a, b)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        code = a
    end function
    
    public static double code(double x, double y, double z, double t, double a, double b) {
    	return a;
    }
    
    def code(x, y, z, t, a, b):
    	return a
    
    function code(x, y, z, t, a, b)
    	return a
    end
    
    function tmp = code(x, y, z, t, a, b)
    	tmp = a;
    end
    
    code[x_, y_, z_, t_, a_, b_] := a
    
    \begin{array}{l}
    
    \\
    a
    \end{array}
    
    Derivation
    1. Initial program 94.9%

      \[\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \]
    2. 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.8

        \[\leadsto \left(1 - t\right) \cdot a \]
    4. Applied rewrites28.8%

      \[\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 rewrites11.2%

        \[\leadsto a \]
      2. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2025136 
      (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)))