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

Percentage Accurate: 95.9% → 98.0%
Time: 12.1s
Alternatives: 17
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 17 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.9% 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: 98.0% accurate, 0.0× speedup?

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

\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, 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. 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 \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
    3. associate-+l+96.1%

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

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

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

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

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

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

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

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

Alternative 2: 97.8% accurate, 0.0× speedup?

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

\\
\mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, \mathsf{fma}\left(c, i, z \cdot t\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}{\left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)} + c \cdot i \]
    2. associate-+l+96.1%

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

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

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

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

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

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

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

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

Alternative 3: 95.0% accurate, 0.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < 3.99999999999999993e73

    1. Initial program 98.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999993e73 < (*.f64 x y)

    1. Initial program 85.1%

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

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

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

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

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

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

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

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

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

Alternative 4: 97.1% accurate, 0.1× speedup?

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

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

\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. Step-by-step derivation
      1. associate-+l+100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ t_2 := a \cdot b + z \cdot t\\ t_3 := c \cdot i + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -1.1 \cdot 10^{+131}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{-71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \cdot i \leq -3 \cdot 10^{-299}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{-143}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{+17}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{+133}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t)))
        (t_2 (+ (* a b) (* z t)))
        (t_3 (+ (* c i) (* z t))))
   (if (<= (* c i) -1.1e+131)
     t_3
     (if (<= (* c i) -8.5e-71)
       t_1
       (if (<= (* c i) -3e-299)
         t_2
         (if (<= (* c i) 2e-143)
           t_1
           (if (<= (* c i) 1.22e+17)
             t_2
             (if (<= (* c i) 2.1e+133) t_1 t_3))))))))
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 t_2 = (a * b) + (z * t);
	double t_3 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -1.1e+131) {
		tmp = t_3;
	} else if ((c * i) <= -8.5e-71) {
		tmp = t_1;
	} else if ((c * i) <= -3e-299) {
		tmp = t_2;
	} else if ((c * i) <= 2e-143) {
		tmp = t_1;
	} else if ((c * i) <= 1.22e+17) {
		tmp = t_2;
	} else if ((c * i) <= 2.1e+133) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = (x * y) + (z * t)
    t_2 = (a * b) + (z * t)
    t_3 = (c * i) + (z * t)
    if ((c * i) <= (-1.1d+131)) then
        tmp = t_3
    else if ((c * i) <= (-8.5d-71)) then
        tmp = t_1
    else if ((c * i) <= (-3d-299)) then
        tmp = t_2
    else if ((c * i) <= 2d-143) then
        tmp = t_1
    else if ((c * i) <= 1.22d+17) then
        tmp = t_2
    else if ((c * i) <= 2.1d+133) then
        tmp = t_1
    else
        tmp = t_3
    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 t_2 = (a * b) + (z * t);
	double t_3 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -1.1e+131) {
		tmp = t_3;
	} else if ((c * i) <= -8.5e-71) {
		tmp = t_1;
	} else if ((c * i) <= -3e-299) {
		tmp = t_2;
	} else if ((c * i) <= 2e-143) {
		tmp = t_1;
	} else if ((c * i) <= 1.22e+17) {
		tmp = t_2;
	} else if ((c * i) <= 2.1e+133) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) + (z * t)
	t_2 = (a * b) + (z * t)
	t_3 = (c * i) + (z * t)
	tmp = 0
	if (c * i) <= -1.1e+131:
		tmp = t_3
	elif (c * i) <= -8.5e-71:
		tmp = t_1
	elif (c * i) <= -3e-299:
		tmp = t_2
	elif (c * i) <= 2e-143:
		tmp = t_1
	elif (c * i) <= 1.22e+17:
		tmp = t_2
	elif (c * i) <= 2.1e+133:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) + Float64(z * t))
	t_2 = Float64(Float64(a * b) + Float64(z * t))
	t_3 = Float64(Float64(c * i) + Float64(z * t))
	tmp = 0.0
	if (Float64(c * i) <= -1.1e+131)
		tmp = t_3;
	elseif (Float64(c * i) <= -8.5e-71)
		tmp = t_1;
	elseif (Float64(c * i) <= -3e-299)
		tmp = t_2;
	elseif (Float64(c * i) <= 2e-143)
		tmp = t_1;
	elseif (Float64(c * i) <= 1.22e+17)
		tmp = t_2;
	elseif (Float64(c * i) <= 2.1e+133)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x * y) + (z * t);
	t_2 = (a * b) + (z * t);
	t_3 = (c * i) + (z * t);
	tmp = 0.0;
	if ((c * i) <= -1.1e+131)
		tmp = t_3;
	elseif ((c * i) <= -8.5e-71)
		tmp = t_1;
	elseif ((c * i) <= -3e-299)
		tmp = t_2;
	elseif ((c * i) <= 2e-143)
		tmp = t_1;
	elseif ((c * i) <= 1.22e+17)
		tmp = t_2;
	elseif ((c * i) <= 2.1e+133)
		tmp = t_1;
	else
		tmp = t_3;
	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]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.1e+131], t$95$3, If[LessEqual[N[(c * i), $MachinePrecision], -8.5e-71], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -3e-299], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2e-143], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 1.22e+17], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2.1e+133], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := a \cdot b + z \cdot t\\
