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

Percentage Accurate: 96.1% → 98.2%
Time: 13.3s
Alternatives: 12
Speedup: 0.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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: 96.1% 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.2% accurate, 0.4× speedup?

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


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

    1. Initial program 100.0%

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

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

    1. Initial program 0.0%

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

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

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

      \[\leadsto \color{blue}{c \cdot \left(i + \frac{a \cdot b}{c}\right)} \]
    6. Step-by-step derivation
      1. associate-/l*55.0%

        \[\leadsto c \cdot \left(i + \color{blue}{a \cdot \frac{b}{c}}\right) \]
    7. Simplified55.0%

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

    \[\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 \left(i + a \cdot \frac{b}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.0% 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 95.7%

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

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

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

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

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

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

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

Alternative 3: 98.0% accurate, 0.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 4: 60.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -1.86 \cdot 10^{+248}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{+176}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{+51}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-72}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.25 \cdot 10^{+104}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* c i))))
   (if (<= (* x y) -1.86e+248)
     (* x y)
     (if (<= (* x y) -2.8e+176)
       t_1
       (if (<= (* x y) -8.2e+51)
         (* x y)
         (if (<= (* x y) -2.9e-56)
           t_1
           (if (<= (* x y) -6.4e-72)
             (* z t)
             (if (<= (* x y) 2.25e+104) t_1 (* x y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -1.86e+248) {
		tmp = x * y;
	} else if ((x * y) <= -2.8e+176) {
		tmp = t_1;
	} else if ((x * y) <= -8.2e+51) {
		tmp = x * y;
	} else if ((x * y) <= -2.9e-56) {
		tmp = t_1;
	} else if ((x * y) <= -6.4e-72) {
		tmp = z * t;
	} else if ((x * y) <= 2.25e+104) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (c * i)
    if ((x * y) <= (-1.86d+248)) then
        tmp = x * y
    else if ((x * y) <= (-2.8d+176)) then
        tmp = t_1
    else if ((x * y) <= (-8.2d+51)) then
        tmp = x * y
    else if ((x * y) <= (-2.9d-56)) then
        tmp = t_1
    else if ((x * y) <= (-6.4d-72)) then
        tmp = z * t
    else if ((x * y) <= 2.25d+104) then
        tmp = t_1
    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 t_1 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -1.86e+248) {
		tmp = x * y;
	} else if ((x * y) <= -2.8e+176) {
		tmp = t_1;
	} else if ((x * y) <= -8.2e+51) {
		tmp = x * y;
	} else if ((x * y) <= -2.9e-56) {
		tmp = t_1;
	} else if ((x * y) <= -6.4e-72) {
		tmp = z * t;
	} else if ((x * y) <= 2.25e+104) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	tmp = 0
	if (x * y) <= -1.86e+248:
		tmp = x * y
	elif (x * y) <= -2.8e+176:
		tmp = t_1
	elif (x * y) <= -8.2e+51:
		tmp = x * y
	elif (x * y) <= -2.9e-56:
		tmp = t_1
	elif (x * y) <= -6.4e-72:
		tmp = z * t
	elif (x * y) <= 2.25e+104:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(c * i))
	tmp = 0.0
	if (Float64(x * y) <= -1.86e+248)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -2.8e+176)
		tmp = t_1;
	elseif (Float64(x * y) <= -8.2e+51)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -2.9e-56)
		tmp = t_1;
	elseif (Float64(x * y) <= -6.4e-72)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 2.25e+104)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (a * b) + (c * i);
	tmp = 0.0;
	if ((x * y) <= -1.86e+248)
		tmp = x * y;
	elseif ((x * y) <= -2.8e+176)
		tmp = t_1;
	elseif ((x * y) <= -8.2e+51)
		tmp = x * y;
	elseif ((x * y) <= -2.9e-56)
		tmp = t_1;
	elseif ((x * y) <= -6.4e-72)
		tmp = z * t;
	elseif ((x * y) <= 2.25e+104)
		tmp = t_1;
	else
		tmp = x * y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.86e+248], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.8e+176], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -8.2e+51], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -2.9e-56], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -6.4e-72], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.25e+104], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -1.86 \cdot 10^{+248}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{+51}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-72}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 2.25 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.85999999999999988e248 or -2.8000000000000002e176 < (*.f64 x y) < -8.20000000000000021e51 or 2.2499999999999999e104 < (*.f64 x y)

    1. Initial program 89.5%

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

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

    if -1.85999999999999988e248 < (*.f64 x y) < -2.8000000000000002e176 or -8.20000000000000021e51 < (*.f64 x y) < -2.89999999999999991e-56 or -6.39999999999999998e-72 < (*.f64 x y) < 2.2499999999999999e104

    1. Initial program 98.8%

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

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

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

    if -2.89999999999999991e-56 < (*.f64 x y) < -6.39999999999999998e-72

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.86 \cdot 10^{+248}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.8 \cdot 10^{+176}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -8.2 \cdot 10^{+51}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-56}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-72}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 2.25 \cdot 10^{+104}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 43.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \cdot i \leq -4.8 \cdot 10^{+48}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -0.38:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq -2.12 \cdot 10^{-104}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{-232}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.9 \cdot 10^{+143}:\\ \;\;\;\;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) -4.8e+48)
   (* c i)
   (if (<= (* c i) -0.38)
     (* x y)
     (if (<= (* c i) -2.12e-104)
       (* z t)
       (if (<= (* c i) 1.5e-232)
         (* a b)
         (if (<= (* c i) 2.9e+143) (* 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) <= -4.8e+48) {
		tmp = c * i;
	} else if ((c * i) <= -0.38) {
		tmp = x * y;
	} else if ((c * i) <= -2.12e-104) {
		tmp = z * t;
	} else if ((c * i) <= 1.5e-232) {
		tmp = a * b;
	} else if ((c * i) <= 2.9e+143) {
		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) <= (-4.8d+48)) then
        tmp = c * i
    else if ((c * i) <= (-0.38d0)) then
        tmp = x * y
    else if ((c * i) <= (-2.12d-104)) then
        tmp = z * t
    else if ((c * i) <= 1.5d-232) then
        tmp = a * b
    else if ((c * i) <= 2.9d+143) 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) <= -4.8e+48) {
		tmp = c * i;
	} else if ((c * i) <= -0.38) {
		tmp = x * y;
	} else if ((c * i) <= -2.12e-104) {
		tmp = z * t;
	} else if ((c * i) <= 1.5e-232) {
		tmp = a * b;
	} else if ((c * i) <= 2.9e+143) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -4.8e+48:
		tmp = c * i
	elif (c * i) <= -0.38:
		tmp = x * y
	elif (c * i) <= -2.12e-104:
		tmp = z * t
	elif (c * i) <= 1.5e-232:
		tmp = a * b
	elif (c * i) <= 2.9e+143:
		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) <= -4.8e+48)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -0.38)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= -2.12e-104)
		tmp = Float64(z * t);
	elseif (Float64(c * i) <= 1.5e-232)
		tmp = Float64(a * b);
	elseif (Float64(c * i) <= 2.9e+143)
		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) <= -4.8e+48)
		tmp = c * i;
	elseif ((c * i) <= -0.38)
		tmp = x * y;
	elseif ((c * i) <= -2.12e-104)
		tmp = z * t;
	elseif ((c * i) <= 1.5e-232)
		tmp = a * b;
	elseif ((c * i) <= 2.9e+143)
		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], -4.8e+48], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -0.38], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.12e-104], N[(z * t), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.5e-232], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.9e+143], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \cdot i \leq -0.38:\\
