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

Percentage Accurate: 97.8% → 98.9%
Time: 5.4s
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.8% 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: 98.9% accurate, 1.2× speedup?

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

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

    \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+76} \lor \neg \left(x \cdot y \leq 2 \cdot 10^{+31}\right):\\
\;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -2.0000000000000001e76 or 1.9999999999999999e31 < (*.f64 x y)

    1. Initial program 94.4%

      \[\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-*.f6484.8

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

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

    if -2.0000000000000001e76 < (*.f64 x y) < 1.9999999999999999e31

    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-*.f6490.9

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

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

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

Alternative 3: 80.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{+153} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+141}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= (* x y) -1.5e+153) (not (<= (* x y) 7.5e+141)))
   (* y x)
   (fma b a (* t z))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (((x * y) <= -1.5e+153) || !((x * y) <= 7.5e+141)) {
		tmp = y * x;
	} else {
		tmp = fma(b, a, (t * z));
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((Float64(x * y) <= -1.5e+153) || !(Float64(x * y) <= 7.5e+141))
		tmp = Float64(y * x);
	else
		tmp = fma(b, a, Float64(t * z));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.5e+153], N[Not[LessEqual[N[(x * y), $MachinePrecision], 7.5e+141]], $MachinePrecision]], N[(y * x), $MachinePrecision], N[(b * a + N[(t * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{+153} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+141}\right):\\
\;\;\;\;y \cdot x\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.50000000000000009e153 or 7.49999999999999937e141 < (*.f64 x y)

    1. Initial program 92.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-*.f6426.5

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
    5. Applied rewrites26.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-*.f6488.9

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

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

        \[\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-*.f6479.4

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

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

      if -1.50000000000000009e153 < (*.f64 x y) < 7.49999999999999937e141

      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.2

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.5 \cdot 10^{+153} \lor \neg \left(x \cdot y \leq 7.5 \cdot 10^{+141}\right):\\ \;\;\;\;y \cdot x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \end{array} \]
    13. Add Preprocessing

    Alternative 4: 86.3% accurate, 0.6× speedup?

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

      1. Initial program 98.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-*.f6475.1

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

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

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

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

      if -5.0000000000000004e53 < (*.f64 z t) < 2e10

      1. Initial program 97.8%

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

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

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

      if 2e10 < (*.f64 z t)

      1. Initial program 96.6%

        \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 86.2% accurate, 0.6× speedup?

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

      1. Initial program 98.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-*.f6475.1

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

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

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

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

      if -5.0000000000000004e53 < (*.f64 z t) < 2e10

      1. Initial program 97.8%

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

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

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

      if 2e10 < (*.f64 z t)

      1. Initial program 96.6%

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

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

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

    Alternative 6: 54.1% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+53} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+112}\right):\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \end{array} \]
    (FPCore (x y z t a b)
     :precision binary64
     (if (or (<= (* z t) -5e+53) (not (<= (* z t) 5e+112))) (* t z) (* b a)))
    double code(double x, double y, double z, double t, double a, double b) {
    	double tmp;
    	if (((z * t) <= -5e+53) || !((z * t) <= 5e+112)) {
    		tmp = t * z;
    	} else {
    		tmp = b * a;
    	}
    	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) <= (-5d+53)) .or. (.not. ((z * t) <= 5d+112))) 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 tmp;
    	if (((z * t) <= -5e+53) || !((z * t) <= 5e+112)) {
    		tmp = t * z;
    	} else {
    		tmp = b * a;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t, a, b):
    	tmp = 0
    	if ((z * t) <= -5e+53) or not ((z * t) <= 5e+112):
    		tmp = t * z
    	else:
    		tmp = b * a
    	return tmp
    
    function code(x, y, z, t, a, b)
    	tmp = 0.0
    	if ((Float64(z * t) <= -5e+53) || !(Float64(z * t) <= 5e+112))
    		tmp = Float64(t * z);
    	else
    		tmp = Float64(b * a);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t, a, b)
    	tmp = 0.0;
    	if (((z * t) <= -5e+53) || ~(((z * t) <= 5e+112)))
    		tmp = t * z;
    	else
    		tmp = b * a;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], -5e+53], N[Not[LessEqual[N[(z * t), $MachinePrecision], 5e+112]], $MachinePrecision]], N[(t * z), $MachinePrecision], N[(b * a), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+53} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+112}\right):\\
    \;\;\;\;t \cdot z\\
    
    \mathbf{else}:\\
    \;\;\;\;b \cdot a\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 z t) < -5.0000000000000004e53 or 5e112 < (*.f64 z t)

      1. Initial program 97.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-*.f6481.3

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{t \cdot z}\right) \]
      5. Applied rewrites81.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-*.f6491.0

          \[\leadsto \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right) \]
      8. Applied rewrites91.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 rewrites72.3%

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

        if -5.0000000000000004e53 < (*.f64 z t) < 5e112

        1. Initial program 98.0%

          \[\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-*.f6488.6

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+53} \lor \neg \left(z \cdot t \leq 5 \cdot 10^{+112}\right):\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;b \cdot a\\ \end{array} \]
        10. Add Preprocessing

        Alternative 7: 48.4% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-25}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-109}:\\ \;\;\;\;b \cdot a\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+70}:\\ \;\;\;\;t \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot x\\ \end{array} \end{array} \]
        (FPCore (x y z t a b)
         :precision binary64
         (if (<= y -2.2e-25)
           (* y x)
           (if (<= y 4.2e-109) (* b a) (if (<= y 1.9e+70) (* t z) (* y x)))))
        double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if (y <= -2.2e-25) {
        		tmp = y * x;
        	} else if (y <= 4.2e-109) {
        		tmp = b * a;
        	} else if (y <= 1.9e+70) {
        		tmp = t * z;
        	} else {
        		tmp = y * x;
        	}
        	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 (y <= (-2.2d-25)) then
                tmp = y * x
            else if (y <= 4.2d-109) then
                tmp = b * a
            else if (y <= 1.9d+70) then
                tmp = t * z
            else
                tmp = y * x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t, double a, double b) {
        	double tmp;
        	if (y <= -2.2e-25) {
        		tmp = y * x;
        	} else if (y <= 4.2e-109) {
        		tmp = b * a;
        	} else if (y <= 1.9e+70) {
        		tmp = t * z;
        	} else {
        		tmp = y * x;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t, a, b):
        	tmp = 0
        	if y <= -2.2e-25:
        		tmp = y * x
        	elif y <= 4.2e-109:
        		tmp = b * a
        	elif y <= 1.9e+70:
        		tmp = t * z
        	else:
        		tmp = y * x
        	return tmp
        
        function code(x, y, z, t, a, b)
        	tmp = 0.0
        	if (y <= -2.2e-25)
        		tmp = Float64(y * x);
        	elseif (y <= 4.2e-109)
        		tmp = Float64(b * a);
        	elseif (y <= 1.9e+70)
        		tmp = Float64(t * z);
        	else
        		tmp = Float64(y * x);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t, a, b)
        	tmp = 0.0;
        	if (y <= -2.2e-25)
        		tmp = y * x;
        	elseif (y <= 4.2e-109)
        		tmp = b * a;
        	elseif (y <= 1.9e+70)
        		tmp = t * z;
        	else
        		tmp = y * x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e-25], N[(y * x), $MachinePrecision], If[LessEqual[y, 4.2e-109], N[(b * a), $MachinePrecision], If[LessEqual[y, 1.9e+70], N[(t * z), $MachinePrecision], N[(y * x), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -2.2 \cdot 10^{-25}:\\
        \;\;\;\;y \cdot x\\
        
        \mathbf{elif}\;y \leq 4.2 \cdot 10^{-109}:\\
        \;\;\;\;b \cdot a\\
        
        \mathbf{elif}\;y \leq 1.9 \cdot 10^{+70}:\\
        \;\;\;\;t \cdot z\\
        
        \mathbf{else}:\\
        \;\;\;\;y \cdot x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -2.2000000000000002e-25 or 1.8999999999999999e70 < y

          1. Initial program 95.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-*.f6449.9

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

            \[\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-*.f6478.6

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

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

              \[\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-*.f6453.3

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

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

            if -2.2000000000000002e-25 < y < 4.19999999999999992e-109

            1. Initial program 100.0%

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

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

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

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

              if 4.19999999999999992e-109 < y < 1.8999999999999999e70

              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-*.f6472.8

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

                \[\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-*.f6476.5

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

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

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

              Alternative 8: 35.4% accurate, 3.7× speedup?

              \[\begin{array}{l} \\ b \cdot a \end{array} \]
              (FPCore (x y z t a b) :precision binary64 (* b a))
              double code(double x, double y, double z, double t, double a, double b) {
              	return b * a;
              }
              
              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 = b * a
              end function
              
              public static double code(double x, double y, double z, double t, double a, double b) {
              	return b * a;
              }
              
              def code(x, y, z, t, a, b):
              	return b * a
              
              function code(x, y, z, t, a, b)
              	return Float64(b * a)
              end
              
              function tmp = code(x, y, z, t, a, b)
              	tmp = b * a;
              end
              
              code[x_, y_, z_, t_, a_, b_] := N[(b * a), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              b \cdot a
              \end{array}
              
              Derivation
              1. Initial program 97.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-*.f6465.5

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

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

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

                Reproduce

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