/*
 * Copyright (c) 2003 Matteo Frigo
 * Copyright (c) 2003 Massachusetts Institute of Technology
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

/* This file was automatically generated --- DO NOT EDIT */
/* Generated on Sat Jul  5 21:57:07 EDT 2003 */

#include "codelet-rdft.h"

/* Generated by: /homee/stevenj/cvs/fftw3.0.1/genfft/gen_hc2hc -compact -variables 4 -n 16 -dit -name hf_16 -include hf.h */

/*
 * This function contains 174 FP additions, 84 FP multiplications,
 * (or, 136 additions, 46 multiplications, 38 fused multiply/add),
 * 52 stack variables, and 64 memory accesses
 */
/*
 * Generator Id's : 
 * $Id: algsimp.ml,v 1.7 2003/03/15 20:29:42 stevenj Exp $
 * $Id: fft.ml,v 1.2 2003/03/15 20:29:42 stevenj Exp $
 * $Id: gen_hc2hc.ml,v 1.9 2003/04/17 19:25:50 athena Exp $
 */

#include "hf.h"

static const R *hf_16(R *rio, R *iio, const R *W, stride ios, int m, int dist)
{
     DK(KP382683432, +0.382683432365089771728459984030398866761344562);
     DK(KP923879532, +0.923879532511286756128183189396788286822416626);
     DK(KP707106781, +0.707106781186547524400844362104849039284835938);
     int i;
     for (i = m - 2; i > 0; i = i - 2, rio = rio + dist, iio = iio - dist, W = W + 30) {
	  E T7, T37, T1t, T2U, Ti, T38, T1w, T2R, Tu, T2s, T1C, T2c, TF, T2t, T1H;
	  E T2d, TS, T13, T2w, T2x, T2y, T2z, T1O, T2g, T1T, T2h, T1f, T1q, T2B, T2C;
	  E T2D, T2E, T1Z, T2j, T24, T2k;
	  {
	       E T1, T2T, T6, T2S;
	       T1 = rio[0];
	       T2T = iio[-WS(ios, 15)];
	       {
		    E T3, T5, T2, T4;
		    T3 = rio[WS(ios, 8)];
		    T5 = iio[-WS(ios, 7)];
		    T2 = W[14];
		    T4 = W[15];
		    T6 = FMA(T2, T3, T4 * T5);
		    T2S = FNMS(T4, T3, T2 * T5);
	       }
	       T7 = T1 + T6;
	       T37 = T2T - T2S;
	       T1t = T1 - T6;
	       T2U = T2S + T2T;
	  }
	  {
	       E Tc, T1u, Th, T1v;
	       {
		    E T9, Tb, T8, Ta;
		    T9 = rio[WS(ios, 4)];
		    Tb = iio[-WS(ios, 11)];
		    T8 = W[6];
		    Ta = W[7];
		    Tc = FMA(T8, T9, Ta * Tb);
		    T1u = FNMS(Ta, T9, T8 * Tb);
	       }
	       {
		    E Te, Tg, Td, Tf;
		    Te = rio[WS(ios, 12)];
		    Tg = iio[-WS(ios, 3)];
		    Td = W[22];
		    Tf = W[23];
		    Th = FMA(Td, Te, Tf * Tg);
		    T1v = FNMS(Tf, Te, Td * Tg);
	       }
	       Ti = Tc + Th;
	       T38 = Tc - Th;
	       T1w = T1u - T1v;
	       T2R = T1u + T1v;
	  }
	  {
	       E To, T1y, Tt, T1z, T1A, T1B;
	       {
		    E Tl, Tn, Tk, Tm;
		    Tl = rio[WS(ios, 2)];
		    Tn = iio[-WS(ios, 13)];
		    Tk = W[2];
		    Tm = W[3];
		    To = FMA(Tk, Tl, Tm * Tn);
		    T1y = FNMS(Tm, Tl, Tk * Tn);
	       }
	       {
		    E Tq, Ts, Tp, Tr;
		    Tq = rio[WS(ios, 10)];
		    Ts = iio[-WS(ios, 5)];
		    Tp = W[18];
		    Tr = W[19];
		    Tt = FMA(Tp, Tq, Tr * Ts);
		    T1z = FNMS(Tr, Tq, Tp * Ts);
	       }
	       Tu = To + Tt;
	       T2s = T1y + T1z;
	       T1A = T1y - T1z;
	       T1B = To - Tt;
	       T1C = T1A - T1B;
	       T2c = T1B + T1A;
	  }
	  {
	       E Tz, T1E, TE, T1F, T1D, T1G;
	       {
		    E Tw, Ty, Tv, Tx;
		    Tw = rio[WS(ios, 14)];
		    Ty = iio[-WS(ios, 1)];
		    Tv = W[26];
		    Tx = W[27];
		    Tz = FMA(Tv, Tw, Tx * Ty);
		    T1E = FNMS(Tx, Tw, Tv * Ty);
	       }
	       {
		    E TB, TD, TA, TC;
		    TB = rio[WS(ios, 6)];
		    TD = iio[-WS(ios, 9)];
		    TA = W[10];
		    TC = W[11];
		    TE = FMA(TA, TB, TC * TD);
		    T1F = FNMS(TC, TB, TA * TD);
	       }
	       TF = Tz + TE;
	       T2t = T1E + T1F;
	       T1D = Tz - TE;
	       T1G = T1E - T1F;
	       T1H = T1D + T1G;
	       T2d = T1D - T1G;
	  }
	  {
	       E TM, T1K, T12, T1R, TR, T1L, TX, T1Q;
	       {
		    E TJ, TL, TI, TK;
		    TJ = rio[WS(ios, 1)];
		    TL = iio[-WS(ios, 14)];
		    TI = W[0];
		    TK = W[1];
		    TM = FMA(TI, TJ, TK * TL);
		    T1K = FNMS(TK, TJ, TI * TL);
	       }
	       {
		    E TZ, T11, TY, T10;
		    TZ = rio[WS(ios, 13)];
		    T11 = iio[-WS(ios, 2)];
		    TY = W[24];
		    T10 = W[25];
		    T12 = FMA(TY, TZ, T10 * T11);
		    T1R = FNMS(T10, TZ, TY * T11);
	       }
	       {
		    E TO, TQ, TN, TP;
		    TO = rio[WS(ios, 9)];
		    TQ = iio[-WS(ios, 6)];
		    TN = W[16];
		    TP = W[17];
		    TR = FMA(TN, TO, TP * TQ);
		    T1L = FNMS(TP, TO, TN * TQ);
	       }
	       {
		    E TU, TW, TT, TV;
		    TU = rio[WS(ios, 5)];
		    TW = iio[-WS(ios, 10)];
		    TT = W[8];
		    TV = W[9];
		    TX = FMA(TT, TU, TV * TW);
		    T1Q = FNMS(TV, TU, TT * TW);
	       }
	       TS = TM + TR;
	       T13 = TX + T12;
	       T2w = TS - T13;
	       T2x = T1K + T1L;
	       T2y = T1Q + T1R;
	       T2z = T2x - T2y;
	       {
		    E T1M, T1N, T1P, T1S;
		    T1M = T1K - T1L;
		    T1N = TX - T12;
		    T1O = T1M + T1N;
		    T2g = T1M - T1N;
		    T1P = TM - TR;
		    T1S = T1Q - T1R;
		    T1T = T1P - T1S;
		    T2h = T1P + T1S;
	       }
	  }
	  {
	       E T19, T20, T1p, T1X, T1e, T21, T1k, T1W;
	       {
		    E T16, T18, T15, T17;
		    T16 = rio[WS(ios, 15)];
		    T18 = iio[0];
		    T15 = W[28];
		    T17 = W[29];
		    T19 = FMA(T15, T16, T17 * T18);
		    T20 = FNMS(T17, T16, T15 * T18);
	       }
	       {
		    E T1m, T1o, T1l, T1n;
		    T1m = rio[WS(ios, 11)];
		    T1o = iio[-WS(ios, 4)];
		    T1l = W[20];
		    T1n = W[21];
		    T1p = FMA(T1l, T1m, T1n * T1o);
		    T1X = FNMS(T1n, T1m, T1l * T1o);
	       }
	       {
		    E T1b, T1d, T1a, T1c;
		    T1b = rio[WS(ios, 7)];
		    T1d = iio[-WS(ios, 8)];
		    T1a = W[12];
		    T1c = W[13];
		    T1e = FMA(T1a, T1b, T1c * T1d);
		    T21 = FNMS(T1c, T1b, T1a * T1d);
	       }
	       {
		    E T1h, T1j, T1g, T1i;
		    T1h = rio[WS(ios, 3)];
		    T1j = iio[-WS(ios, 12)];
		    T1g = W[4];
		    T1i = W[5];
		    T1k = FMA(T1g, T1h, T1i * T1j);
		    T1W = FNMS(T1i, T1h, T1g * T1j);
	       }
	       T1f = T19 + T1e;
	       T1q = T1k + T1p;
	       T2B = T1f - T1q;
	       T2C = T20 + T21;
	       T2D = T1W + T1X;
	       T2E = T2C - T2D;
	       {
		    E T1V, T1Y, T22, T23;
		    T1V = T19 - T1e;
		    T1Y = T1W - T1X;
		    T1Z = T1V - T1Y;
		    T2j = T1V + T1Y;
		    T22 = T20 - T21;
		    T23 = T1k - T1p;
		    T24 = T22 + T23;
		    T2k = T22 - T23;
	       }
	  }
	  {
	       E T1J, T27, T3g, T3i, T26, T3h, T2a, T3d;
	       {
		    E T1x, T1I, T3e, T3f;
		    T1x = T1t - T1w;
		    T1I = KP707106781 * (T1C - T1H);
		    T1J = T1x + T1I;
		    T27 = T1x - T1I;
		    T3e = KP707106781 * (T2d - T2c);
		    T3f = T38 + T37;
		    T3g = T3e + T3f;
		    T3i = T3f - T3e;
	       }
	       {
		    E T1U, T25, T28, T29;
		    T1U = FMA(KP923879532, T1O, KP382683432 * T1T);
		    T25 = FNMS(KP923879532, T24, KP382683432 * T1Z);
		    T26 = T1U + T25;
		    T3h = T25 - T1U;
		    T28 = FNMS(KP923879532, T1T, KP382683432 * T1O);
		    T29 = FMA(KP382683432, T24, KP923879532 * T1Z);
		    T2a = T28 - T29;
		    T3d = T28 + T29;
	       }
	       iio[-WS(ios, 11)] = T1J - T26;
	       rio[WS(ios, 11)] = T3d - T3g;
	       rio[WS(ios, 3)] = T1J + T26;
	       iio[-WS(ios, 3)] = T3d + T3g;
	       iio[-WS(ios, 15)] = T27 - T2a;
	       rio[WS(ios, 15)] = T3h - T3i;
	       rio[WS(ios, 7)] = T27 + T2a;
	       iio[-WS(ios, 7)] = T3h + T3i;
	  }
	  {
	       E T2v, T2H, T32, T34, T2G, T33, T2K, T2Z;
	       {
		    E T2r, T2u, T30, T31;
		    T2r = T7 - Ti;
		    T2u = T2s - T2t;
		    T2v = T2r + T2u;
		    T2H = T2r - T2u;
		    T30 = TF - Tu;
		    T31 = T2U - T2R;
		    T32 = T30 + T31;
		    T34 = T31 - T30;
	       }
	       {
		    E T2A, T2F, T2I, T2J;
		    T2A = T2w + T2z;
		    T2F = T2B - T2E;
		    T2G = KP707106781 * (T2A + T2F);
		    T33 = KP707106781 * (T2F - T2A);
		    T2I = T2z - T2w;
		    T2J = T2B + T2E;
		    T2K = KP707106781 * (T2I - T2J);
		    T2Z = KP707106781 * (T2I + T2J);
	       }
	       iio[-WS(ios, 10)] = T2v - T2G;
	       rio[WS(ios, 10)] = T2Z - T32;
	       rio[WS(ios, 2)] = T2v + T2G;
	       iio[-WS(ios, 2)] = T2Z + T32;
	       iio[-WS(ios, 14)] = T2H - T2K;
	       rio[WS(ios, 14)] = T33 - T34;
	       rio[WS(ios, 6)] = T2H + T2K;
	       iio[-WS(ios, 6)] = T33 + T34;
	  }
	  {
	       E T2f, T2n, T3a, T3c, T2m, T3b, T2q, T35;
	       {
		    E T2b, T2e, T36, T39;
		    T2b = T1t + T1w;
		    T2e = KP707106781 * (T2c + T2d);
		    T2f = T2b + T2e;
		    T2n = T2b - T2e;
		    T36 = KP707106781 * (T1C + T1H);
		    T39 = T37 - T38;
		    T3a = T36 + T39;
		    T3c = T39 - T36;
	       }
	       {
		    E T2i, T2l, T2o, T2p;
		    T2i = FMA(KP382683432, T2g, KP923879532 * T2h);
		    T2l = FNMS(KP382683432, T2k, KP923879532 * T2j);
		    T2m = T2i + T2l;
		    T3b = T2l - T2i;
		    T2o = FNMS(KP382683432, T2h, KP923879532 * T2g);
		    T2p = FMA(KP923879532, T2k, KP382683432 * T2j);
		    T2q = T2o - T2p;
		    T35 = T2o + T2p;
	       }
	       iio[-WS(ios, 9)] = T2f - T2m;
	       rio[WS(ios, 9)] = T35 - T3a;
	       rio[WS(ios, 1)] = T2f + T2m;
	       iio[-WS(ios, 1)] = T35 + T3a;
	       iio[-WS(ios, 13)] = T2n - T2q;
	       rio[WS(ios, 13)] = T3b - T3c;
	       rio[WS(ios, 5)] = T2n + T2q;
	       iio[-WS(ios, 5)] = T3b + T3c;
	  }
	  {
	       E TH, T2L, T2W, T2Y, T1s, T2X, T2O, T2P;
	       {
		    E Tj, TG, T2Q, T2V;
		    Tj = T7 + Ti;
		    TG = Tu + TF;
		    TH = Tj + TG;
		    T2L = Tj - TG;
		    T2Q = T2s + T2t;
		    T2V = T2R + T2U;
		    T2W = T2Q + T2V;
		    T2Y = T2V - T2Q;
	       }
	       {
		    E T14, T1r, T2M, T2N;
		    T14 = TS + T13;
		    T1r = T1f + T1q;
		    T1s = T14 + T1r;
		    T2X = T1r - T14;
		    T2M = T2x + T2y;
		    T2N = T2C + T2D;
		    T2O = T2M - T2N;
		    T2P = T2M + T2N;
	       }
	       iio[-WS(ios, 8)] = TH - T1s;
	       rio[WS(ios, 8)] = T2P - T2W;
	       rio[0] = TH + T1s;
	       iio[0] = T2P + T2W;
	       iio[-WS(ios, 12)] = T2L - T2O;
	       rio[WS(ios, 12)] = T2X - T2Y;
	       rio[WS(ios, 4)] = T2L + T2O;
	       iio[-WS(ios, 4)] = T2X + T2Y;
	  }
     }
     return W;
}

static const tw_instr twinstr[] = {
     {TW_FULL, 0, 16},
     {TW_NEXT, 1, 0}
};

static const hc2hc_desc desc = { 16, "hf_16", twinstr, {136, 46, 38, 0}, &GENUS, 0, 0, 0 };

void X(codelet_hf_16) (planner *p) {
     X(khc2hc_dit_register) (p, hf_16, &desc);
}
