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

Percentage Accurate: 95.8% → 98.0%
Time: 7.3s
Alternatives: 13
Speedup: 1.0×

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 13 alternatives:

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

Initial Program: 95.8% accurate, 1.0× speedup?

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

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

Alternative 1: 98.0% accurate, 0.0× speedup?

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

\\
\mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\end{array}
Derivation
  1. Initial program 98.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+98.0%

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

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

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

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

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

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

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

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 98.0%

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

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

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

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

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

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

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

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

Alternative 3: 62.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+165}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -1.28 \cdot 10^{+67} \lor \neg \left(a \cdot b \leq -1.15 \cdot 10^{+21} \lor \neg \left(a \cdot b \leq -4.6 \cdot 10^{-109}\right) \land \left(a \cdot b \leq 1.3 \cdot 10^{-77} \lor \neg \left(a \cdot b \leq 1.7 \cdot 10^{+29}\right) \land a \cdot b \leq 2.8 \cdot 10^{+210}\right)\right):\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* a b) -2.3e+165)
   (+ (* a b) (* x y))
   (if (or (<= (* a b) -1.28e+67)
           (not
            (or (<= (* a b) -1.15e+21)
                (and (not (<= (* a b) -4.6e-109))
                     (or (<= (* a b) 1.3e-77)
                         (and (not (<= (* a b) 1.7e+29))
                              (<= (* a b) 2.8e+210)))))))
     (+ (* a b) (* z t))
     (+ (* c i) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((a * b) <= -2.3e+165) {
		tmp = (a * b) + (x * y);
	} else if (((a * b) <= -1.28e+67) || !(((a * b) <= -1.15e+21) || (!((a * b) <= -4.6e-109) && (((a * b) <= 1.3e-77) || (!((a * b) <= 1.7e+29) && ((a * b) <= 2.8e+210)))))) {
		tmp = (a * b) + (z * t);
	} else {
		tmp = (c * i) + (x * y);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((a * b) <= (-2.3d+165)) then
        tmp = (a * b) + (x * y)
    else if (((a * b) <= (-1.28d+67)) .or. (.not. ((a * b) <= (-1.15d+21)) .or. (.not. ((a * b) <= (-4.6d-109))) .and. ((a * b) <= 1.3d-77) .or. (.not. ((a * b) <= 1.7d+29)) .and. ((a * b) <= 2.8d+210))) then
        tmp = (a * b) + (z * t)
    else
        tmp = (c * i) + (x * y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((a * b) <= -2.3e+165) {
		tmp = (a * b) + (x * y);
	} else if (((a * b) <= -1.28e+67) || !(((a * b) <= -1.15e+21) || (!((a * b) <= -4.6e-109) && (((a * b) <= 1.3e-77) || (!((a * b) <= 1.7e+29) && ((a * b) <= 2.8e+210)))))) {
		tmp = (a * b) + (z * t);
	} else {
		tmp = (c * i) + (x * y);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (a * b) <= -2.3e+165:
		tmp = (a * b) + (x * y)
	elif ((a * b) <= -1.28e+67) or not (((a * b) <= -1.15e+21) or (not ((a * b) <= -4.6e-109) and (((a * b) <= 1.3e-77) or (not ((a * b) <= 1.7e+29) and ((a * b) <= 2.8e+210))))):
		tmp = (a * b) + (z * t)
	else:
		tmp = (c * i) + (x * y)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(a * b) <= -2.3e+165)
		tmp = Float64(Float64(a * b) + Float64(x * y));
	elseif ((Float64(a * b) <= -1.28e+67) || !((Float64(a * b) <= -1.15e+21) || (!(Float64(a * b) <= -4.6e-109) && ((Float64(a * b) <= 1.3e-77) || (!(Float64(a * b) <= 1.7e+29) && (Float64(a * b) <= 2.8e+210))))))
		tmp = Float64(Float64(a * b) + Float64(z * t));
	else
		tmp = Float64(Float64(c * i) + Float64(x * y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((a * b) <= -2.3e+165)
		tmp = (a * b) + (x * y);
	elseif (((a * b) <= -1.28e+67) || ~((((a * b) <= -1.15e+21) || (~(((a * b) <= -4.6e-109)) && (((a * b) <= 1.3e-77) || (~(((a * b) <= 1.7e+29)) && ((a * b) <= 2.8e+210)))))))
		tmp = (a * b) + (z * t);
	else
		tmp = (c * i) + (x * y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.3e+165], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -1.28e+67], N[Not[Or[LessEqual[N[(a * b), $MachinePrecision], -1.15e+21], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], -4.6e-109]], $MachinePrecision], Or[LessEqual[N[(a * b), $MachinePrecision], 1.3e-77], And[N[Not[LessEqual[N[(a * b), $MachinePrecision], 1.7e+29]], $MachinePrecision], LessEqual[N[(a * b), $MachinePrecision], 2.8e+210]]]]]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+165}:\\
\;\;\;\;a \cdot b + x \cdot y\\

\mathbf{elif}\;a \cdot b \leq -1.28 \cdot 10^{+67} \lor \neg \left(a \cdot b \leq -1.15 \cdot 10^{+21} \lor \neg \left(a \cdot b \leq -4.6 \cdot 10^{-109}\right) \land \left(a \cdot b \leq 1.3 \cdot 10^{-77} \lor \neg \left(a \cdot b \leq 1.7 \cdot 10^{+29}\right) \land a \cdot b \leq 2.8 \cdot 10^{+210}\right)\right):\\
\;\;\;\;a \cdot b + z \cdot t\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -2.30000000000000016e165

    1. Initial program 97.2%

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

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

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

    if -2.30000000000000016e165 < (*.f64 a b) < -1.28e67 or -1.15e21 < (*.f64 a b) < -4.6000000000000003e-109 or 1.3000000000000001e-77 < (*.f64 a b) < 1.69999999999999991e29 or 2.8000000000000002e210 < (*.f64 a b)

    1. Initial program 95.1%

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

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

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

    if -1.28e67 < (*.f64 a b) < -1.15e21 or -4.6000000000000003e-109 < (*.f64 a b) < 1.3000000000000001e-77 or 1.69999999999999991e29 < (*.f64 a b) < 2.8000000000000002e210

    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 z around 0 81.7%

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

      \[\leadsto \color{blue}{c \cdot i + y \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -2.3 \cdot 10^{+165}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;a \cdot b \leq -1.28 \cdot 10^{+67} \lor \neg \left(a \cdot b \leq -1.15 \cdot 10^{+21} \lor \neg \left(a \cdot b \leq -4.6 \cdot 10^{-109}\right) \land \left(a \cdot b \leq 1.3 \cdot 10^{-77} \lor \neg \left(a \cdot b \leq 1.7 \cdot 10^{+29}\right) \land a \cdot b \leq 2.8 \cdot 10^{+210}\right)\right):\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + x \cdot y\\ \end{array} \]

Alternative 4: 42.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-116}:\\
\;\;\;\;z \cdot t\\

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 a b) < -1.25000000000000002e115 or 3.99999999999999994e213 < (*.f64 a b)

    1. Initial program 93.5%

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

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

    if -1.25000000000000002e115 < (*.f64 a b) < -2.30000000000000002e-116 or 8.30000000000000047e-106 < (*.f64 a b) < 3.99999999999999994e213

    1. Initial program 99.0%

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

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

    if -2.30000000000000002e-116 < (*.f64 a b) < -2.000000017e-316 or 2.3000000000000001e-290 < (*.f64 a b) < 1.7200000000000001e-212

    1. Initial program 100.0%

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

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

    if -2.000000017e-316 < (*.f64 a b) < 2.3000000000000001e-290 or 1.7200000000000001e-212 < (*.f64 a b) < 8.30000000000000047e-106

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.25 \cdot 10^{+115}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -2.3 \cdot 10^{-116}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-316}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{-290}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.72 \cdot 10^{-212}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 8.3 \cdot 10^{-106}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+213}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 5: 62.9% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \cdot i \leq 3.05 \cdot 10^{-146}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \cdot i \leq 6.6 \cdot 10^{-94}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;c \cdot i \leq 2.8 \cdot 10^{+219}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.06000000000000004e185 or 2.80000000000000015e219 < (*.f64 c i)

    1. Initial program 95.1%

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

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

    if -1.06000000000000004e185 < (*.f64 c i) < 3.0499999999999998e-146 or 6.6000000000000003e-94 < (*.f64 c i) < 2.80000000000000015e219

    1. Initial program 98.9%

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

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

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

    if 3.0499999999999998e-146 < (*.f64 c i) < 6.6000000000000003e-94

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.06 \cdot 10^{+185}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 3.05 \cdot 10^{-146}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 6.6 \cdot 10^{-94}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 2.8 \cdot 10^{+219}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]