\;\;\;\;x \cdot y\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -4.8000000000000002e48 or 2.8999999999999998e143 < (*.f64 c i)

    1. Initial program 92.8%

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

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

    if -4.8000000000000002e48 < (*.f64 c i) < -0.38

    1. Initial program 92.3%

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

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

    if -0.38 < (*.f64 c i) < -2.1200000000000001e-104 or 1.49999999999999995e-232 < (*.f64 c i) < 2.8999999999999998e143

    1. Initial program 97.5%

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

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

    if -2.1200000000000001e-104 < (*.f64 c i) < 1.49999999999999995e-232

    1. Initial program 98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -4.8 \cdot 10^{+48}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -0.38:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq -2.12 \cdot 10^{-104}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{-232}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.9 \cdot 10^{+143}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a \cdot b + c \cdot i\\ t_2 := a \cdot b + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+50}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-56}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-72}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{+99}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* a b) (* c i))) (t_2 (+ (* a b) (* x y))))
   (if (<= (* x y) -7e+50)
     t_2
     (if (<= (* x y) -2.9e-56)
       t_1
       (if (<= (* x y) -6.4e-72) (* z t) (if (<= (* x y) 8.6e+99) 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 = (a * b) + (c * i);
	double t_2 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -7e+50) {
		tmp = t_2;
	} else if ((x * y) <= -2.9e-56) {
		tmp = t_1;
	} else if ((x * y) <= -6.4e-72) {
		tmp = z * t;
	} else if ((x * y) <= 8.6e+99) {
		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 = (a * b) + (c * i)
    t_2 = (a * b) + (x * y)
    if ((x * y) <= (-7d+50)) then
        tmp = t_2
    else if ((x * y) <= (-2.9d-56)) then
        tmp = t_1
    else if ((x * y) <= (-6.4d-72)) then
        tmp = z * t
    else if ((x * y) <= 8.6d+99) 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 = (a * b) + (c * i);
	double t_2 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -7e+50) {
		tmp = t_2;
	} else if ((x * y) <= -2.9e-56) {
		tmp = t_1;
	} else if ((x * y) <= -6.4e-72) {
		tmp = z * t;
	} else if ((x * y) <= 8.6e+99) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (c * i)
	t_2 = (a * b) + (x * y)
	tmp = 0
	if (x * y) <= -7e+50:
		tmp = t_2
	elif (x * y) <= -2.9e-56:
		tmp = t_1
	elif (x * y) <= -6.4e-72:
		tmp = z * t
	elif (x * y) <= 8.6e+99:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(c * i))
	t_2 = Float64(Float64(a * b) + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -7e+50)
		tmp = t_2;
	elseif (Float64(x * y) <= -2.9e-56)
		tmp = t_1;
	elseif (Float64(x * y) <= -6.4e-72)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 8.6e+99)
		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 = (a * b) + (c * i);
	t_2 = (a * b) + (x * y);
	tmp = 0.0;
	if ((x * y) <= -7e+50)
		tmp = t_2;
	elseif ((x * y) <= -2.9e-56)
		tmp = t_1;
	elseif ((x * y) <= -6.4e-72)
		tmp = z * t;
	elseif ((x * y) <= 8.6e+99)
		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[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -7e+50], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.9e-56], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -6.4e-72], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8.6e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
