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

Percentage Accurate: 95.7% → 97.7%
Time: 10.5s
Alternatives: 15
Speedup: 0.5×

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.7% 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.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) \leq \infty:\\ \;\;\;\;z \cdot t + \left(\mathsf{fma}\left(a, b, c \cdot i\right) + x \cdot y\right)\\ \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
 (if (<= (+ (* c i) (+ (* a b) (+ (* z t) (* x y)))) INFINITY)
   (+ (* z t) (+ (fma a b (* c i)) (* x y)))
   (fma 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) + ((a * b) + ((z * t) + (x * y)))) <= ((double) INFINITY)) {
		tmp = (z * t) + (fma(a, b, (c * i)) + (x * y));
	} else {
		tmp = fma(c, i, (a * b));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y)))) <= Inf)
		tmp = Float64(Float64(z * t) + Float64(fma(a, b, Float64(c * i)) + Float64(x * y)));
	else
		tmp = fma(c, i, Float64(a * b));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(z * t), $MachinePrecision] + N[(N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\mathsf{fma}\left(x, y, z \cdot t + a \cdot b\right)}\right) \]
      5. fma-def100.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. Simplified100.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. Step-by-step derivation
      1. fma-udef100.0%

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

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

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

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

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

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

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

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

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

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

    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-def10.0%

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\mathsf{fma}\left(x, y, z \cdot t + a \cdot b\right)}\right) \]
      5. fma-def40.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. Simplified40.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. Step-by-step derivation
      1. fma-udef20.0%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\left(a \cdot b + x \cdot y\right) + z \cdot t}\right) \]
    6. 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 simplification98.0%

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

Alternative 2: 97.9% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.8% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

Alternative 4: 97.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y))))))
   (if (<= t_1 INFINITY) t_1 (fma 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 = (c * i) + ((a * b) + ((z * t) + (x * y)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = fma(a, b, (c * i));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(Float64(z * t) + Float64(x * y))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = fma(a, b, Float64(c * i));
	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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.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 \]

    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. Taylor expanded in z around 0 20.0%

      \[\leadsto \color{blue}{\left(a \cdot b + x \cdot y\right)} + c \cdot i \]
    3. Taylor expanded in x around 0 40.1%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, b, c \cdot i\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(z \cdot t + x \cdot y\right)\right) \leq \infty:\\ \;\;\;\;c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\right)\\ \end{array} \]

Alternative 5: 97.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\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) (+ (* z t) (* x y))))))
   (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) + ((z * t) + (x * y)));
	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(z * t) + Float64(x * y))))
	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[(z * t), $MachinePrecision] + N[(x * y), $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(z \cdot t + x \cdot y\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 \]

    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-def10.0%

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

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

        \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\mathsf{fma}\left(x, y, z \cdot t + a \cdot b\right)}\right) \]
      5. fma-def40.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. Simplified40.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. Step-by-step derivation
      1. fma-udef20.0%

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(c, i, \color{blue}{\left(a \cdot b + x \cdot y\right) + z \cdot t}\right) \]
    6. 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 simplification98.0%

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

