public static uint[] bsqr(uint[] x)
{
uint t = (uint)x.Length;
uint n = 2 * t;
var r = new uint[n];
uint c = 0;
uint i, j;
for (i = 0; i < t; i++)
{
c = ip(r, 2 * i, x[i], x[i], 0);
for (j = i + 1; j < t; j++)
{
c = ip(r, i + j, 2 * x[j], x[i], c);
}
r[i + t] = c;
}
return zclip(r);
}