t_2 := a \cdot b + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+50}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-56}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-72}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -7.00000000000000012e50 or 8.6000000000000003e99 < (*.f64 x y)

    1. Initial program 90.4%

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

      \[\leadsto \left(\color{blue}{x \cdot \left(y + \frac{t \cdot z}{x}\right)} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in x around inf 81.0%

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

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

    if -7.00000000000000012e50 < (*.f64 x y) < -2.89999999999999991e-56 or -6.39999999999999998e-72 < (*.f64 x y) < 8.6000000000000003e99

    1. Initial program 98.7%

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

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

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

    if -2.89999999999999991e-56 < (*.f64 x y) < -6.39999999999999998e-72

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -7 \cdot 10^{+50}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -2.9 \cdot 10^{-56}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -6.4 \cdot 10^{-72}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 8.6 \cdot 10^{+99}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + z \cdot t\\ t_2 := a \cdot b + x \cdot y\\ \mathbf{if}\;x \cdot y \leq -4.9 \cdot 10^{+116}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 5.9 \cdot 10^{-211}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{-63}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+99}:\\ \;\;\;\;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 (+ (* a b) (* x y))))
   (if (<= (* x y) -4.9e+116)
     t_2
     (if (<= (* x y) 5.9e-211)
       t_1
       (if (<= (* x y) 6.4e-63)
         (+ (* a b) (* c i))
         (if (<= (* x y) 6.5e+99) 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 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -4.9e+116) {
		tmp = t_2;
	} else if ((x * y) <= 5.9e-211) {
		tmp = t_1;
	} else if ((x * y) <= 6.4e-63) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 6.5e+99) {
		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 = (a * b) + (x * y)
    if ((x * y) <= (-4.9d+116)) then
        tmp = t_2
    else if ((x * y) <= 5.9d-211) then
        tmp = t_1
    else if ((x * y) <= 6.4d-63) then
        tmp = (a * b) + (c * i)
    else if ((x * y) <= 6.5d+99) 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 = (a * b) + (x * y);
	double tmp;
	if ((x * y) <= -4.9e+116) {
		tmp = t_2;
	} else if ((x * y) <= 5.9e-211) {
		tmp = t_1;
	} else if ((x * y) <= 6.4e-63) {
		tmp = (a * b) + (c * i);
	} else if ((x * y) <= 6.5e+99) {
		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 = (a * b) + (x * y)
	tmp = 0
	if (x * y) <= -4.9e+116:
		tmp = t_2
	elif (x * y) <= 5.9e-211:
		tmp = t_1
	elif (x * y) <= 6.4e-63:
		tmp = (a * b) + (c * i)
	elif (x * y) <= 6.5e+99:
		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(a * b) + Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -4.9e+116)
		tmp = t_2;
	elseif (Float64(x * y) <= 5.9e-211)
		tmp = t_1;
	elseif (Float64(x * y) <= 6.4e-63)
		tmp = Float64(Float64(a * b) + Float64(c * i));
	elseif (Float64(x * y) <= 6.5e+99)
		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 = (a * b) + (x * y);
	tmp = 0.0;
	if ((x * y) <= -4.9e+116)
		tmp = t_2;
	elseif ((x * y) <= 5.9e-211)
		tmp = t_1;
	elseif ((x * y) <= 6.4e-63)
		tmp = (a * b) + (c * i);
	elseif ((x * y) <= 6.5e+99)
		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[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -4.9e+116], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5.9e-211], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6.4e-63], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6.5e+99], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 5.9 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{-63}:\\
