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

Percentage Accurate: 95.8% → 97.8%
Time: 15.4s
Alternatives: 15
Speedup: 0.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 95.8% accurate, 1.0× speedup?

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

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

Alternative 1: 97.8% accurate, 0.0× speedup?

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

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

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Step-by-step derivation
    1. +-commutative95.3%

      \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    2. fma-def96.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    3. +-commutative96.9%

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

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

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

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

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

Alternative 2: 97.5% accurate, 0.1× speedup?

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

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

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Step-by-step derivation
    1. +-commutative95.3%

      \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    2. fma-def96.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    3. associate-+l+96.9%

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-udef97.3%

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

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

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

Alternative 3: 97.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(c, i, a \cdot b\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
   (if (<= t_1 INFINITY) t_1 (fma c i (* a b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(c, i, (a * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = fma(c, i, Float64(a * b));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * i + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i))

    1. Initial program 0.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Step-by-step derivation
      1. +-commutative0.0%

        \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      2. fma-def33.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      3. associate-+l+33.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef41.7%

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

      \[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \color{blue}{z \cdot t + a \cdot b}\right)\right) \]
    7. Step-by-step derivation
      1. fma-udef33.3%

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

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

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

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

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

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

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

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

Alternative 4: 96.8% accurate, 0.1× speedup?

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

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

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Step-by-step derivation
    1. +-commutative95.3%

      \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    2. fma-def96.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    3. +-commutative96.9%

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-udef96.9%

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

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

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

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

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

Alternative 5: 97.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
   (if (<= t_1 INFINITY) t_1 (+ (* c i) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (c * i) + (z * t)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * i) + Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (c * i) + (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i))

    1. Initial program 0.0%

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

      \[\leadsto \color{blue}{\left(t \cdot z + x \cdot y\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. fma-def41.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)} + c \cdot i \]
    5. Simplified41.7%

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

      \[\leadsto \color{blue}{c \cdot i + t \cdot z} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right) \leq \infty:\\ \;\;\;\;c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 42.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -8.1 \cdot 10^{+217}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 1.1 \cdot 10^{-135}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+68}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 5.8 \cdot 10^{+136}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* c i) -8.1e+217)
   (* c i)
   (if (<= (* c i) 1.1e-135)
     (* z t)
     (if (<= (* c i) 1.5e+68)
       (* a b)
       (if (<= (* c i) 5.8e+136) (* z t) (* c i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -8.1e+217) {
		tmp = c * i;
	} else if ((c * i) <= 1.1e-135) {
		tmp = z * t;
	} else if ((c * i) <= 1.5e+68) {
		tmp = a * b;
	} else if ((c * i) <= 5.8e+136) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((c * i) <= (-8.1d+217)) then
        tmp = c * i
    else if ((c * i) <= 1.1d-135) then
        tmp = z * t
    else if ((c * i) <= 1.5d+68) then
        tmp = a * b
    else if ((c * i) <= 5.8d+136) then
        tmp = z * t
    else
        tmp = c * i
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -8.1e+217) {
		tmp = c * i;
	} else if ((c * i) <= 1.1e-135) {
		tmp = z * t;
	} else if ((c * i) <= 1.5e+68) {
		tmp = a * b;
	} else if ((c * i) <= 5.8e+136) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -8.1e+217:
		tmp = c * i
	elif (c * i) <= 1.1e-135:
		tmp = z * t
	elif (c * i) <= 1.5e+68:
		tmp = a * b
	elif (c * i) <= 5.8e+136:
		tmp = z * t
	else:
		tmp = c * i
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(c * i) <= -8.1e+217)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= 1.1e-135)
		tmp = Float64(z * t);
	elseif (Float64(c * i) <= 1.5e+68)
		tmp = Float64(a * b);
	elseif (Float64(c * i) <= 5.8e+136)
		tmp = Float64(z * t);
	else
		tmp = Float64(c * i);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c * i) <= -8.1e+217)
		tmp = c * i;
	elseif ((c * i) <= 1.1e-135)
		tmp = z * t;
	elseif ((c * i) <= 1.5e+68)
		tmp = a * b;
	elseif ((c * i) <= 5.8e+136)
		tmp = z * t;
	else
		tmp = c * i;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -8.1e+217], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.1e-135], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.5e+68], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 5.8e+136], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -8.1 \cdot 10^{+217}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;c \cdot i \leq 1.1 \cdot 10^{-135}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+68}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;c \cdot i \leq 5.8 \cdot 10^{+136}:\\
