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

Percentage Accurate: 97.6% → 98.8%
Time: 5.7s
Alternatives: 6
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 6 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.6% 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.8% accurate, 1.2× speedup?

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

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

    \[\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. lift-*.f64N/A

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

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

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

Alternative 2: 86.3% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -1.9999999999999999e61 or 2e51 < (*.f64 a b)

    1. Initial program 96.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. lower-fma.f64N/A

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

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

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

    if -1.9999999999999999e61 < (*.f64 a b) < 2e51

    1. Initial program 97.9%

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

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

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

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

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

Alternative 3: 84.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 1.16 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(a, b, 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.2e153 or 1.1600000000000001e113 < (*.f64 x y)

    1. Initial program 91.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. lower-fma.f64N/A

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

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

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

    if -2.2e153 < (*.f64 x y) < 1.1600000000000001e113

    1. Initial program 99.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. lower-fma.f64N/A

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

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

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

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

Alternative 4: 80.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.5 \cdot 10^{+158}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{+180}:\\ \;\;\;\;\mathsf{fma}\left(a, b, 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) -9.5e+158)
   (* x y)
   (if (<= (* x y) 3.6e+180) (fma a b (* z t)) (* x y))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x * y) <= -9.5e+158) {
		tmp = x * y;
	} else if ((x * y) <= 3.6e+180) {
		tmp = fma(a, b, (z * t));
	} else {
		tmp = x * y;
	}
	return tmp;
}
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(x * y) <= -9.5e+158)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= 3.6e+180)
		tmp = fma(a, b, 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], -9.5e+158], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.6e+180], N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 3.6 \cdot 10^{+180}:\\
\;\;\;\;\mathsf{fma}\left(a, b, 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) < -9.49999999999999913e158 or 3.6000000000000002e180 < (*.f64 x y)

    1. Initial program 92.5%

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

      \[\leadsto \color{blue}{x \cdot y} \]
    4. Step-by-step derivation
      1. lower-*.f6485.0

        \[\leadsto \color{blue}{x \cdot y} \]
    5. Applied rewrites85.0%

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

    if -9.49999999999999913e158 < (*.f64 x y) < 3.6000000000000002e180

    1. Initial program 98.9%

      \[\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. lower-fma.f64N/A

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

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

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

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

Alternative 5: 54.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -9 \cdot 10^{+59}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{+51}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (<= (* a b) -9e+59) (* a b) (if (<= (* a b) 5.4e+51) (* z t) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a * b) <= -9e+59) {
		tmp = a * b;
	} else if ((a * b) <= 5.4e+51) {
		tmp = z * t;
	} else {
		tmp = a * b;
	}
	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 ((a * b) <= (-9d+59)) then
        tmp = a * b
    else if ((a * b) <= 5.4d+51) then
        tmp = z * t
    else
        tmp = a * b
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a * b) <= -9e+59) {
		tmp = a * b;
	} else if ((a * b) <= 5.4e+51) {
		tmp = z * t;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if (a * b) <= -9e+59:
		tmp = a * b
	elif (a * b) <= 5.4e+51:
		tmp = z * t
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (Float64(a * b) <= -9e+59)
		tmp = Float64(a * b);
	elseif (Float64(a * b) <= 5.4e+51)
		tmp = Float64(z * t);
	else
		tmp = Float64(a * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a * b) <= -9e+59)
		tmp = a * b;
	elseif ((a * b) <= 5.4e+51)
		tmp = z * t;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(a * b), $MachinePrecision], -9e+59], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5.4e+51], N[(z * t), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -9 \cdot 10^{+59}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{+51}:\\
\;\;\;\;z \cdot t\\

\mathbf{else}:\\
\;\;\;\;a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -8.99999999999999919e59 or 5.39999999999999983e51 < (*.f64 a b)

    1. Initial program 96.4%

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

      \[\leadsto \color{blue}{a \cdot b} \]
    4. Step-by-step derivation
      1. lower-*.f6468.9

        \[\leadsto \color{blue}{a \cdot b} \]
    5. Applied rewrites68.9%

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

    if -8.99999999999999919e59 < (*.f64 a b) < 5.39999999999999983e51

    1. Initial program 97.9%

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

      \[\leadsto \color{blue}{t \cdot z} \]
    4. Step-by-step derivation
      1. lower-*.f6454.9

        \[\leadsto \color{blue}{t \cdot z} \]
    5. Applied rewrites54.9%

      \[\leadsto \color{blue}{t \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.0%

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

Alternative 6: 34.9% 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 97.2%

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

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Step-by-step derivation
    1. lower-*.f6435.5

      \[\leadsto \color{blue}{a \cdot b} \]
  5. Applied rewrites35.5%

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

Reproduce

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