\;\;\;\;a \cdot b + c \cdot i\\

\mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.8999999999999998e116 or 6.5000000000000004e99 < (*.f64 x y)

    1. Initial program 90.5%

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

      \[\leadsto \left(\color{blue}{x \cdot \left(y + \frac{t \cdot z}{x}\right)} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in x around inf 85.0%

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

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

    if -4.8999999999999998e116 < (*.f64 x y) < 5.9000000000000002e-211 or 6.39999999999999978e-63 < (*.f64 x y) < 6.5000000000000004e99

    1. Initial program 98.0%

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

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

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

    if 5.9000000000000002e-211 < (*.f64 x y) < 6.39999999999999978e-63

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.9 \cdot 10^{+116}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \cdot y \leq 5.9 \cdot 10^{-211}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 6.4 \cdot 10^{-63}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq 6.5 \cdot 10^{+99}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 43.4% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -2.0999999999999999e39 or 2.49999999999999983e145 < (*.f64 c i)

    1. Initial program 92.9%

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

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

    if -2.0999999999999999e39 < (*.f64 c i) < -2.4000000000000001e-104 or 9.19999999999999983e-229 < (*.f64 c i) < 2.49999999999999983e145

    1. Initial program 96.7%

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

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

    if -2.4000000000000001e-104 < (*.f64 c i) < 9.19999999999999983e-229

    1. Initial program 98.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -2.1 \cdot 10^{+39}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2.4 \cdot 10^{-104}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 9.2 \cdot 10^{-229}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{+145}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+40} \lor \neg \left(c \cdot i \leq 5 \cdot 10^{+143}\right):\\
\;\;\;\;x \cdot y + c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -5.00000000000000003e40 or 5.00000000000000012e143 < (*.f64 c i)

    1. Initial program 92.9%

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

      \[\leadsto \left(\color{blue}{x \cdot \left(y + \frac{t \cdot z}{x}\right)} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in x around inf 87.3%

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

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

    if -5.00000000000000003e40 < (*.f64 c i) < 5.00000000000000012e143

    1. Initial program 97.4%

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

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

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

Alternative 10: 87.9% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -5e12 or 5.00000000000000012e143 < (*.f64 c i)

    1. Initial program 92.3%

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

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

    if -5e12 < (*.f64 c i) < 5.00000000000000012e143

    1. Initial program 98.0%

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

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

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

Alternative 11: 42.3% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+16} \lor \neg \left(c \cdot i \leq 2.9 \cdot 10^{+143}\right):\\
\;\;\;\;c \cdot i\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -3.8e16 or 2.8999999999999998e143 < (*.f64 c i)

    1. Initial program 93.2%

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

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

    if -3.8e16 < (*.f64 c i) < 2.8999999999999998e143

    1. Initial program 97.4%

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

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

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

Alternative 12: 27.7% accurate, 5.0× speedup?

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

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

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

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

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

Reproduce

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