\;\;\;\;z \cdot t\\

\mathbf{else}:\\
\;\;\;\;c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -8.0999999999999996e217 or 5.79999999999999949e136 < (*.f64 c i)

    1. Initial program 88.0%

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

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

    if -8.0999999999999996e217 < (*.f64 c i) < 1.1e-135 or 1.5000000000000001e68 < (*.f64 c i) < 5.79999999999999949e136

    1. Initial program 98.0%

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

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

    if 1.1e-135 < (*.f64 c i) < 1.5000000000000001e68

    1. Initial program 97.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -8.1 \cdot 10^{+217}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 1.1 \cdot 10^{-135}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+68}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 5.8 \cdot 10^{+136}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 75.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+95} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+110}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t))))
   (if (or (<= t_1 -1e+95) (not (<= t_1 5e+110))) t_1 (+ (* a b) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if ((t_1 <= -1e+95) || !(t_1 <= 5e+110)) {
		tmp = t_1;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) + (z * t)
    if ((t_1 <= (-1d+95)) .or. (.not. (t_1 <= 5d+110))) then
        tmp = t_1
    else
        tmp = (a * b) + (c * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if ((t_1 <= -1e+95) || !(t_1 <= 5e+110)) {
		tmp = t_1;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) + (z * t)
	tmp = 0
	if (t_1 <= -1e+95) or not (t_1 <= 5e+110):
		tmp = t_1
	else:
		tmp = (a * b) + (c * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if ((t_1 <= -1e+95) || !(t_1 <= 5e+110))
		tmp = t_1;
	else
		tmp = Float64(Float64(a * b) + Float64(c * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x * y) + (z * t);
	tmp = 0.0;
	if ((t_1 <= -1e+95) || ~((t_1 <= 5e+110)))
		tmp = t_1;
	else
		tmp = (a * b) + (c * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+95], N[Not[LessEqual[t$95$1, 5e+110]], $MachinePrecision]], t$95$1, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+95} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+110}\right):\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -1.00000000000000002e95 or 4.99999999999999978e110 < (+.f64 (*.f64 x y) (*.f64 z t))

    1. Initial program 94.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Step-by-step derivation
      1. +-commutative94.0%

        \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      2. fma-def96.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      3. associate-+l+96.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef96.7%

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

      \[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \color{blue}{z \cdot t + a \cdot b}\right)\right) \]
    7. Step-by-step derivation
      1. fma-udef96.0%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\left(x \cdot y + a \cdot b\right) + z \cdot t}\right) \]
    9. Step-by-step derivation
      1. fma-udef94.0%

        \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + a \cdot b\right) + z \cdot t\right)} \]
      2. *-commutative94.0%

        \[\leadsto c \cdot i + \left(\left(x \cdot y + a \cdot b\right) + \color{blue}{t \cdot z}\right) \]
      3. associate-+r+94.0%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot y} + z \cdot t \]

    if -1.00000000000000002e95 < (+.f64 (*.f64 x y) (*.f64 z t)) < 4.99999999999999978e110

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{\left(a \cdot b + t \cdot z\right)} + c \cdot i \]
    4. Taylor expanded in t around 0 74.4%

      \[\leadsto \color{blue}{a \cdot b + c \cdot i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.6%

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

Alternative 8: 84.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.3 \cdot 10^{+54} \lor \neg \left(c \cdot i \leq 3.5 \cdot 10^{+135}\right):\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* c i) -1.3e+54) (not (<= (* c i) 3.5e+135)))
   (+ (* c i) (* z t))
   (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -1.3e+54) || !((c * i) <= 3.5e+135)) {
		tmp = (c * i) + (z * t);
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-1.3d+54)) .or. (.not. ((c * i) <= 3.5d+135))) then
        tmp = (c * i) + (z * t)
    else
        tmp = (a * b) + ((x * y) + (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 c, double i) {
	double tmp;
	if (((c * i) <= -1.3e+54) || !((c * i) <= 3.5e+135)) {
		tmp = (c * i) + (z * t);
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -1.3e+54) or not ((c * i) <= 3.5e+135):
		tmp = (c * i) + (z * t)
	else:
		tmp = (a * b) + ((x * y) + (z * t))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -1.3e+54) || !(Float64(c * i) <= 3.5e+135))
		tmp = Float64(Float64(c * i) + Float64(z * t));
	else
		tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -1.3e+54) || ~(((c * i) <= 3.5e+135)))
		tmp = (c * i) + (z * t);
	else
		tmp = (a * b) + ((x * y) + (z * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -1.3e+54], N[Not[LessEqual[N[(c * i), $MachinePrecision], 3.5e+135]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.3 \cdot 10^{+54} \lor \neg \left(c \cdot i \leq 3.5 \cdot 10^{+135}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -1.30000000000000003e54 or 3.5000000000000003e135 < (*.f64 c i)

    1. Initial program 90.1%

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

      \[\leadsto \color{blue}{\left(t \cdot z + x \cdot y\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. fma-def88.3%

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

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

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

    if -1.30000000000000003e54 < (*.f64 c i) < 3.5000000000000003e135

    1. Initial program 98.2%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.3%

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

Alternative 9: 88.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+49} \lor \neg \left(c \cdot i \leq 7 \cdot 10^{+64}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* c i) -6e+49) (not (<= (* c i) 7e+64)))
   (+ (* c i) (+ (* a b) (* z t)))
   (+ (* a b) (+ (* x y) (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -6e+49) || !((c * i) <= 7e+64)) {
		tmp = (c * i) + ((a * b) + (z * t));
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-6d+49)) .or. (.not. ((c * i) <= 7d+64))) then
        tmp = (c * i) + ((a * b) + (z * t))
    else
        tmp = (a * b) + ((x * y) + (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 c, double i) {
	double tmp;
	if (((c * i) <= -6e+49) || !((c * i) <= 7e+64)) {
		tmp = (c * i) + ((a * b) + (z * t));
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -6e+49) or not ((c * i) <= 7e+64):
		tmp = (c * i) + ((a * b) + (z * t))
	else:
		tmp = (a * b) + ((x * y) + (z * t))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -6e+49) || !(Float64(c * i) <= 7e+64))
		tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t)));
	else
		tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -6e+49) || ~(((c * i) <= 7e+64)))
		tmp = (c * i) + ((a * b) + (z * t));
	else
		tmp = (a * b) + ((x * y) + (z * t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -6e+49], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7e+64]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6 \cdot 10^{+49} \lor \neg \left(c \cdot i \leq 7 \cdot 10^{+64}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -6.0000000000000005e49 or 6.9999999999999997e64 < (*.f64 c i)

    1. Initial program 91.1%

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

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

    if -6.0000000000000005e49 < (*.f64 c i) < 6.9999999999999997e64

    1. Initial program 98.0%

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

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.5%

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

Alternative 10: 42.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+94}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3 \cdot 10^{-45}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 4.4 \cdot 10^{+146}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* x y) -5.2e+94)
   (* x y)
   (if (<= (* x y) -3e-45)
     (* a b)
     (if (<= (* x y) 4.4e+146) (* z t) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -5.2e+94) {
		tmp = x * y;
	} else if ((x * y) <= -3e-45) {
		tmp = a * b;
	} else if ((x * y) <= 4.4e+146) {
		tmp = z * t;
	} else {
		tmp = x * y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x * y) <= (-5.2d+94)) then
        tmp = x * y
    else if ((x * y) <= (-3d-45)) then
        tmp = a * b
    else if ((x * y) <= 4.4d+146) then
        tmp = z * t
    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 c, double i) {
	double tmp;
	if ((x * y) <= -5.2e+94) {
		tmp = x * y;
	} else if ((x * y) <= -3e-45) {
		tmp = a * b;
	} else if ((x * y) <= 4.4e+146) {
		tmp = z * t;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x * y) <= -5.2e+94:
		tmp = x * y
	elif (x * y) <= -3e-45:
		tmp = a * b
	elif (x * y) <= 4.4e+146:
		tmp = z * t
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(x * y) <= -5.2e+94)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -3e-45)
		tmp = Float64(a * b);
	elseif (Float64(x * y) <= 4.4e+146)
		tmp = Float64(z * t);
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x * y) <= -5.2e+94)
		tmp = x * y;
	elseif ((x * y) <= -3e-45)
		tmp = a * b;
	elseif ((x * y) <= 4.4e+146)
		tmp = z * t;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5.2e+94], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -3e-45], N[(a * b), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.4e+146], N[(z * t), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.1999999999999998e94 or 4.3999999999999996e146 < (*.f64 x y)

    1. Initial program 93.3%

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

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

    if -5.1999999999999998e94 < (*.f64 x y) < -3.00000000000000011e-45

    1. Initial program 99.9%

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

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

    if -3.00000000000000011e-45 < (*.f64 x y) < 4.3999999999999996e146

    1. Initial program 95.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.2 \cdot 10^{+94}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -3 \cdot 10^{-45}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;x \cdot y \leq 4.4 \cdot 10^{+146}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -4.5 \cdot 10^{+54} \lor \neg \left(c \cdot i \leq 1.25 \cdot 10^{+134}\right):\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* c i) -4.5e+54) (not (<= (* c i) 1.25e+134)))
   (+ (* c i) (* z t))
   (+ (* a b) (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -4.5e+54) || !((c * i) <= 1.25e+134)) {
		tmp = (c * i) + (z * t);
	} else {
		tmp = (a * b) + (z * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-4.5d+54)) .or. (.not. ((c * i) <= 1.25d+134))) then
        tmp = (c * i) + (z * t)
    else
        tmp = (a * b) + (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 c, double i) {
	double tmp;
	if (((c * i) <= -4.5e+54) || !((c * i) <= 1.25e+134)) {
		tmp = (c * i) + (z * t);
	} else {
		tmp = (a * b) + (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -4.5e+54) or not ((c * i) <= 1.25e+134):
		tmp = (c * i) + (z * t)
	else:
		tmp = (a * b) + (z * t)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -4.5e+54) || !(Float64(c * i) <= 1.25e+134))
		tmp = Float64(Float64(c * i) + Float64(z * t));
	else
		tmp = Float64(Float64(a * b) + Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -4.5e+54) || ~(((c * i) <= 1.25e+134)))
		tmp = (c * i) + (z * t);
	else
		tmp = (a * b) + (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -4.5e+54], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.25e+134]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -4.5 \cdot 10^{+54} \lor \neg \left(c \cdot i \leq 1.25 \cdot 10^{+134}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -4.49999999999999984e54 or 1.24999999999999995e134 < (*.f64 c i)

    1. Initial program 90.1%

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

      \[\leadsto \color{blue}{\left(t \cdot z + x \cdot y\right)} + c \cdot i \]
    4. Step-by-step derivation
      1. fma-def88.3%

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

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

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

    if -4.49999999999999984e54 < (*.f64 c i) < 1.24999999999999995e134

    1. Initial program 98.2%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Step-by-step derivation
      1. +-commutative98.2%

        \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      2. fma-def98.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      3. associate-+l+98.2%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef98.2%

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

      \[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \color{blue}{z \cdot t + a \cdot b}\right)\right) \]
    7. Step-by-step derivation
      1. fma-udef98.2%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\left(x \cdot y + a \cdot b\right) + z \cdot t}\right) \]
    9. Step-by-step derivation
      1. fma-udef98.2%

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

        \[\leadsto c \cdot i + \left(\left(x \cdot y + a \cdot b\right) + \color{blue}{t \cdot z}\right) \]
      3. associate-+r+98.2%

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b} + z \cdot t \]
  3. Recombined 2 regimes into one program.
  4. Final simplification72.6%

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

