Linear.V4:$cdot from linear-1.19.1.3, C

Percentage Accurate: 95.2% → 97.6%
Time: 5.1s
Alternatives: 13
Speedup: 1.3×

Specification

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 95.2% accurate, 1.0× speedup?

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

\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}

Alternative 1: 97.6% accurate, 1.3× speedup?

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

\\
\mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 94.9%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
    6. associate-+l+N/A

      \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
    7. associate--l+N/A

      \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
    8. lift-*.f64N/A

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

      \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
    10. fp-cancel-sign-sub-invN/A

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
    15. remove-double-negN/A

      \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
    16. remove-double-negN/A

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

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

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

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

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

Alternative 2: 73.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+153}:\\
\;\;\;\;t \cdot z + c \cdot i\\

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

\mathbf{elif}\;t\_2 \leq 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -2e292 or 1.0000000000000001e69 < (+.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 89.9%

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
      6. associate-+l+N/A

        \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
      7. associate--l+N/A

        \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
      8. lift-*.f64N/A

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

        \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
      10. fp-cancel-sign-sub-invN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
      15. remove-double-negN/A

        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
      16. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
    4. Applied rewrites96.6%

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

      \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{t \cdot z}\right) \]
    6. Step-by-step derivation
      1. Applied rewrites77.7%

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

      if -2e292 < (+.f64 (*.f64 x y) (*.f64 z t)) < -2e153

      1. Initial program 100.0%

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

        \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
      4. Step-by-step derivation
        1. Applied rewrites74.5%

          \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]

        if -2e153 < (+.f64 (*.f64 x y) (*.f64 z t)) < -2.0000000000000002e50

        1. Initial program 95.0%

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

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

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

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

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

            \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
          6. associate-+l+N/A

            \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
          7. associate--l+N/A

            \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
          8. lift-*.f64N/A

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

            \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
          10. fp-cancel-sign-sub-invN/A

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

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

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

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

            \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
          15. remove-double-negN/A

            \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
          16. remove-double-negN/A

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

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

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

            \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
        4. Applied rewrites100.0%

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

          \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{a \cdot b}\right) \]
        6. Step-by-step derivation
          1. Applied rewrites80.9%

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

          if -2.0000000000000002e50 < (+.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e69

          1. Initial program 100.0%

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

            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
          4. Step-by-step derivation
            1. Applied rewrites94.5%

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

              \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
            3. Step-by-step derivation
              1. Applied rewrites89.0%

                \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
            4. Recombined 4 regimes into one program.
            5. Add Preprocessing

            Alternative 3: 73.7% accurate, 0.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(y, x, z \cdot t\right)\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+292}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+50}:\\ \;\;\;\;\mathsf{fma}\left(y, x, a \cdot b\right)\\ \mathbf{elif}\;t\_2 \leq 10^{+69}:\\ \;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x y z t a b c i)
             :precision binary64
             (let* ((t_1 (fma y x (* z t))) (t_2 (+ (* x y) (* z t))))
               (if (<= t_2 -2e+292)
                 t_1
                 (if (<= t_2 -2e+153)
                   (fma i c (* t z))
                   (if (<= t_2 -2e+50)
                     (fma y x (* a b))
                     (if (<= t_2 1e+69) (fma b a (* c i)) t_1))))))
            double code(double x, double y, double z, double t, double a, double b, double c, double i) {
            	double t_1 = fma(y, x, (z * t));
            	double t_2 = (x * y) + (z * t);
            	double tmp;
            	if (t_2 <= -2e+292) {
            		tmp = t_1;
            	} else if (t_2 <= -2e+153) {
            		tmp = fma(i, c, (t * z));
            	} else if (t_2 <= -2e+50) {
            		tmp = fma(y, x, (a * b));
            	} else if (t_2 <= 1e+69) {
            		tmp = fma(b, a, (c * i));
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x, y, z, t, a, b, c, i)
            	t_1 = fma(y, x, Float64(z * t))
            	t_2 = Float64(Float64(x * y) + Float64(z * t))
            	tmp = 0.0
            	if (t_2 <= -2e+292)
            		tmp = t_1;
            	elseif (t_2 <= -2e+153)
            		tmp = fma(i, c, Float64(t * z));
            	elseif (t_2 <= -2e+50)
            		tmp = fma(y, x, Float64(a * b));
            	elseif (t_2 <= 1e+69)
            		tmp = fma(b, a, Float64(c * i));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * x + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+292], t$95$1, If[LessEqual[t$95$2, -2e+153], N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -2e+50], N[(y * x + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+69], N[(b * a + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_1 := \mathsf{fma}\left(y, x, z \cdot t\right)\\
            t_2 := x \cdot y + z \cdot t\\
            \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+292}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+153}:\\
            \;\;\;\;\mathsf{fma}\left(i, c, t \cdot z\right)\\
            
            \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+50}:\\
            \;\;\;\;\mathsf{fma}\left(y, x, a \cdot b\right)\\
            
            \mathbf{elif}\;t\_2 \leq 10^{+69}:\\
            \;\;\;\;\mathsf{fma}\left(b, a, c \cdot i\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -2e292 or 1.0000000000000001e69 < (+.f64 (*.f64 x y) (*.f64 z t))

              1. Initial program 89.9%

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

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

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

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

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

                  \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                6. associate-+l+N/A

                  \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                7. associate--l+N/A

                  \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
                8. lift-*.f64N/A

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

                  \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
                10. fp-cancel-sign-sub-invN/A

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
                15. remove-double-negN/A

                  \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
                16. remove-double-negN/A

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

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

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

                  \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
              4. Applied rewrites96.6%

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

                \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{t \cdot z}\right) \]
              6. Step-by-step derivation
                1. Applied rewrites77.7%

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

                if -2e292 < (+.f64 (*.f64 x y) (*.f64 z t)) < -2e153

                1. Initial program 100.0%

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

                  \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
                4. Step-by-step derivation
                  1. Applied rewrites46.3%

                    \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
                  2. Taylor expanded in z around inf

                    \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
                  3. Step-by-step derivation
                    1. Applied rewrites74.5%

                      \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \color{blue}{z \cdot t + c \cdot i} \]
                      2. +-commutativeN/A

                        \[\leadsto \color{blue}{c \cdot i + z \cdot t} \]
                      3. lift-*.f64N/A

                        \[\leadsto \color{blue}{c \cdot i} + z \cdot t \]
                      4. *-commutativeN/A

                        \[\leadsto \color{blue}{i \cdot c} + z \cdot t \]
                      5. lower-fma.f6474.5

                        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, z \cdot t\right)} \]
                    3. Applied rewrites74.5%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)} \]

                    if -2e153 < (+.f64 (*.f64 x y) (*.f64 z t)) < -2.0000000000000002e50

                    1. Initial program 95.0%

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

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

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

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

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

                        \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                      6. associate-+l+N/A

                        \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                      7. associate--l+N/A

                        \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
                      8. lift-*.f64N/A

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

                        \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
                      10. fp-cancel-sign-sub-invN/A

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
                      15. remove-double-negN/A

                        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
                      16. remove-double-negN/A

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

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

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

                        \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
                    4. Applied rewrites100.0%

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

                      \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{a \cdot b}\right) \]
                    6. Step-by-step derivation
                      1. Applied rewrites80.9%

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

                      if -2.0000000000000002e50 < (+.f64 (*.f64 x y) (*.f64 z t)) < 1.0000000000000001e69

                      1. Initial program 100.0%

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

                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                      4. Step-by-step derivation
                        1. Applied rewrites94.5%

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

                          \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites89.0%

                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                        4. Recombined 4 regimes into one program.
                        5. Add Preprocessing

                        Alternative 4: 66.7% accurate, 0.7× speedup?

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

                          1. Initial program 91.2%

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

                            \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
                          4. Step-by-step derivation
                            1. Applied rewrites33.7%

                              \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
                            2. Taylor expanded in z around inf

                              \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
                            3. Step-by-step derivation
                              1. Applied rewrites85.6%

                                \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
                              2. Step-by-step derivation
                                1. lift-+.f64N/A

                                  \[\leadsto \color{blue}{z \cdot t + c \cdot i} \]
                                2. +-commutativeN/A

                                  \[\leadsto \color{blue}{c \cdot i + z \cdot t} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \color{blue}{c \cdot i} + z \cdot t \]
                                4. *-commutativeN/A

                                  \[\leadsto \color{blue}{i \cdot c} + z \cdot t \]
                                5. lower-fma.f6485.6

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, z \cdot t\right)} \]
                              3. Applied rewrites85.6%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)} \]

                              if -9.9999999999999998e146 < (*.f64 z t) < 1.99999999999999993e-105

                              1. Initial program 97.8%

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

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

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

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

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

                                  \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                                6. associate-+l+N/A

                                  \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                                7. associate--l+N/A

                                  \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
                                8. lift-*.f64N/A

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

                                  \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
                                10. fp-cancel-sign-sub-invN/A

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
                                15. remove-double-negN/A

                                  \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
                                16. remove-double-negN/A

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

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

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

                                  \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
                              4. Applied rewrites100.0%

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

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

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

                                if 1.99999999999999993e-105 < (*.f64 z t) < 1.0000000000000001e69

                                1. Initial program 100.0%

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

                                  \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites86.0%

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

                                    \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites79.3%

                                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]

                                    if 1.0000000000000001e69 < (*.f64 z t)

                                    1. Initial program 87.9%

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

                                      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                    4. Step-by-step derivation
                                      1. Applied rewrites82.4%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)} \]
                                      2. Taylor expanded in z around inf

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

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

                                      Alternative 5: 65.3% accurate, 0.7× speedup?

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

                                        1. Initial program 92.3%

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

                                          \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites75.9%

                                            \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
                                          2. Taylor expanded in z around inf

                                            \[\leadsto \color{blue}{t \cdot z} + c \cdot i \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites81.5%

                                              \[\leadsto \color{blue}{z \cdot t} + c \cdot i \]
                                            2. Step-by-step derivation
                                              1. lift-+.f64N/A

                                                \[\leadsto \color{blue}{z \cdot t + c \cdot i} \]
                                              2. +-commutativeN/A

                                                \[\leadsto \color{blue}{c \cdot i + z \cdot t} \]
                                              3. lift-*.f64N/A

                                                \[\leadsto \color{blue}{c \cdot i} + z \cdot t \]
                                              4. *-commutativeN/A

                                                \[\leadsto \color{blue}{i \cdot c} + z \cdot t \]
                                              5. lower-fma.f6481.5

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, z \cdot t\right)} \]
                                            3. Applied rewrites81.5%

                                              \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)} \]

                                            if -2e120 < (*.f64 c i) < 9.99999999999999921e80

                                            1. Initial program 97.0%

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

                                              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites70.2%

                                                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)} \]
                                              2. Taylor expanded in z around inf

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

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

                                                if 9.99999999999999921e80 < (*.f64 c i) < 4.9999999999999997e161

                                                1. Initial program 100.0%

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

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

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

                                                  if 4.9999999999999997e161 < (*.f64 c i)

                                                  1. Initial program 86.8%

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

                                                    \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites89.7%

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

                                                      \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites80.9%

                                                        \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                                                    4. Recombined 4 regimes into one program.
                                                    5. Add Preprocessing

                                                    Alternative 6: 65.5% accurate, 0.7× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(b, a, c \cdot i\right)\\ \mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+148}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq 10^{+81}:\\ \;\;\;\;\mathsf{fma}\left(b, a, z \cdot t\right)\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+161}:\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                    (FPCore (x y z t a b c i)
                                                     :precision binary64
                                                     (let* ((t_1 (fma b a (* c i))))
                                                       (if (<= (* c i) -2e+148)
                                                         t_1
                                                         (if (<= (* c i) 1e+81)
                                                           (fma b a (* z t))
                                                           (if (<= (* c i) 5e+161) (* y x) t_1)))))
                                                    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                    	double t_1 = fma(b, a, (c * i));
                                                    	double tmp;
                                                    	if ((c * i) <= -2e+148) {
                                                    		tmp = t_1;
                                                    	} else if ((c * i) <= 1e+81) {
                                                    		tmp = fma(b, a, (z * t));
                                                    	} else if ((c * i) <= 5e+161) {
                                                    		tmp = y * x;
                                                    	} else {
                                                    		tmp = t_1;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    function code(x, y, z, t, a, b, c, i)
                                                    	t_1 = fma(b, a, Float64(c * i))
                                                    	tmp = 0.0
                                                    	if (Float64(c * i) <= -2e+148)
                                                    		tmp = t_1;
                                                    	elseif (Float64(c * i) <= 1e+81)
                                                    		tmp = fma(b, a, Float64(z * t));
                                                    	elseif (Float64(c * i) <= 5e+161)
                                                    		tmp = Float64(y * x);
                                                    	else
                                                    		tmp = t_1;
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * a + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2e+148], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1e+81], N[(b * a + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+161], N[(y * x), $MachinePrecision], t$95$1]]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_1 := \mathsf{fma}\left(b, a, c \cdot i\right)\\
                                                    \mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+148}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    \mathbf{elif}\;c \cdot i \leq 10^{+81}:\\
                                                    \;\;\;\;\mathsf{fma}\left(b, a, z \cdot t\right)\\
                                                    
                                                    \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+161}:\\
                                                    \;\;\;\;y \cdot x\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;t\_1\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if (*.f64 c i) < -2.0000000000000001e148 or 4.9999999999999997e161 < (*.f64 c i)

                                                      1. Initial program 89.2%

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

                                                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites88.2%

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

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

                                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]

                                                          if -2.0000000000000001e148 < (*.f64 c i) < 9.99999999999999921e80

                                                          1. Initial program 97.0%

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

                                                            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites70.2%

                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)} \]
                                                            2. Taylor expanded in z around inf

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

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

                                                              if 9.99999999999999921e80 < (*.f64 c i) < 4.9999999999999997e161

                                                              1. Initial program 100.0%

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

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

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

                                                              Alternative 7: 88.6% accurate, 0.7× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+104} \lor \neg \left(c \cdot i \leq 5 \cdot 10^{+161}\right):\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\ \end{array} \end{array} \]
                                                              (FPCore (x y z t a b c i)
                                                               :precision binary64
                                                               (if (or (<= (* c i) -1e+104) (not (<= (* c i) 5e+161)))
                                                                 (fma b a (fma t z (* i c)))
                                                                 (fma b a (fma t z (* y x)))))
                                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                              	double tmp;
                                                              	if (((c * i) <= -1e+104) || !((c * i) <= 5e+161)) {
                                                              		tmp = fma(b, a, fma(t, z, (i * c)));
                                                              	} else {
                                                              		tmp = fma(b, a, fma(t, z, (y * x)));
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              function code(x, y, z, t, a, b, c, i)
                                                              	tmp = 0.0
                                                              	if ((Float64(c * i) <= -1e+104) || !(Float64(c * i) <= 5e+161))
                                                              		tmp = fma(b, a, fma(t, z, Float64(i * c)));
                                                              	else
                                                              		tmp = fma(b, a, fma(t, z, Float64(y * x)));
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1e+104], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5e+161]], $MachinePrecision]], N[(b * a + N[(t * z + N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+104} \lor \neg \left(c \cdot i \leq 5 \cdot 10^{+161}\right):\\
                                                              \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 2 regimes
                                                              2. if (*.f64 c i) < -1e104 or 4.9999999999999997e161 < (*.f64 c i)

                                                                1. Initial program 88.6%

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

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

                                                                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)} \]

                                                                  if -1e104 < (*.f64 c i) < 4.9999999999999997e161

                                                                  1. Initial program 97.7%

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

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

                                                                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
                                                                  5. Recombined 2 regimes into one program.
                                                                  6. Final simplification93.2%

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

                                                                  Alternative 8: 85.3% accurate, 0.7× speedup?

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

                                                                    1. Initial program 89.6%

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

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

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

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

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

                                                                        \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                                                                      6. associate-+l+N/A

                                                                        \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                                                                      7. associate--l+N/A

                                                                        \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
                                                                      8. lift-*.f64N/A

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

                                                                        \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
                                                                      10. fp-cancel-sign-sub-invN/A

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

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

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

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

                                                                        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
                                                                      15. remove-double-negN/A

                                                                        \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
                                                                      16. remove-double-negN/A

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

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

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

                                                                        \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(t, z, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
                                                                    4. Applied rewrites95.8%

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

                                                                      \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{a \cdot b}\right) \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites73.9%

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

                                                                      if -1.99999999999999985e75 < (*.f64 x y) < 1e114

                                                                      1. Initial program 98.1%

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

                                                                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites94.0%

                                                                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)} \]

                                                                        if 1e114 < (*.f64 x y)

                                                                        1. Initial program 89.8%

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

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

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

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

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

                                                                            \[\leadsto \left(\color{blue}{\left(x \cdot y + z \cdot t\right)} + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                                                                          6. associate-+l+N/A

                                                                            \[\leadsto \color{blue}{\left(x \cdot y + \left(z \cdot t + a \cdot b\right)\right)} - \left(\mathsf{neg}\left(c\right)\right) \cdot i \]
                                                                          7. associate--l+N/A

                                                                            \[\leadsto \color{blue}{x \cdot y + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right)} \]
                                                                          8. lift-*.f64N/A

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

                                                                            \[\leadsto \color{blue}{y \cdot x} + \left(\left(z \cdot t + a \cdot b\right) - \left(\mathsf{neg}\left(c\right)\right) \cdot i\right) \]
                                                                          10. fp-cancel-sign-sub-invN/A

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

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

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

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

                                                                            \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{z \cdot t} + \left(a \cdot b + c \cdot i\right)\right) \]
                                                                          15. remove-double-negN/A

                                                                            \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right)} \cdot t + \left(a \cdot b + c \cdot i\right)\right) \]
                                                                          16. remove-double-negN/A

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

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

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

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

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

                                                                          \[\leadsto \mathsf{fma}\left(y, x, \color{blue}{t \cdot z}\right) \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites84.3%

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

                                                                        Alternative 9: 42.8% accurate, 0.8× speedup?

                                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+147}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;z \cdot t \leq 10^{-320}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+42}:\\ \;\;\;\;b \cdot a\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
                                                                        (FPCore (x y z t a b c i)
                                                                         :precision binary64
                                                                         (if (<= (* z t) -1e+147)
                                                                           (* t z)
                                                                           (if (<= (* z t) 1e-320) (* y x) (if (<= (* z t) 5e+42) (* b a) (* t z)))))
                                                                        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                        	double tmp;
                                                                        	if ((z * t) <= -1e+147) {
                                                                        		tmp = t * z;
                                                                        	} else if ((z * t) <= 1e-320) {
                                                                        		tmp = y * x;
                                                                        	} else if ((z * t) <= 5e+42) {
                                                                        		tmp = b * a;
                                                                        	} else {
                                                                        		tmp = t * z;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        module fmin_fmax_functions
                                                                            implicit none
                                                                            private
                                                                            public fmax
                                                                            public fmin
                                                                        
                                                                            interface fmax
                                                                                module procedure fmax88
                                                                                module procedure fmax44
                                                                                module procedure fmax84
                                                                                module procedure fmax48
                                                                            end interface
                                                                            interface fmin
                                                                                module procedure fmin88
                                                                                module procedure fmin44
                                                                                module procedure fmin84
                                                                                module procedure fmin48
                                                                            end interface
                                                                        contains
                                                                            real(8) function fmax88(x, y) result (res)
                                                                                real(8), intent (in) :: x
                                                                                real(8), intent (in) :: y
                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                            end function
                                                                            real(4) function fmax44(x, y) result (res)
                                                                                real(4), intent (in) :: x
                                                                                real(4), intent (in) :: y
                                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                            end function
                                                                            real(8) function fmax84(x, y) result(res)
                                                                                real(8), intent (in) :: x
                                                                                real(4), intent (in) :: y
                                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                            end function
                                                                            real(8) function fmax48(x, y) result(res)
                                                                                real(4), intent (in) :: x
                                                                                real(8), intent (in) :: y
                                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                            end function
                                                                            real(8) function fmin88(x, y) result (res)
                                                                                real(8), intent (in) :: x
                                                                                real(8), intent (in) :: y
                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                            end function
                                                                            real(4) function fmin44(x, y) result (res)
                                                                                real(4), intent (in) :: x
                                                                                real(4), intent (in) :: y
                                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                            end function
                                                                            real(8) function fmin84(x, y) result(res)
                                                                                real(8), intent (in) :: x
                                                                                real(4), intent (in) :: y
                                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                            end function
                                                                            real(8) function fmin48(x, y) result(res)
                                                                                real(4), intent (in) :: x
                                                                                real(8), intent (in) :: y
                                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                            end function
                                                                        end module
                                                                        
                                                                        real(8) function code(x, y, z, t, a, b, c, i)
                                                                        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), intent (in) :: c
                                                                            real(8), intent (in) :: i
                                                                            real(8) :: tmp
                                                                            if ((z * t) <= (-1d+147)) then
                                                                                tmp = t * z
                                                                            else if ((z * t) <= 1d-320) then
                                                                                tmp = y * x
                                                                            else if ((z * t) <= 5d+42) then
                                                                                tmp = b * a
                                                                            else
                                                                                tmp = t * z
                                                                            end if
                                                                            code = tmp
                                                                        end function
                                                                        
                                                                        public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                        	double tmp;
                                                                        	if ((z * t) <= -1e+147) {
                                                                        		tmp = t * z;
                                                                        	} else if ((z * t) <= 1e-320) {
                                                                        		tmp = y * x;
                                                                        	} else if ((z * t) <= 5e+42) {
                                                                        		tmp = b * a;
                                                                        	} else {
                                                                        		tmp = t * z;
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        def code(x, y, z, t, a, b, c, i):
                                                                        	tmp = 0
                                                                        	if (z * t) <= -1e+147:
                                                                        		tmp = t * z
                                                                        	elif (z * t) <= 1e-320:
                                                                        		tmp = y * x
                                                                        	elif (z * t) <= 5e+42:
                                                                        		tmp = b * a
                                                                        	else:
                                                                        		tmp = t * z
                                                                        	return tmp
                                                                        
                                                                        function code(x, y, z, t, a, b, c, i)
                                                                        	tmp = 0.0
                                                                        	if (Float64(z * t) <= -1e+147)
                                                                        		tmp = Float64(t * z);
                                                                        	elseif (Float64(z * t) <= 1e-320)
                                                                        		tmp = Float64(y * x);
                                                                        	elseif (Float64(z * t) <= 5e+42)
                                                                        		tmp = Float64(b * a);
                                                                        	else
                                                                        		tmp = Float64(t * z);
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                        	tmp = 0.0;
                                                                        	if ((z * t) <= -1e+147)
                                                                        		tmp = t * z;
                                                                        	elseif ((z * t) <= 1e-320)
                                                                        		tmp = y * x;
                                                                        	elseif ((z * t) <= 5e+42)
                                                                        		tmp = b * a;
                                                                        	else
                                                                        		tmp = t * z;
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+147], N[(t * z), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e-320], N[(y * x), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 5e+42], N[(b * a), $MachinePrecision], N[(t * z), $MachinePrecision]]]]
                                                                        
                                                                        \begin{array}{l}
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+147}:\\
                                                                        \;\;\;\;t \cdot z\\
                                                                        
                                                                        \mathbf{elif}\;z \cdot t \leq 10^{-320}:\\
                                                                        \;\;\;\;y \cdot x\\
                                                                        
                                                                        \mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+42}:\\
                                                                        \;\;\;\;b \cdot a\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;t \cdot z\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 3 regimes
                                                                        2. if (*.f64 z t) < -9.9999999999999998e146 or 5.00000000000000007e42 < (*.f64 z t)

                                                                          1. Initial program 89.7%

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

                                                                            \[\leadsto \color{blue}{t \cdot z} \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites61.6%

                                                                              \[\leadsto \color{blue}{t \cdot z} \]

                                                                            if -9.9999999999999998e146 < (*.f64 z t) < 9.99989e-321

                                                                            1. Initial program 97.1%

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

                                                                              \[\leadsto \color{blue}{x \cdot y} \]
                                                                            4. Step-by-step derivation
                                                                              1. Applied rewrites44.7%

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

                                                                              if 9.99989e-321 < (*.f64 z t) < 5.00000000000000007e42

                                                                              1. Initial program 100.0%

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

                                                                                \[\leadsto \color{blue}{a \cdot b} \]
                                                                              4. Step-by-step derivation
                                                                                1. Applied rewrites46.9%

                                                                                  \[\leadsto \color{blue}{b \cdot a} \]
                                                                              5. Recombined 3 regimes into one program.
                                                                              6. Add Preprocessing

                                                                              Alternative 10: 41.9% accurate, 0.8× speedup?

                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+120}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-303}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+231}:\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \end{array} \]
                                                                              (FPCore (x y z t a b c i)
                                                                               :precision binary64
                                                                               (if (<= (* c i) -2e+120)
                                                                                 (* i c)
                                                                                 (if (<= (* c i) -5e-303) (* b a) (if (<= (* c i) 5e+231) (* t z) (* i c)))))
                                                                              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                              	double tmp;
                                                                              	if ((c * i) <= -2e+120) {
                                                                              		tmp = i * c;
                                                                              	} else if ((c * i) <= -5e-303) {
                                                                              		tmp = b * a;
                                                                              	} else if ((c * i) <= 5e+231) {
                                                                              		tmp = t * z;
                                                                              	} else {
                                                                              		tmp = i * c;
                                                                              	}
                                                                              	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, c, i)
                                                                              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), intent (in) :: c
                                                                                  real(8), intent (in) :: i
                                                                                  real(8) :: tmp
                                                                                  if ((c * i) <= (-2d+120)) then
                                                                                      tmp = i * c
                                                                                  else if ((c * i) <= (-5d-303)) then
                                                                                      tmp = b * a
                                                                                  else if ((c * i) <= 5d+231) then
                                                                                      tmp = t * z
                                                                                  else
                                                                                      tmp = i * c
                                                                                  end if
                                                                                  code = tmp
                                                                              end function
                                                                              
                                                                              public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                                                                              	double tmp;
                                                                              	if ((c * i) <= -2e+120) {
                                                                              		tmp = i * c;
                                                                              	} else if ((c * i) <= -5e-303) {
                                                                              		tmp = b * a;
                                                                              	} else if ((c * i) <= 5e+231) {
                                                                              		tmp = t * z;
                                                                              	} else {
                                                                              		tmp = i * c;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              def code(x, y, z, t, a, b, c, i):
                                                                              	tmp = 0
                                                                              	if (c * i) <= -2e+120:
                                                                              		tmp = i * c
                                                                              	elif (c * i) <= -5e-303:
                                                                              		tmp = b * a
                                                                              	elif (c * i) <= 5e+231:
                                                                              		tmp = t * z
                                                                              	else:
                                                                              		tmp = i * c
                                                                              	return tmp
                                                                              
                                                                              function code(x, y, z, t, a, b, c, i)
                                                                              	tmp = 0.0
                                                                              	if (Float64(c * i) <= -2e+120)
                                                                              		tmp = Float64(i * c);
                                                                              	elseif (Float64(c * i) <= -5e-303)
                                                                              		tmp = Float64(b * a);
                                                                              	elseif (Float64(c * i) <= 5e+231)
                                                                              		tmp = Float64(t * z);
                                                                              	else
                                                                              		tmp = Float64(i * c);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              function tmp_2 = code(x, y, z, t, a, b, c, i)
                                                                              	tmp = 0.0;
                                                                              	if ((c * i) <= -2e+120)
                                                                              		tmp = i * c;
                                                                              	elseif ((c * i) <= -5e-303)
                                                                              		tmp = b * a;
                                                                              	elseif ((c * i) <= 5e+231)
                                                                              		tmp = t * z;
                                                                              	else
                                                                              		tmp = i * c;
                                                                              	end
                                                                              	tmp_2 = tmp;
                                                                              end
                                                                              
                                                                              code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -2e+120], N[(i * c), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -5e-303], N[(b * a), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5e+231], N[(t * z), $MachinePrecision], N[(i * c), $MachinePrecision]]]]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \begin{array}{l}
                                                                              \mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+120}:\\
                                                                              \;\;\;\;i \cdot c\\
                                                                              
                                                                              \mathbf{elif}\;c \cdot i \leq -5 \cdot 10^{-303}:\\
                                                                              \;\;\;\;b \cdot a\\
                                                                              
                                                                              \mathbf{elif}\;c \cdot i \leq 5 \cdot 10^{+231}:\\
                                                                              \;\;\;\;t \cdot z\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;i \cdot c\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 3 regimes
                                                                              2. if (*.f64 c i) < -2e120 or 5.00000000000000028e231 < (*.f64 c i)

                                                                                1. Initial program 90.6%

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

                                                                                  \[\leadsto \color{blue}{c \cdot i} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites73.3%

                                                                                    \[\leadsto \color{blue}{i \cdot c} \]

                                                                                  if -2e120 < (*.f64 c i) < -4.9999999999999998e-303

                                                                                  1. Initial program 96.3%

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

                                                                                    \[\leadsto \color{blue}{a \cdot b} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Applied rewrites43.4%

                                                                                      \[\leadsto \color{blue}{b \cdot a} \]

                                                                                    if -4.9999999999999998e-303 < (*.f64 c i) < 5.00000000000000028e231

                                                                                    1. Initial program 96.4%

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

                                                                                      \[\leadsto \color{blue}{t \cdot z} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. Applied rewrites37.7%

                                                                                        \[\leadsto \color{blue}{t \cdot z} \]
                                                                                    5. Recombined 3 regimes into one program.
                                                                                    6. Add Preprocessing

                                                                                    Alternative 11: 62.8% accurate, 0.9× speedup?

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

                                                                                      1. Initial program 89.7%

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

                                                                                        \[\leadsto \color{blue}{x \cdot y} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. Applied rewrites63.7%

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

                                                                                        if -1.99999999999999985e75 < (*.f64 x y) < 1e114

                                                                                        1. Initial program 98.1%

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

                                                                                          \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites94.0%

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

                                                                                            \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites63.9%

                                                                                              \[\leadsto \mathsf{fma}\left(b, a, c \cdot i\right) \]
                                                                                          4. Recombined 2 regimes into one program.
                                                                                          5. Final simplification63.9%

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

                                                                                          Alternative 12: 41.4% accurate, 1.1× speedup?

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

                                                                                            1. Initial program 88.9%

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

                                                                                              \[\leadsto \color{blue}{c \cdot i} \]
                                                                                            4. Step-by-step derivation
                                                                                              1. Applied rewrites80.0%

                                                                                                \[\leadsto \color{blue}{i \cdot c} \]

                                                                                              if -2e120 < (*.f64 c i) < 9.9999999999999996e290

                                                                                              1. Initial program 96.5%

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

                                                                                                \[\leadsto \color{blue}{a \cdot b} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. Applied rewrites34.6%

                                                                                                  \[\leadsto \color{blue}{b \cdot a} \]
                                                                                              5. Recombined 2 regimes into one program.
                                                                                              6. Final simplification44.2%

                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+120} \lor \neg \left(c \cdot i \leq 10^{+291}\right):\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
                                                                                              7. Add Preprocessing

                                                                                              Alternative 13: 27.9% accurate, 5.0× speedup?

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

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

                                                                                                \[\leadsto \color{blue}{a \cdot b} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. Applied rewrites29.4%

                                                                                                  \[\leadsto \color{blue}{b \cdot a} \]
                                                                                                2. Add Preprocessing

                                                                                                Reproduce

                                                                                                ?
                                                                                                herbie shell --seed 2025022 
                                                                                                (FPCore (x y z t a b c i)
                                                                                                  :name "Linear.V4:$cdot from linear-1.19.1.3, C"
                                                                                                  :precision binary64
                                                                                                  (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))