t_3 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.1 \cdot 10^{+131}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{-71}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \cdot i \leq -3 \cdot 10^{-299}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{-143}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{+17}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{+133}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.0999999999999999e131 or 2.1e133 < (*.f64 c i)

    1. Initial program 88.4%

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

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

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

    if -1.0999999999999999e131 < (*.f64 c i) < -8.49999999999999988e-71 or -2.99999999999999984e-299 < (*.f64 c i) < 1.9999999999999999e-143 or 1.22e17 < (*.f64 c i) < 2.1e133

    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 a around 0 82.9%

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

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

    if -8.49999999999999988e-71 < (*.f64 c i) < -2.99999999999999984e-299 or 1.9999999999999999e-143 < (*.f64 c i) < 1.22e17

    1. Initial program 98.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.1 \cdot 10^{+131}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -8.5 \cdot 10^{-71}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -3 \cdot 10^{-299}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{-143}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.22 \cdot 10^{+17}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 2.1 \cdot 10^{+133}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]

Alternative 6: 97.1% accurate, 0.5× 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 \]

    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 0 10.0%

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

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

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

Alternative 7: 64.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := a \cdot b + z \cdot t\\ \mathbf{if}\;a \cdot b \leq -6.4 \cdot 10^{+119}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -2.25 \cdot 10^{-5}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -1.5 \cdot 10^{-28}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.9 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 6.3:\\ \;\;\;\;a \cdot b + x \cdot y\\ \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 (+ (* a b) (* z t))))
   (if (<= (* a b) -6.4e+119)
     t_2
     (if (<= (* a b) -2.25e-5)
       t_1
       (if (<= (* a b) -1.5e-28)
         (* x y)
         (if (<= (* a b) 2.9e-40)
           t_1
           (if (<= (* a b) 6.3) (+ (* a b) (* x y)) 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 = (a * b) + (z * t);
	double tmp;
	if ((a * b) <= -6.4e+119) {
		tmp = t_2;
	} else if ((a * b) <= -2.25e-5) {
		tmp = t_1;
	} else if ((a * b) <= -1.5e-28) {
		tmp = x * y;
	} else if ((a * b) <= 2.9e-40) {
		tmp = t_1;
	} else if ((a * b) <= 6.3) {
		tmp = (a * b) + (x * y);
	} 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 = (a * b) + (z * t)
    if ((a * b) <= (-6.4d+119)) then
        tmp = t_2
    else if ((a * b) <= (-2.25d-5)) then
        tmp = t_1
    else if ((a * b) <= (-1.5d-28)) then
        tmp = x * y
    else if ((a * b) <= 2.9d-40) then
        tmp = t_1
    else if ((a * b) <= 6.3d0) then
        tmp = (a * b) + (x * y)
    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 = (a * b) + (z * t);
	double tmp;
	if ((a * b) <= -6.4e+119) {
		tmp = t_2;
	} else if ((a * b) <= -2.25e-5) {
		tmp = t_1;
	} else if ((a * b) <= -1.5e-28) {
		tmp = x * y;
	} else if ((a * b) <= 2.9e-40) {
		tmp = t_1;
	} else if ((a * b) <= 6.3) {
		tmp = (a * b) + (x * y);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (z * t)
	t_2 = (a * b) + (z * t)
	tmp = 0
	if (a * b) <= -6.4e+119:
		tmp = t_2
	elif (a * b) <= -2.25e-5:
		tmp = t_1
	elif (a * b) <= -1.5e-28:
		tmp = x * y
	elif (a * b) <= 2.9e-40:
		tmp = t_1
	elif (a * b) <= 6.3:
		tmp = (a * b) + (x * y)
	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(a * b) + Float64(z * t))
	tmp = 0.0
	if (Float64(a * b) <= -6.4e+119)
		tmp = t_2;
	elseif (Float64(a * b) <= -2.25e-5)
		tmp = t_1;
	elseif (Float64(a * b) <= -1.5e-28)
		tmp = Float64(x * y);
	elseif (Float64(a * b) <= 2.9e-40)
		tmp = t_1;
	elseif (Float64(a * b) <= 6.3)
		tmp = Float64(Float64(a * b) + Float64(x * y));
	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 = (a * b) + (z * t);
	tmp = 0.0;
	if ((a * b) <= -6.4e+119)
		tmp = t_2;
	elseif ((a * b) <= -2.25e-5)
		tmp = t_1;
	elseif ((a * b) <= -1.5e-28)
		tmp = x * y;
	elseif ((a * b) <= 2.9e-40)
		tmp = t_1;
	elseif ((a * b) <= 6.3)
		tmp = (a * b) + (x * y);
	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[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -6.4e+119], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2.25e-5], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1.5e-28], N[(x * y), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 2.9e-40], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 6.3], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \cdot b \leq -2.25 \cdot 10^{-5}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \cdot b \leq 2.9 \cdot 10^{-40}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \cdot b \leq 6.3:\\
\;\;\;\;a \cdot b + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -6.39999999999999979e119 or 6.29999999999999982 < (*.f64 a b)

    1. Initial program 92.0%

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

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

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

    if -6.39999999999999979e119 < (*.f64 a b) < -2.25000000000000014e-5 or -1.50000000000000001e-28 < (*.f64 a b) < 2.8999999999999999e-40

    1. Initial program 99.3%

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

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

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

    if -2.25000000000000014e-5 < (*.f64 a b) < -1.50000000000000001e-28

    1. Initial program 80.0%

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

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

    if 2.8999999999999999e-40 < (*.f64 a b) < 6.29999999999999982

    1. Initial program 91.7%

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

      \[\leadsto \color{blue}{\left(a \cdot b + x \cdot y\right)} + c \cdot i \]
    3. Step-by-step derivation
      1. +-commutative86.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -6.4 \cdot 10^{+119}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -2.25 \cdot 10^{-5}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -1.5 \cdot 10^{-28}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 2.9 \cdot 10^{-40}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 6.3:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 8: 42.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.65 \cdot 10^{+128}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -8.2 \cdot 10^{-268}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.18 \cdot 10^{-256}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{+140}:\\ \;\;\;\;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) -1.65e+128)
   (* c i)
   (if (<= (* c i) -8.2e-268)
     (* z t)
     (if (<= (* c i) 1.18e-256)
       (* a b)
       (if (<= (* c i) 2.5e+140) (* 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) <= -1.65e+128) {
		tmp = c * i;
	} else if ((c * i) <= -8.2e-268) {
		tmp = z * t;
	} else if ((c * i) <= 1.18e-256) {
		tmp = a * b;
	} else if ((c * i) <= 2.5e+140) {
		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) <= (-1.65d+128)) then
        tmp = c * i
    else if ((c * i) <= (-8.2d-268)) then
        tmp = z * t
    else if ((c * i) <= 1.18d-256) then
        tmp = a * b
    else if ((c * i) <= 2.5d+140) 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) <= -1.65e+128) {
		tmp = c * i;
	} else if ((c * i) <= -8.2e-268) {
		tmp = z * t;
	} else if ((c * i) <= 1.18e-256) {
		tmp = a * b;
	} else if ((c * i) <= 2.5e+140) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -1.65e+128:
		tmp = c * i
	elif (c * i) <= -8.2e-268:
		tmp = z * t
	elif (c * i) <= 1.18e-256:
		tmp = a * b
	elif (c * i) <= 2.5e+140:
		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) <= -1.65e+128)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -8.2e-268)
		tmp = Float64(z * t);
	elseif (Float64(c * i) <= 1.18e-256)
		tmp = Float64(a * b);
	elseif (Float64(c * i) <= 2.5e+140)
		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) <= -1.65e+128)
		tmp = c * i;
	elseif ((c * i) <= -8.2e-268)
		tmp = z * t;
	elseif ((c * i) <= 1.18e-256)
		tmp = a * b;
	elseif ((c * i) <= 2.5e+140)
		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], -1.65e+128], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -8.2e-268], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.18e-256], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.5e+140], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;c \cdot i \leq 1.18 \cdot 10^{-256}:\\