Alternative 6: 96.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 64.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := c \cdot i + a \cdot b\\ \mathbf{if}\;a \cdot b \leq -2.9 \cdot 10^{+122}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -50000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -2.4 \cdot 10^{-38}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -8.5 \cdot 10^{-143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -2.25 \cdot 10^{-207}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.6 \cdot 10^{+78}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (* z t))) (t_2 (+ (* c i) (* a b))))
   (if (<= (* a b) -2.9e+122)
     t_2
     (if (<= (* a b) -50000.0)
       t_1
       (if (<= (* a b) -2.4e-38)
         (* x y)
         (if (<= (* a b) -8.5e-143)
           t_1
           (if (<= (* a b) -2.25e-207)
             (* x y)
             (if (<= (* a b) 2.6e+78) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (c * i) + (z * t);
	double t_2 = (c * i) + (a * b);
	double tmp;
	if ((a * b) <= -2.9e+122) {
		tmp = t_2;
	} else if ((a * b) <= -50000.0) {
		tmp = t_1;
	} else if ((a * b) <= -2.4e-38) {
		tmp = x * y;
	} else if ((a * b) <= -8.5e-143) {
		tmp = t_1;
	} else if ((a * b) <= -2.25e-207) {
		tmp = x * y;
	} else if ((a * b) <= 2.6e+78) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (c * i) + (z * t)
    t_2 = (c * i) + (a * b)
    if ((a * b) <= (-2.9d+122)) then
        tmp = t_2
    else if ((a * b) <= (-50000.0d0)) then
        tmp = t_1
    else if ((a * b) <= (-2.4d-38)) then
        tmp = x * y
    else if ((a * b) <= (-8.5d-143)) then
        tmp = t_1
    else if ((a * b) <= (-2.25d-207)) then
        tmp = x * y
    else if ((a * b) <= 2.6d+78) then
        tmp = t_1
    else
        tmp = t_2
    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 = (c * i) + (z * t);
	double t_2 = (c * i) + (a * b);
	double tmp;
	if ((a * b) <= -2.9e+122) {
		tmp = t_2;
	} else if ((a * b) <= -50000.0) {
		tmp = t_1;
	} else if ((a * b) <= -2.4e-38) {
		tmp = x * y;
	} else if ((a * b) <= -8.5e-143) {
		tmp = t_1;
	} else if ((a * b) <= -2.25e-207) {
		tmp = x * y;
	} else if ((a * b) <= 2.6e+78) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	t_2 = (c * i) + (a * b)
	tmp = 0
	if (a * b) <= -2.9e+122:
		tmp = t_2
	elif (a * b) <= -50000.0:
		tmp = t_1
	elif (a * b) <= -2.4e-38:
		tmp = x * y
	elif (a * b) <= -8.5e-143:
		tmp = t_1
	elif (a * b) <= -2.25e-207:
		tmp = x * y
	elif (a * b) <= 2.6e+78:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(z * t))
	t_2 = Float64(Float64(c * i) + Float64(a * b))
	tmp = 0.0
	if (Float64(a * b) <= -2.9e+122)
		tmp = t_2;
	elseif (Float64(a * b) <= -50000.0)
		tmp = t_1;
	elseif (Float64(a * b) <= -2.4e-38)
		tmp = Float64(x * y);
	elseif (Float64(a * b) <= -8.5e-143)
		tmp = t_1;
	elseif (Float64(a * b) <= -2.25e-207)
		tmp = Float64(x * y);
	elseif (Float64(a * b) <= 2.6e+78)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (c * i) + (z * t);
	t_2 = (c * i) + (a * b);
	tmp = 0.0;
	if ((a * b) <= -2.9e+122)
		tmp = t_2;
	elseif ((a * b) <= -50000.0)
		tmp = t_1;
	elseif ((a * b) <= -2.4e-38)
		tmp = x * y;
	elseif ((a * b) <= -8.5e-143)
		tmp = t_1;
	elseif ((a * b) <= -2.25e-207)
		tmp = x * y;
	elseif ((a * b) <= 2.6e+78)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -2.9e+122], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -50000.0], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2.4e-38], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -8.5e-143], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -2.25e-207], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.6e+78], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot i + z \cdot t\\
t_2 := c \cdot i + a \cdot b\\
\mathbf{if}\;a \cdot b \leq -2.9 \cdot 10^{+122}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;a \cdot b \leq -50000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq -8.5 \cdot 10^{-143}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq 2.6 \cdot 10^{+78}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -2.9000000000000001e122 or 2.6e78 < (*.f64 a b)

    1. Initial program 92.8%

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

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

    if -2.9000000000000001e122 < (*.f64 a b) < -5e4 or -2.40000000000000022e-38 < (*.f64 a b) < -8.50000000000000072e-143 or -2.24999999999999996e-207 < (*.f64 a b) < 2.6e78

    1. Initial program 97.3%

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

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

    if -5e4 < (*.f64 a b) < -2.40000000000000022e-38 or -8.50000000000000072e-143 < (*.f64 a b) < -2.24999999999999996e-207

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]
    3. Step-by-step derivation
      1. +-commutative85.2%

        \[\leadsto \color{blue}{c \cdot i + x \cdot y} \]
      2. *-commutative85.2%

        \[\leadsto \color{blue}{i \cdot c} + x \cdot y \]
      3. fma-def85.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)} \]
    4. Applied egg-rr85.2%

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

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.9 \cdot 10^{+122}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -50000:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -2.4 \cdot 10^{-38}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -8.5 \cdot 10^{-143}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -2.25 \cdot 10^{-207}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.6 \cdot 10^{+78}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \end{array} \]

