function s(t, a) {
  if (t.length !== a.length)
    throw new Error(`Cannot merge real and imag arrays of different lengths. real:${t.length}, imag: ${a.length}.`);
  const r = new Float32Array(t.length * 2);
  for (let n = 0; n < r.length; n += 2)
    r[n] = t[n / 2], r[n + 1] = a[n / 2];
  return r;
}
function l(t) {
  const a = new Float32Array(t.length / 2), r = new Float32Array(t.length / 2);
  for (let n = 0; n < t.length; n += 2)
    a[n / 2] = t[n], r[n / 2] = t[n + 1];
  return { real: a, imag: r };
}
function h(t) {
  const a = Math.ceil(t.length / 4), r = new Float32Array(a), n = new Float32Array(a);
  for (let e = 0; e < t.length; e += 4)
    r[Math.floor(e / 4)] = t[e], n[Math.floor(e / 4)] = t[e + 1];
  return { real: r, imag: n };
}
function i(t) {
  const a = Math.floor(t.length / 4), r = new Float32Array(a), n = new Float32Array(a);
  for (let e = 2; e < t.length; e += 4)
    r[Math.floor(e / 4)] = t[e], n[Math.floor(e / 4)] = t[e + 1];
  return { real: r, imag: n };
}
function g(t, a) {
  const r = t[a * 2], n = t[a * 2 + 1];
  return { real: r, imag: n };
}
function f(t, a, r, n) {
  t[n * 2] = a, t[n * 2 + 1] = r;
}
function c(t, a) {
  const r = new Float32Array(t / 2), n = new Float32Array(t / 2);
  for (let e = 0; e < Math.ceil(t / 2); e++) {
    const o = (a ? 2 : -2) * Math.PI * (e / t);
    r[e] = Math.cos(o), n[e] = Math.sin(o);
  }
  return { real: r, imag: n };
}
function u(t, a, r) {
  const n = (r ? 2 : -2) * Math.PI * (t / a), e = Math.cos(n), o = Math.sin(n);
  return { real: e, imag: o };
}
export {
  f as a,
  i as b,
  h as c,
  c as d,
  u as e,
  g,
  s as m,
  l as s
};