\;\;\;\;a \cdot b\\

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

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


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

    1. Initial program 88.4%

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

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

    if -1.65e128 < (*.f64 c i) < -8.1999999999999998e-268 or 1.18e-256 < (*.f64 c i) < 2.50000000000000004e140

    1. Initial program 99.2%

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

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

    if -8.1999999999999998e-268 < (*.f64 c i) < 1.18e-256

    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 a around inf 42.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.65 \cdot 10^{+128}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -8.2 \cdot 10^{-268}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.18 \cdot 10^{-256}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{+140}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 9: 85.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8 \cdot 10^{+118} \lor \neg \left(a \cdot b \leq 1.85 \cdot 10^{+118}\right):\\
\;\;\;\;a \cdot b + z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -7.99999999999999973e118 or 1.84999999999999993e118 < (*.f64 a b)

    1. Initial program 90.8%

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

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

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

    if -7.99999999999999973e118 < (*.f64 a b) < 1.84999999999999993e118

    1. Initial program 98.3%

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

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

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

Alternative 10: 87.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3.8 \cdot 10^{+78} \lor \neg \left(x \cdot y \leq 2.7 \cdot 10^{+31}\right):\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\

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


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

    1. Initial program 91.0%

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

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

    if -3.7999999999999999e78 < (*.f64 x y) < 2.69999999999999986e31

    1. Initial program 99.3%

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

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

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