Alternative 8: 97.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* z t) (* x y))))))
   (if (<= t_1 INFINITY) t_1 (+ (* 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) + ((z * t) + (x * y)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (a * b);
	}
	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) + ((z * t) + (x * y)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (c * i) + (a * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = (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(z * t) + Float64(x * y))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(c * i) + Float64(a * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (c * i) + ((a * b) + ((z * t) + (x * y)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = (c * i) + (a * b);
	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[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\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 \]

    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. Taylor expanded in a around inf 40.1%

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
  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(z \cdot t + x \cdot y\right)\right) \leq \infty:\\ \;\;\;\;c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \end{array} \]

Alternative 9: 87.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.2 \cdot 10^{+115} \lor \neg \left(a \cdot b \leq 1.9 \cdot 10^{+65}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2.2e115 or 1.90000000000000006e65 < (*.f64 a b)

    1. Initial program 93.1%

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

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

    if -2.2e115 < (*.f64 a b) < 1.90000000000000006e65

    1. Initial program 97.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.2 \cdot 10^{+115} \lor \neg \left(a \cdot b \leq 1.9 \cdot 10^{+65}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(z \cdot t + x \cdot y\right)\\ \end{array} \]

Alternative 10: 43.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+28}:\\
\;\;\;\;c \cdot i\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.1499999999999999e141 or 1.2000000000000001e156 < (*.f64 x y)

    1. Initial program 89.4%

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

      \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]
    3. Step-by-step derivation
      1. +-commutative80.5%

        \[\leadsto \color{blue}{c \cdot i + x \cdot y} \]
      2. *-commutative80.5%

        \[\leadsto \color{blue}{i \cdot c} + x \cdot y \]
      3. fma-def80.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)} \]
    4. Applied egg-rr80.5%

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

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

    if -2.1499999999999999e141 < (*.f64 x y) < 2.49999999999999979e28

    1. Initial program 100.0%

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

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

    if 2.49999999999999979e28 < (*.f64 x y) < 1.2000000000000001e156

    1. Initial program 96.4%

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
    3. Taylor expanded in a around inf 44.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.15 \cdot 10^{+141}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 2.5 \cdot 10^{+28}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 1.2 \cdot 10^{+156}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 11: 66.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.6 \cdot 10^{+111} \lor \neg \left(x \cdot y \leq 6 \cdot 10^{+156}\right):\\
\;\;\;\;c \cdot i + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -5.5999999999999999e111 or 5.9999999999999999e156 < (*.f64 x y)

    1. Initial program 90.1%

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

      \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]

    if -5.5999999999999999e111 < (*.f64 x y) < 5.9999999999999999e156

    1. Initial program 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.6 \cdot 10^{+111} \lor \neg \left(x \cdot y \leq 6 \cdot 10^{+156}\right):\\ \;\;\;\;c \cdot i + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \end{array} \]

Alternative 12: 74.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.49999999999999997e-50 or 1.34999999999999986e241 < t

    1. Initial program 94.3%

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

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

    if -3.49999999999999997e-50 < t < 1.34999999999999986e241

    1. Initial program 97.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-50} \lor \neg \left(t \leq 1.35 \cdot 10^{+241}\right):\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(a \cdot b + x \cdot y\right)\\ \end{array} \]

Alternative 13: 64.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{+179}:\\
\;\;\;\;c \cdot i + a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -6.4999999999999997e172 or 9.19999999999999976e179 < (*.f64 x y)

    1. Initial program 88.2%

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

      \[\leadsto \color{blue}{x \cdot y} + c \cdot i \]
    3. Step-by-step derivation
      1. +-commutative82.0%

        \[\leadsto \color{blue}{c \cdot i + x \cdot y} \]
      2. *-commutative82.0%

        \[\leadsto \color{blue}{i \cdot c} + x \cdot y \]
      3. fma-def82.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, x \cdot y\right)} \]
    4. Applied egg-rr82.0%

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

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

    if -6.4999999999999997e172 < (*.f64 x y) < 9.19999999999999976e179

    1. Initial program 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.5 \cdot 10^{+172}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 9.2 \cdot 10^{+179}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 14: 43.8% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -2.0000000000000002e128 or 6.00000000000000006e72 < (*.f64 a b)

    1. Initial program 92.7%

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

      \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
    3. Taylor expanded in a around inf 67.1%

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

    if -2.0000000000000002e128 < (*.f64 a b) < 6.00000000000000006e72

    1. Initial program 97.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+128}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 6 \cdot 10^{+72}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 15: 28.0% 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 96.1%

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

    \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
  3. Taylor expanded in a around inf 25.0%

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

    \[\leadsto a \cdot b \]

Reproduce

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