# rfftb1.f

          SUBROUTINE RFFTB1 (N, C, CH, WA, IFAC)
    C***BEGIN PROLOGUE  RFFTB1
    C***PURPOSE  Compute the backward fast Fourier transform of a real
    C            coefficient array.
    C***LIBRARY   SLATEC (FFTPACK)
    C***CATEGORY  J1A1
    C***TYPE      SINGLE PRECISION (RFFTB1-S, CFFTB1-C)
    C***KEYWORDS  FFTPACK, FOURIER TRANSFORM
    C***AUTHOR  Swarztrauber, P. N., (NCAR)
    C***DESCRIPTION
    C
    C   Subroutine RFFTB1 computes the real periodic sequence from its
    C   Fourier coefficients (Fourier synthesis).  The transform is defined
    C   below at output parameter C.
    C
    C   The arrays WA and IFAC which are used by subroutine RFFTB1 must be
    C   initialized by calling subroutine RFFTI1.
    C
    C   Input Arguments
    C
    C   N       the length of the array R to be transformed.  The method
    C           is most efficient when N is a product of small primes.
    C           N may change so long as different work arrays are provided.
    C
    C   C       a real array of length N which contains the sequence
    C           to be transformed.
    C
    C   CH      a real work array of length at least N.
    C
    C   WA      a real work array which must be dimensioned at least N.
    C
    C   IFAC    an integer work array which must be dimensioned at least 15.
    C
    C           The WA and IFAC arrays must be initialized by calling
    C           subroutine RFFTI1, and different WA and IFAC arrays must be
    C           used for each different value of N.  This initialization
    C           does not have to be repeated so long as N remains unchanged.
    C           Thus subsequent transforms can be obtained faster than the
    C           first.  The same WA and IFAC arrays can be used by RFFTF1
    C           and RFFTB1.
    C
    C   Output Argument
    C
    C   C       For N even and for I = 1,...,N
    C
    C                C(I) = C(1)+(-1)**(I-1)*C(N)
    C
    C                     plus the sum from K=2 to K=N/2 of
    C
    C                      2.*C(2*K-2)*COS((K-1)*(I-1)*2*PI/N)
    C
    C                     -2.*C(2*K-1)*SIN((K-1)*(I-1)*2*PI/N)
    C
    C           For N odd and for I = 1,...,N
    C
    C                C(I) = C(1) plus the sum from K=2 to K=(N+1)/2 of
    C
    C                     2.*C(2*K-2)*COS((K-1)*(I-1)*2*PI/N)
    C
    C                    -2.*C(2*K-1)*SIN((K-1)*(I-1)*2*PI/N)
    C
    C   Notes:  This transform is unnormalized since a call of RFFTF1
    C           followed by a call of RFFTB1 will multiply the input
    C           sequence by N.
    C
    C           WA and IFAC contain initialization calculations which must
    C           not be destroyed between calls of subroutine RFFTF1 or
    C           RFFTB1.
    C
    C***REFERENCES  P. N. Swarztrauber, Vectorizing the FFTs, in Parallel
    C                 Computations (G. Rodrigue, ed.), Academic Press,
    C                 1982, pp. 51-83.
    C***ROUTINES CALLED  RADB2, RADB3, RADB4, RADB5, RADBG
    C***REVISION HISTORY  (YYMMDD)
    C   790601  DATE WRITTEN
    C   830401  Modified to use SLATEC library source file format.
    C   860115  Modified by Ron Boisvert to adhere to Fortran 77 by
    C           changing dummy array size declarations (1) to (*).
    C   881128  Modified by Dick Valent to meet prologue standards.
    C   891214  Prologue converted to Version 4.0 format.  (BAB)
    C   900131  Routine changed from subsidiary to user-callable.  (WRB)
    C   920501  Reformatted the REFERENCES section.  (WRB)
    C***END PROLOGUE  RFFTB1