Alternative 11: 60.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+45}\right):\\
\;\;\;\;x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.04999999999999992e59 or 5e45 < (*.f64 x y)

    1. Initial program 91.0%

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

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

    if -1.04999999999999992e59 < (*.f64 x y) < 5e45

    1. Initial program 99.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.05 \cdot 10^{+59} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+45}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]

Alternative 12: 66.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.5 \cdot 10^{+56} \lor \neg \left(x \cdot y \leq 2.2 \cdot 10^{+22}\right):\\
\;\;\;\;a \cdot b + x \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.5000000000000003e56 or 2.2e22 < (*.f64 x y)

    1. Initial program 91.4%

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

      \[\leadsto \color{blue}{\left(a \cdot b + x \cdot y\right)} + c \cdot i \]
    3. Step-by-step derivation
      1. +-commutative81.3%

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

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

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

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

      \[\leadsto \color{blue}{a \cdot b + x \cdot y} \]

    if -4.5000000000000003e56 < (*.f64 x y) < 2.2e22

    1. Initial program 99.3%

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

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

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

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

Alternative 13: 66.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.4 \cdot 10^{+53} \lor \neg \left(x \cdot y \leq 2.2 \cdot 10^{+31}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\

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


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

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, x \cdot y\right) + t \cdot z} \]
      4. *-commutative89.8%

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

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

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

    if -4.39999999999999997e53 < (*.f64 x y) < 2.2000000000000001e31

    1. Initial program 99.3%

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

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

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

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

Alternative 14: 43.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -8.5 \cdot 10^{+117} \lor \neg \left(a \cdot b \leq 6 \cdot 10^{-13}\right):\\
\;\;\;\;a \cdot b\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -8.49999999999999966e117 or 5.99999999999999968e-13 < (*.f64 a b)

    1. Initial program 91.4%

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

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

    if -8.49999999999999966e117 < (*.f64 a b) < 5.99999999999999968e-13

    1. Initial program 98.7%

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

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

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

Alternative 15: 43.0% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -9.8 \cdot 10^{+58} \lor \neg \left(x \cdot y \leq 3.5 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot y\\

\mathbf{else}:\\
\;\;\;\;z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.80000000000000037e58 or 3.5e22 < (*.f64 x y)

    1. Initial program 91.4%

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

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

    if -9.80000000000000037e58 < (*.f64 x y) < 3.5e22

    1. Initial program 99.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -9.8 \cdot 10^{+58} \lor \neg \left(x \cdot y \leq 3.5 \cdot 10^{+22}\right):\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \]

Alternative 16: 52.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+100} \lor \neg \left(z \leq 1.65 \cdot 10^{-33}\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 (<= z -5.8e+100) (not (<= z 1.65e-33))) (* 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 ((z <= -5.8e+100) || !(z <= 1.65e-33)) {
		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 ((z <= (-5.8d+100)) .or. (.not. (z <= 1.65d-33))) 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 ((z <= -5.8e+100) || !(z <= 1.65e-33)) {
		tmp = z * t;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (z <= -5.8e+100) or not (z <= 1.65e-33):
		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 ((z <= -5.8e+100) || !(z <= 1.65e-33))
		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 ((z <= -5.8e+100) || ~((z <= 1.65e-33)))
		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[z, -5.8e+100], N[Not[LessEqual[z, 1.65e-33]], $MachinePrecision]], N[(z * t), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+100} \lor \neg \left(z \leq 1.65 \cdot 10^{-33}\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 z < -5.8000000000000001e100 or 1.6500000000000001e-33 < z

    1. Initial program 95.4%

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

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

    if -5.8000000000000001e100 < z < 1.6500000000000001e-33

    1. Initial program 96.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+100} \lor \neg \left(z \leq 1.65 \cdot 10^{-33}\right):\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]

Alternative 17: 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 24.1%

    \[\leadsto \color{blue}{a \cdot b} \]
  3. Final simplification24.1%

    \[\leadsto a \cdot b \]

Reproduce

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