Linear.V3:$cdot from linear-1.19.1.3, B

Percentage Accurate: 97.7% → 99.0%
Time: 3.6s
Alternatives: 8
Speedup: 1.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 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: 97.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.0% accurate, 1.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, x, \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right)\right) \]
    13. lower-*.f6498.0

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, x, \mathsf{fma}\left(b, a, t \cdot z\right)\right)} \]
  5. Final simplification98.0%

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

Alternative 2: 54.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+78}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 10^{-188}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+44}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+75}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (* x y) -5e+78)
   (* x y)
   (if (<= (* x y) 1e-188)
     (* a b)
     (if (<= (* x y) 4e+44) (* z t) (if (<= (* x y) 5e+75) (* a b) (* x y))))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x * y) <= -5e+78) {
		tmp = x * y;
	} else if ((x * y) <= 1e-188) {
		tmp = a * b;
	} else if ((x * y) <= 4e+44) {
		tmp = z * t;
	} else if ((x * y) <= 5e+75) {
		tmp = a * b;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if ((x * y) <= (-5d+78)) then
        tmp = x * y
    else if ((x * y) <= 1d-188) then
        tmp = a * b
    else if ((x * y) <= 4d+44) then
        tmp = z * t
    else if ((x * y) <= 5d+75) then
        tmp = a * b
    else
        tmp = x * y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x * y) <= -5e+78) {
		tmp = x * y;
	} else if ((x * y) <= 1e-188) {
		tmp = a * b;
	} else if ((x * y) <= 4e+44) {
		tmp = z * t;
	} else if ((x * y) <= 5e+75) {
		tmp = a * b;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (x * y) <= -5e+78:
		tmp = x * y
	elif (x * y) <= 1e-188:
		tmp = a * b
	elif (x * y) <= 4e+44:
		tmp = z * t
	elif (x * y) <= 5e+75:
		tmp = a * b
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(x * y) <= -5e+78)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 1e-188)
		tmp = Float64(a * b);
	elseif (Float64(x * y) <= 4e+44)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 5e+75)
		tmp = Float64(a * b);
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((x * y) <= -5e+78)
		tmp = x * y;
	elseif ((x * y) <= 1e-188)
		tmp = a * b;
	elseif ((x * y) <= 4e+44)
		tmp = z * t;
	elseif ((x * y) <= 5e+75)
		tmp = a * b;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * y), $MachinePrecision], -5e+78], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 1e-188], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+44], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e+75], N[(a * b), $MachinePrecision], N[(x * y), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+78}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq 10^{-188}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+44}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+75}:\\
