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

Percentage Accurate: 96.1% → 98.1%
Time: 5.3s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 96.1% 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: 98.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \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 z t (fma y x (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(z, t, fma(y, x, fma(i, c, (b * a))));
}
function code(x, y, z, t, a, b, c, i)
	return fma(z, t, fma(y, x, fma(i, c, Float64(b * a))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(y * x + N[(i * c + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)
\end{array}
Derivation
  1. Initial program 96.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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, y, a \cdot b\right)\\
t_2 := \mathsf{fma}\left(i, c, a \cdot b\right)\\
\mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+116}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-96}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq 0:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\

\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -5.00000000000000025e116 or 2.00000000000000015e70 < (*.f64 c i)

    1. Initial program 91.1%

      \[\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 rewrites79.3%

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

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

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

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

          \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
        5. lower-fma.f6482.7

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
      3. Applied rewrites82.7%

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

      if -5.00000000000000025e116 < (*.f64 c i) < -9.9999999999999991e-97 or -0.0 < (*.f64 c i) < 2.00000000000000015e70

      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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -9.9999999999999991e-97 < (*.f64 c i) < -0.0

          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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{a \cdot b}\right) \]
          7. Recombined 3 regimes into one program.
          8. Final simplification77.1%

            \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+116}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{-96}:\\ \;\;\;\;\mathsf{fma}\left(x, y, a \cdot b\right)\\ \mathbf{elif}\;c \cdot i \leq 0:\\ \;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\ \mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+70}:\\ \;\;\;\;\mathsf{fma}\left(x, y, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \end{array} \]
          9. Add Preprocessing

          Alternative 3: 76.5% accurate, 0.6× speedup?

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

            1. Initial program 94.7%

              \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -5e179 < (+.f64 (*.f64 x y) (*.f64 z t)) < 9.99999999999999962e134

              1. Initial program 99.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 rewrites76.7%

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

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

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

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

                    \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
                  5. lower-fma.f6477.5

                    \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
                3. Applied rewrites77.5%

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

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

              Alternative 4: 89.2% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+116} \lor \neg \left(c \cdot i \leq 2 \cdot 10^{+70}\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) -5e+116) (not (<= (* c i) 2e+70)))
                 (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) <= -5e+116) || !((c * i) <= 2e+70)) {
              		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) <= -5e+116) || !(Float64(c * i) <= 2e+70))
              		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], -5e+116], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2e+70]], $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 -5 \cdot 10^{+116} \lor \neg \left(c \cdot i \leq 2 \cdot 10^{+70}\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) < -5.00000000000000025e116 or 2.00000000000000015e70 < (*.f64 c i)

                1. Initial program 91.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 rewrites91.3%

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

                  if -5.00000000000000025e116 < (*.f64 c i) < 2.00000000000000015e70

                  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 c around 0

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

                      \[\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 simplification95.1%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+116} \lor \neg \left(c \cdot i \leq 2 \cdot 10^{+70}\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 5: 87.7% accurate, 0.7× speedup?

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

                    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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -5e179 < (*.f64 z t) < 5.00000000000000022e41

                      1. Initial program 98.3%

                        \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 5.00000000000000022e41 < (*.f64 z t)

                        1. Initial program 92.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 0

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(t, z, i \cdot c\right)\right)} \]
                        5. Recombined 3 regimes into one program.
                        6. Final simplification92.7%

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

                        Alternative 6: 86.5% accurate, 0.7× speedup?

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

                          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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if -5e179 < (*.f64 z t) < 1.0000000000000001e230

                            1. Initial program 98.5%

                              \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 1.0000000000000001e230 < (*.f64 z t)

                              1. Initial program 86.7%

                                \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{c \cdot i}\right) \]
                              7. Recombined 3 regimes into one program.
                              8. Final simplification90.0%

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

                              Alternative 7: 42.9% accurate, 0.8× speedup?

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

                                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 rewrites70.6%

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

                                  if -5.00000000000000007e121 < (*.f64 a b) < 1e-167

                                  1. Initial program 98.4%

                                    \[\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.2%

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

                                    if 1e-167 < (*.f64 a b) < 2.00000000000000007e139

                                    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 z around inf

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

                                        \[\leadsto \color{blue}{t \cdot z} \]
                                    5. Recombined 3 regimes into one program.
                                    6. Final simplification52.4%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+121}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;a \cdot b \leq 10^{-167}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+139}:\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
                                    7. Add Preprocessing

                                    Alternative 8: 42.8% accurate, 0.8× speedup?

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

                                      1. Initial program 95.8%

                                        \[\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 rewrites64.8%

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

                                        if -5.00000000000000011e63 < (*.f64 a b) < 2.00000000000000005e-146

                                        1. Initial program 98.2%

                                          \[\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 rewrites36.9%

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

                                          if 2.00000000000000005e-146 < (*.f64 a b) < 2.00000000000000007e139

                                          1. Initial program 96.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} \]
                                          4. Step-by-step derivation
                                            1. Applied rewrites44.6%

                                              \[\leadsto \color{blue}{t \cdot z} \]
                                          5. Recombined 3 regimes into one program.
                                          6. Final simplification48.7%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+63}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-146}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+139}:\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
                                          7. Add Preprocessing

                                          Alternative 9: 66.5% accurate, 0.9× speedup?

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

                                            1. Initial program 91.1%

                                              \[\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 rewrites79.3%

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

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

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

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

                                                  \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
                                                5. lower-fma.f6482.7

                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
                                              3. Applied rewrites82.7%

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

                                              if -5.00000000000000025e116 < (*.f64 c i) < 2.00000000000000015e70

                                              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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites70.9%

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

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

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

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

                                                Alternative 10: 66.5% accurate, 0.9× speedup?

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

                                                  1. Initial program 91.1%

                                                    \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites87.0%

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

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

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

                                                      if -5.00000000000000025e116 < (*.f64 c i) < 2.00000000000000015e70

                                                      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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + x \cdot y\right)} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites70.9%

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

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

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

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

                                                        Alternative 11: 62.9% accurate, 0.9× speedup?

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

                                                          1. Initial program 93.4%

                                                            \[\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 rewrites84.8%

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

                                                            if -inf.0 < (*.f64 x y) < 1.9999999999999998e131

                                                            1. Initial program 97.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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              Alternative 12: 66.7% accurate, 0.9× speedup?

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

                                                                1. Initial program 97.5%

                                                                  \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  if -1e108 < (*.f64 z t) < 5.00000000000000022e41

                                                                  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. 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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if 5.00000000000000022e41 < (*.f64 z t)

                                                                      1. Initial program 92.7%

                                                                        \[\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. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{c \cdot i}\right) \]
                                                                      6. Step-by-step derivation
                                                                        1. Applied rewrites78.0%

                                                                          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{c \cdot i}\right) \]
                                                                      7. Recombined 3 regimes into one program.
                                                                      8. Final simplification74.4%

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

                                                                      Alternative 13: 42.5% accurate, 1.1× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+109} \lor \neg \left(c \cdot i \leq 4 \cdot 10^{+75}\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) -1e+109) (not (<= (* c i) 4e+75))) (* 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) <= -1e+109) || !((c * i) <= 4e+75)) {
                                                                      		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) <= (-1d+109)) .or. (.not. ((c * i) <= 4d+75))) 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) <= -1e+109) || !((c * i) <= 4e+75)) {
                                                                      		tmp = i * c;
                                                                      	} else {
                                                                      		tmp = b * a;
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      def code(x, y, z, t, a, b, c, i):
                                                                      	tmp = 0
                                                                      	if ((c * i) <= -1e+109) or not ((c * i) <= 4e+75):
                                                                      		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) <= -1e+109) || !(Float64(c * i) <= 4e+75))
                                                                      		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) <= -1e+109) || ~(((c * i) <= 4e+75)))
                                                                      		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], -1e+109], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4e+75]], $MachinePrecision]], N[(i * c), $MachinePrecision], N[(b * a), $MachinePrecision]]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      \mathbf{if}\;c \cdot i \leq -1 \cdot 10^{+109} \lor \neg \left(c \cdot i \leq 4 \cdot 10^{+75}\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) < -9.99999999999999982e108 or 3.99999999999999971e75 < (*.f64 c i)

                                                                        1. Initial program 91.1%

                                                                          \[\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 rewrites68.6%

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

                                                                          if -9.99999999999999982e108 < (*.f64 c i) < 3.99999999999999971e75

                                                                          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 rewrites33.7%

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

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

                                                                          Alternative 14: 27.2% 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 96.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 rewrites27.9%

                                                                              \[\leadsto \color{blue}{b \cdot a} \]
                                                                            2. Final simplification27.9%

                                                                              \[\leadsto b \cdot a \]
                                                                            3. Add Preprocessing

                                                                            Reproduce

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