Alternative 12: 64.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -6.2 \cdot 10^{+128}:\\
\;\;\;\;a \cdot b + c \cdot i\\

\mathbf{elif}\;c \cdot i \leq 4.25 \cdot 10^{+136}:\\
\;\;\;\;a \cdot b + z \cdot t\\

\mathbf{else}:\\
\;\;\;\;c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -6.20000000000000008e128

    1. Initial program 92.3%

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

      \[\leadsto \color{blue}{\left(a \cdot b + t \cdot z\right)} + c \cdot i \]
    4. Taylor expanded in t around 0 74.8%

      \[\leadsto \color{blue}{a \cdot b + c \cdot i} \]

    if -6.20000000000000008e128 < (*.f64 c i) < 4.24999999999999983e136

    1. Initial program 98.3%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Step-by-step derivation
      1. +-commutative98.3%

        \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      2. fma-def98.3%

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
      3. associate-+l+98.3%

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \color{blue}{\mathsf{fma}\left(z, t, a \cdot b\right)}\right)\right) \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef98.3%

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

      \[\leadsto \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \color{blue}{z \cdot t + a \cdot b}\right)\right) \]
    7. Step-by-step derivation
      1. fma-udef98.3%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\left(x \cdot y + a \cdot b\right) + z \cdot t}\right) \]
    9. Step-by-step derivation
      1. fma-udef98.3%

        \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + a \cdot b\right) + z \cdot t\right)} \]
      2. *-commutative98.3%

        \[\leadsto c \cdot i + \left(\left(x \cdot y + a \cdot b\right) + \color{blue}{t \cdot z}\right) \]
      3. associate-+r+98.3%

        \[\leadsto \color{blue}{\left(c \cdot i + \left(x \cdot y + a \cdot b\right)\right) + t \cdot z} \]
      4. fma-def98.3%

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

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

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

      \[\leadsto \color{blue}{a \cdot b} + z \cdot t \]

    if 4.24999999999999983e136 < (*.f64 c i)

    1. Initial program 84.6%

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

      \[\leadsto \color{blue}{c \cdot i} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -6.2 \cdot 10^{+128}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 4.25 \cdot 10^{+136}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 43.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.1 \cdot 10^{+51} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{+136}\right):\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* c i) -3.1e+51) (not (<= (* c i) 5.8e+136))) (* c i) (* a b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -3.1e+51) || !((c * i) <= 5.8e+136)) {
		tmp = c * i;
	} else {
		tmp = a * b;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-3.1d+51)) .or. (.not. ((c * i) <= 5.8d+136))) then
        tmp = c * i
    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 c, double i) {
	double tmp;
	if (((c * i) <= -3.1e+51) || !((c * i) <= 5.8e+136)) {
		tmp = c * i;
	} else {
		tmp = a * b;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -3.1e+51) or not ((c * i) <= 5.8e+136):
		tmp = c * i
	else:
		tmp = a * b
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -3.1e+51) || !(Float64(c * i) <= 5.8e+136))
		tmp = Float64(c * i);
	else
		tmp = Float64(a * b);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -3.1e+51) || ~(((c * i) <= 5.8e+136)))
		tmp = c * i;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.1e+51], N[Not[LessEqual[N[(c * i), $MachinePrecision], 5.8e+136]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.1 \cdot 10^{+51} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{+136}\right):\\
\;\;\;\;c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -3.10000000000000011e51 or 5.79999999999999949e136 < (*.f64 c i)

    1. Initial program 90.0%

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

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

    if -3.10000000000000011e51 < (*.f64 c i) < 5.79999999999999949e136

    1. Initial program 98.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.1 \cdot 10^{+51} \lor \neg \left(c \cdot i \leq 5.8 \cdot 10^{+136}\right):\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 53.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-20} \lor \neg \left(t \leq 8.8 \cdot 10^{+85}\right):\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= t -4.3e-20) (not (<= t 8.8e+85))) (* z t) (+ (* a b) (* c i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((t <= -4.3e-20) || !(t <= 8.8e+85)) {
		tmp = z * t;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((t <= (-4.3d-20)) .or. (.not. (t <= 8.8d+85))) then
        tmp = z * t
    else
        tmp = (a * b) + (c * i)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((t <= -4.3e-20) || !(t <= 8.8e+85)) {
		tmp = z * t;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (t <= -4.3e-20) or not (t <= 8.8e+85):
		tmp = z * t
	else:
		tmp = (a * b) + (c * i)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((t <= -4.3e-20) || !(t <= 8.8e+85))
		tmp = Float64(z * t);
	else
		tmp = Float64(Float64(a * b) + Float64(c * i));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((t <= -4.3e-20) || ~((t <= 8.8e+85)))
		tmp = z * t;
	else
		tmp = (a * b) + (c * i);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[t, -4.3e-20], N[Not[LessEqual[t, 8.8e+85]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-20} \lor \neg \left(t \leq 8.8 \cdot 10^{+85}\right):\\
\;\;\;\;z \cdot t\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.30000000000000011e-20 or 8.8000000000000007e85 < t

    1. Initial program 94.5%

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

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

    if -4.30000000000000011e-20 < t < 8.8000000000000007e85

    1. Initial program 96.1%

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

      \[\leadsto \color{blue}{\left(a \cdot b + t \cdot z\right)} + c \cdot i \]
    4. Taylor expanded in t around 0 57.1%

      \[\leadsto \color{blue}{a \cdot b + c \cdot i} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.4%

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

Alternative 15: 27.4% accurate, 5.0× speedup?

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

\\
a \cdot b
\end{array}
Derivation
  1. Initial program 95.3%

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

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Final simplification25.6%

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

Reproduce

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