\;\;\;\;a \cdot b\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.99999999999999984e78 or 5.0000000000000002e75 < (*.f64 x y)

    1. Initial program 94.1%

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

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

        \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
      3. lower-*.f6429.2

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
    5. Applied rewrites29.2%

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

      \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
    7. Step-by-step derivation
      1. lower-fma.f64N/A

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

        \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
      3. lower-*.f6488.0

        \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
    8. Applied rewrites88.0%

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

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

        \[\leadsto t \cdot \color{blue}{z} \]
      2. Taylor expanded in x around inf

        \[\leadsto \color{blue}{x \cdot y} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{y \cdot x} \]
        2. lower-*.f6473.7

          \[\leadsto \color{blue}{y \cdot x} \]
      4. Applied rewrites73.7%

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

      if -4.99999999999999984e78 < (*.f64 x y) < 9.9999999999999995e-189 or 4.0000000000000004e44 < (*.f64 x y) < 5.0000000000000002e75

      1. Initial program 98.2%

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

        \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{b \cdot a} + x \cdot y \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, x \cdot y\right)} \]
        3. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
        4. lower-*.f6463.1

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
      5. Applied rewrites63.1%

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

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

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

        if 9.9999999999999995e-189 < (*.f64 x y) < 4.0000000000000004e44

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
          3. lower-*.f6485.6

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
        5. Applied rewrites85.6%

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

          \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
        7. Step-by-step derivation
          1. lower-fma.f64N/A

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

            \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
          3. lower-*.f6473.8

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

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

          \[\leadsto t \cdot \color{blue}{z} \]
        10. Step-by-step derivation
          1. Applied rewrites59.2%

            \[\leadsto t \cdot \color{blue}{z} \]
        11. Recombined 3 regimes into one program.
        12. Final simplification62.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+78}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 10^{-188}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+44}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+75}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
        13. Add Preprocessing

        Alternative 3: 84.5% accurate, 0.6× speedup?

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

          1. Initial program 93.6%

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

            \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + x \cdot y \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, x \cdot y\right)} \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
            4. lower-*.f6483.9

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
          5. Applied rewrites83.9%

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

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

            if -2.00000000000000002e-35 < (*.f64 x y) < 5.0000000000000002e75

            1. Initial program 99.2%

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

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

                \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
              3. lower-*.f6492.2

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
            5. Applied rewrites92.2%

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

            if 5.0000000000000002e75 < (*.f64 x y)

            1. Initial program 95.5%

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

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

                \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
              3. lower-*.f6431.5

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

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

              \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
            7. Step-by-step derivation
              1. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
              3. lower-*.f6487.6

                \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
            8. Applied rewrites87.6%

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

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

          Alternative 4: 84.5% accurate, 0.6× speedup?

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

            1. Initial program 93.6%

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

              \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + x \cdot y \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, x \cdot y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
              4. lower-*.f6483.9

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
            5. Applied rewrites83.9%

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

            if -2.00000000000000002e-35 < (*.f64 x y) < 5.0000000000000002e75

            1. Initial program 99.2%

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

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

                \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
              3. lower-*.f6492.2

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
            5. Applied rewrites92.2%

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

            if 5.0000000000000002e75 < (*.f64 x y)

            1. Initial program 95.5%

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

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

                \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
              3. lower-*.f6431.5

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

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

              \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
            7. Step-by-step derivation
              1. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
              3. lower-*.f6487.6

                \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
            8. Applied rewrites87.6%

              \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, y \cdot x\right)} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification88.9%

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

          Alternative 5: 84.6% accurate, 0.6× speedup?

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

            1. Initial program 94.7%

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

              \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + x \cdot y \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, x \cdot y\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
              4. lower-*.f6483.5

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

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

            if -2.00000000000000002e-35 < (*.f64 x y) < 4.0000000000000004e44

            1. Initial program 99.2%

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

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

                \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
              3. lower-*.f6493.6

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
            5. Applied rewrites93.6%

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

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

          Alternative 6: 79.7% accurate, 0.6× speedup?

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

            1. Initial program 93.4%

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

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

                \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
              3. lower-*.f6425.2

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
            5. Applied rewrites25.2%

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

              \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
            7. Step-by-step derivation
              1. lower-fma.f64N/A

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

                \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
              3. lower-*.f6490.2

                \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
            8. Applied rewrites90.2%

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

              \[\leadsto t \cdot \color{blue}{z} \]
            10. Step-by-step derivation
              1. Applied rewrites15.5%

                \[\leadsto t \cdot \color{blue}{z} \]
              2. Taylor expanded in x around inf

                \[\leadsto \color{blue}{x \cdot y} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{y \cdot x} \]
                2. lower-*.f6478.3

                  \[\leadsto \color{blue}{y \cdot x} \]
              4. Applied rewrites78.3%

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

              if -4.99999999999999984e78 < (*.f64 x y) < 5.00000000000000008e140

              1. Initial program 98.8%

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

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

                  \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
                2. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
                3. lower-*.f6486.0

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
              5. Applied rewrites86.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
            11. Recombined 2 regimes into one program.
            12. Final simplification83.2%

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

            Alternative 7: 54.1% accurate, 0.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-5}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+79}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \end{array} \]
            (FPCore (x y z t a b)
             :precision binary64
             (if (<= (* z t) -1e-5) (* z t) (if (<= (* z t) 2e+79) (* a b) (* z t))))
            double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((z * t) <= -1e-5) {
            		tmp = z * t;
            	} else if ((z * t) <= 2e+79) {
            		tmp = a * b;
            	} else {
            		tmp = z * t;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z, t, a, b)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: t
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8) :: tmp
                if ((z * t) <= (-1d-5)) then
                    tmp = z * t
                else if ((z * t) <= 2d+79) then
                    tmp = a * b
                else
                    tmp = z * t
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double t, double a, double b) {
            	double tmp;
            	if ((z * t) <= -1e-5) {
            		tmp = z * t;
            	} else if ((z * t) <= 2e+79) {
            		tmp = a * b;
            	} else {
            		tmp = z * t;
            	}
            	return tmp;
            }
            
            def code(x, y, z, t, a, b):
            	tmp = 0
            	if (z * t) <= -1e-5:
            		tmp = z * t
            	elif (z * t) <= 2e+79:
            		tmp = a * b
            	else:
            		tmp = z * t
            	return tmp
            
            function code(x, y, z, t, a, b)
            	tmp = 0.0
            	if (Float64(z * t) <= -1e-5)
            		tmp = Float64(z * t);
            	elseif (Float64(z * t) <= 2e+79)
            		tmp = Float64(a * b);
            	else
            		tmp = Float64(z * t);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, t, a, b)
            	tmp = 0.0;
            	if ((z * t) <= -1e-5)
            		tmp = z * t;
            	elseif ((z * t) <= 2e+79)
            		tmp = a * b;
            	else
            		tmp = z * t;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e-5], N[(z * t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+79], N[(a * b), $MachinePrecision], N[(z * t), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-5}:\\
            \;\;\;\;z \cdot t\\
            
            \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+79}:\\
            \;\;\;\;a \cdot b\\
            
            \mathbf{else}:\\
            \;\;\;\;z \cdot t\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 z t) < -1.00000000000000008e-5 or 1.99999999999999993e79 < (*.f64 z t)

              1. Initial program 94.0%

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

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

                  \[\leadsto \color{blue}{b \cdot a} + t \cdot z \]
                2. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z\right)} \]
                3. lower-*.f6474.3

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

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

                \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
              7. Step-by-step derivation
                1. lower-fma.f64N/A

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

                  \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
                3. lower-*.f6485.1

                  \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
              8. Applied rewrites85.1%

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

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

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

                if -1.00000000000000008e-5 < (*.f64 z t) < 1.99999999999999993e79

                1. Initial program 99.3%

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

                  \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + x \cdot y \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, x \cdot y\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
                  4. lower-*.f6491.8

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
                5. Applied rewrites91.8%

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

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

                    \[\leadsto b \cdot \color{blue}{a} \]
                8. Recombined 2 regimes into one program.
                9. Final simplification54.4%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -1 \cdot 10^{-5}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+79}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]
                10. Add Preprocessing

                Alternative 8: 35.1% accurate, 3.7× speedup?

                \[\begin{array}{l} \\ a \cdot b \end{array} \]
                (FPCore (x y z t a b) :precision binary64 (* a b))
                double code(double x, double y, double z, double t, double a, double b) {
                	return a * b;
                }
                
                real(8) function code(x, y, z, t, a, b)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = a * b
                end function
                
                public static double code(double x, double y, double z, double t, double a, double b) {
                	return a * b;
                }
                
                def code(x, y, z, t, a, b):
                	return a * b
                
                function code(x, y, z, t, a, b)
                	return Float64(a * b)
                end
                
                function tmp = code(x, y, z, t, a, b)
                	tmp = a * b;
                end
                
                code[x_, y_, z_, t_, a_, b_] := N[(a * b), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                a \cdot b
                \end{array}
                
                Derivation
                1. Initial program 96.9%

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

                  \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + x \cdot y \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, x \cdot y\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
                  4. lower-*.f6467.8

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x}\right) \]
                5. Applied rewrites67.8%

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

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

                    \[\leadsto b \cdot \color{blue}{a} \]
                  2. Final simplification34.1%

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

                  Reproduce

                  ?
                  herbie shell --seed 2024332 
                  (FPCore (x y z t a b)
                    :name "Linear.V3:$cdot from linear-1.19.1.3, B"
                    :precision binary64
                    (+ (+ (* x y) (* z t)) (* a b)))