Alternative 6: 56.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot i + a \cdot b\\ t_2 := a \cdot b + z \cdot t\\ \mathbf{if}\;x \leq -1.4 \cdot 10^{+47}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \leq -0.55:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-62}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -3.05 \cdot 10^{-239}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-18}:\\ \;\;\;\;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 (+ (* c i) (* a b))) (t_2 (+ (* a b) (* z t))))
   (if (<= x -1.4e+47)
     (+ (* a b) (* x y))
     (if (<= x -0.55)
       t_1
       (if (<= x -5e-62)
         t_2
         (if (<= x -3.05e-239)
           t_1
           (if (<= x -2.9e-300) t_2 (if (<= x 1.1e-18) 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 = (c * i) + (a * b);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if (x <= -1.4e+47) {
		tmp = (a * b) + (x * y);
	} else if (x <= -0.55) {
		tmp = t_1;
	} else if (x <= -5e-62) {
		tmp = t_2;
	} else if (x <= -3.05e-239) {
		tmp = t_1;
	} else if (x <= -2.9e-300) {
		tmp = t_2;
	} else if (x <= 1.1e-18) {
		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) :: t_2
    real(8) :: tmp
    t_1 = (c * i) + (a * b)
    t_2 = (a * b) + (z * t)
    if (x <= (-1.4d+47)) then
        tmp = (a * b) + (x * y)
    else if (x <= (-0.55d0)) then
        tmp = t_1
    else if (x <= (-5d-62)) then
        tmp = t_2
    else if (x <= (-3.05d-239)) then
        tmp = t_1
    else if (x <= (-2.9d-300)) then
        tmp = t_2
    else if (x <= 1.1d-18) 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 = (c * i) + (a * b);
	double t_2 = (a * b) + (z * t);
	double tmp;
	if (x <= -1.4e+47) {
		tmp = (a * b) + (x * y);
	} else if (x <= -0.55) {
		tmp = t_1;
	} else if (x <= -5e-62) {
		tmp = t_2;
	} else if (x <= -3.05e-239) {
		tmp = t_1;
	} else if (x <= -2.9e-300) {
		tmp = t_2;
	} else if (x <= 1.1e-18) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (c * i) + (a * b)
	t_2 = (a * b) + (z * t)
	tmp = 0
	if x <= -1.4e+47:
		tmp = (a * b) + (x * y)
	elif x <= -0.55:
		tmp = t_1
	elif x <= -5e-62:
		tmp = t_2
	elif x <= -3.05e-239:
		tmp = t_1
	elif x <= -2.9e-300:
		tmp = t_2
	elif x <= 1.1e-18:
		tmp = t_1
	else:
		tmp = x * y
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(c * i) + Float64(a * b))
	t_2 = Float64(Float64(a * b) + Float64(z * t))
	tmp = 0.0
	if (x <= -1.4e+47)
		tmp = Float64(Float64(a * b) + Float64(x * y));
	elseif (x <= -0.55)
		tmp = t_1;
	elseif (x <= -5e-62)
		tmp = t_2;
	elseif (x <= -3.05e-239)
		tmp = t_1;
	elseif (x <= -2.9e-300)
		tmp = t_2;
	elseif (x <= 1.1e-18)
		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 = (c * i) + (a * b);
	t_2 = (a * b) + (z * t);
	tmp = 0.0;
	if (x <= -1.4e+47)
		tmp = (a * b) + (x * y);
	elseif (x <= -0.55)
		tmp = t_1;
	elseif (x <= -5e-62)
		tmp = t_2;
	elseif (x <= -3.05e-239)
		tmp = t_1;
	elseif (x <= -2.9e-300)
		tmp = t_2;
	elseif (x <= 1.1e-18)
		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[(c * i), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e+47], N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -0.55], t$95$1, If[LessEqual[x, -5e-62], t$95$2, If[LessEqual[x, -3.05e-239], t$95$1, If[LessEqual[x, -2.9e-300], t$95$2, If[LessEqual[x, 1.1e-18], t$95$1, N[(x * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -0.55:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -5 \cdot 10^{-62}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -3.05 \cdot 10^{-239}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -2.9 \cdot 10^{-300}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 1.1 \cdot 10^{-18}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.39999999999999994e47

    1. Initial program 97.8%

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

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

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

    if -1.39999999999999994e47 < x < -0.55000000000000004 or -5.0000000000000002e-62 < x < -3.05e-239 or -2.89999999999999992e-300 < x < 1.0999999999999999e-18

    1. Initial program 98.2%

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

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

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

    if -0.55000000000000004 < x < -5.0000000000000002e-62 or -3.05e-239 < x < -2.89999999999999992e-300

    1. Initial program 100.0%

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

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

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

    if 1.0999999999999999e-18 < x

    1. Initial program 97.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+47}:\\ \;\;\;\;a \cdot b + x \cdot y\\ \mathbf{elif}\;x \leq -0.55:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-62}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \leq -3.05 \cdot 10^{-239}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{elif}\;x \leq -2.9 \cdot 10^{-300}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-18}:\\ \;\;\;\;c \cdot i + a \cdot b\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]

Alternative 7: 42.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;a \cdot b \leq -4.3 \cdot 10^{-116}:\\
\;\;\;\;z \cdot t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -1.8e115 or 4.0999999999999997e213 < (*.f64 a b)

    1. Initial program 93.5%

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

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

    if -1.8e115 < (*.f64 a b) < -4.2999999999999997e-116 or 1.2499999999999999e-76 < (*.f64 a b) < 4.0999999999999997e213

    1. Initial program 98.9%

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

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

    if -4.2999999999999997e-116 < (*.f64 a b) < 1.2499999999999999e-76

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1.8 \cdot 10^{+115}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq -4.3 \cdot 10^{-116}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 1.25 \cdot 10^{-76}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 4.1 \cdot 10^{+213}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 8: 76.1% accurate, 1.0× speedup?

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

\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 x < -3.1000000000000001e154 or 1.0999999999999999e-18 < x

    1. Initial program 97.2%

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

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

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

    if -3.1000000000000001e154 < x < 1.0999999999999999e-18

    1. Initial program 98.6%

      \[\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. Recombined 2 regimes into one program.
  4. Final simplification75.6%

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

Alternative 9: 81.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{-147} \lor \neg \left(t \leq 2.45 \cdot 10^{+135}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -6.59999999999999975e-147 or 2.4500000000000001e135 < t

    1. Initial program 97.7%

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

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

    if -6.59999999999999975e-147 < t < 2.4500000000000001e135

    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 z around 0 90.8%

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

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

Alternative 10: 95.8% accurate, 1.0× speedup?

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

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

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Final simplification98.0%

    \[\leadsto c \cdot i + \left(a \cdot b + \left(z \cdot t + x \cdot y\right)\right) \]

Alternative 11: 60.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.08 \cdot 10^{-117} \lor \neg \left(y \leq 4.7 \cdot 10^{+55}\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 (<= y -1.08e-117) (not (<= y 4.7e+55)))
   (+ (* 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 ((y <= -1.08e-117) || !(y <= 4.7e+55)) {
		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 ((y <= (-1.08d-117)) .or. (.not. (y <= 4.7d+55))) 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 ((y <= -1.08e-117) || !(y <= 4.7e+55)) {
		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 (y <= -1.08e-117) or not (y <= 4.7e+55):
		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 ((y <= -1.08e-117) || !(y <= 4.7e+55))
		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 ((y <= -1.08e-117) || ~((y <= 4.7e+55)))
		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[y, -1.08e-117], N[Not[LessEqual[y, 4.7e+55]], $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}\;y \leq -1.08 \cdot 10^{-117} \lor \neg \left(y \leq 4.7 \cdot 10^{+55}\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 y < -1.07999999999999998e-117 or 4.7000000000000001e55 < y

    1. Initial program 97.8%

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

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

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

    if -1.07999999999999998e-117 < y < 4.7000000000000001e55

    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 x around 0 88.6%

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

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

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

Alternative 12: 42.6% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -5.79999999999999972e66 or 5.3999999999999995e235 < (*.f64 a b)

    1. Initial program 94.3%

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

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

    if -5.79999999999999972e66 < (*.f64 a b) < 5.3999999999999995e235

    1. Initial program 99.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5.8 \cdot 10^{+66}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{+235}:\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]

Alternative 13: 28.3% 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 98.0%

    \[\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 2023257 
(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)))