mathlib-fftpack.c

     1  //! @file mathlib-fftpack.c
     2  //
     3  //! @section copyright
     4  //
     5  // This file is part of VIF - vintage fortran compiler.
     6  // Copyright 2020-2025 J. Marcel van der Veer <algol68g@xs4all.nl>.
     7  //
     8  //! @section license
     9  //
    10  // This program is free software; you can redistribute it and/or modify it 
    11  // under the terms of the gnu general public license as published by the 
    12  // free software foundation; either version 3 of the license, or 
    13  // (at your option) any later version.
    14  //
    15  // This program is distributed in the hope that it will be useful, but 
    16  // without any warranty; without even the implied warranty of merchantability 
    17  // or fitness for a particular purpose. See the GNU general public license for 
    18  // more details. you should have received a copy of the GNU general public 
    19  // license along with this program. If not, see <http://www.gnu.org/licenses/>.
    20  //
    21  //! @Synopsis
    22  //
    23  //! 68 subprograms from FFTPACK
    24  
    25  // Compiled from Fortran source code by VIF.
    26  // Selected subprograms are:
    27  //
    28  // CFFTB  COSQB1 DCOSQF DSINQB DZFFTI PASSB3 PASSF5 RADF3  RFFTF1 SINT
    29  // CFFTB1 COSQF  DCOSQI DSINQF EZFFT1 PASSB4 RADB2  RADF4  RFFTI  SINT1
    30  // CFFTF  COSQF1 DCOST  DSINQI EZFFTB PASSB5 RADB3  RADF5  RFFTI1 SINTI
    31  // CFFTF1 COSQI  DCOSTI DSINT  EZFFTF PASSF  RADB4  RADFG  SINQB  ZFFTB
    32  // CFFTI  COST   DFFTB  DSINTI EZFFTI PASSF2 RADB5  RFFTB  SINQF  ZFFTF
    33  // CFFTI1 COSTI  DFFTF  DZFFTB PASSB  PASSF3 RADBG  RFFTB1 SINQI  ZFFTI
    34  // COSQB  DCOSQB DFFTI  DZFFTF PASSB2 PASSF4 RADF2  RFFTF
    35  
    36  // Source: netlib.org/fftpack
    37  // 
    38  // DFFTPACK is a Double precision clone by Hugh C. Pumphrey of 
    39  // FFTPACK version 4 april 1985.
    40  // 
    41  // The original FFTPACK was public domain, so dfftpack is public domain
    42  // too. It is released in the hope it will be useful to someone. There is 
    43  // no warranty of any sort covering this software.
    44  
    45  // The license for FFTPACK Fortran source code is:
    46  //
    47  // The SLATEC Common Mathematical Library was developed at
    48  // US government research laboratories and is in the public domain.
    49  // 
    50  // Repository: http://www.netlib.org/slatec/
    51  // 
    52  // The SLATEC common mathematical library is issued by the following
    53  // 
    54  //         Air Force Weapons Laboratory, Albuquerque
    55  //         Lawrence Livermore National Laboratory, Livermore
    56  //         Los Alamos National Laboratory, Los Alamos
    57  //         National Institute of Standards and Technology, Washington
    58  //         National Energy Research Supercomputer Center, Livermore
    59  //         Oak Ridge National Laboratory, Oak Ridge
    60  //         Sandia National Laboratories, Albuquerque
    61  //         Sandia National Laboratories, Livermore
    62  // 
    63  // All questions concerning the distribution of the library should be
    64  // directed to the NATIONAL ENERGY SOFTWARE CENTER, 9700 Cass Ave.,
    65  // Argonne, Illinois  60439, and not to the authors of the subprograms.
    66  // 
    67  //                  * * * * * Notice * * * * *
    68  // 
    69  // This material was prepared as an account of work sponsored by the
    70  // United States Government.  Neither the United States, nor the
    71  // Department of Energy, nor the Department of Defense, nor any of
    72  // their employees, nor any of their contractors, subcontractors, or
    73  // their employees, makes any warranty, expressed or implied, or
    74  // assumes any legal liability or responsibility for the accuracy,
    75  // completeness, or usefulness of any information, apparatus, product,
    76  // or process disclosed, or represents that its use would not infringe
    77  // upon privately owned rights.
    78  
    79  /*
    80  Generated by VIF - experimental VIntage Fortran compiler.
    81  VIF release 1.1.7
    82  */
    87  static CALLS __calls[__ncalls] = {
    88    {"cfftb1", 0}, // subroutine
    89    {"cfftb", 0}, // subroutine
    90    {"cfftf1", 0}, // subroutine
    91    {"cfftf", 0}, // subroutine
    92    {"cffti1", 0}, // subroutine
    93    {"cffti", 0}, // subroutine
    94    {"cosqb1", 0}, // subroutine
    95    {"cosqb", 0}, // subroutine
    96    {"cosqf1", 0}, // subroutine
    97    {"cosqf", 0}, // subroutine
    98    {"cosqi", 0}, // subroutine
    99    {"cost", 0}, // subroutine
   100    {"costi", 0}, // subroutine
   101    {"dcosqb", 0}, // subroutine
   102    {"dcosqf", 0}, // subroutine
   103    {"dcosqi", 0}, // subroutine
   104    {"dcost", 0}, // subroutine
   105    {"dcosti", 0}, // subroutine
   106    {"dfftb", 0}, // subroutine
   107    {"dfftf", 0}, // subroutine
   108    {"dffti", 0}, // subroutine
   109    {"dsinqb", 0}, // subroutine
   110    {"dsinqf", 0}, // subroutine
   111    {"dsinqi", 0}, // subroutine
   112    {"dsint", 0}, // subroutine
   113    {"dsinti", 0}, // subroutine
   114    {"dzfftb", 0}, // subroutine
   115    {"dzfftf", 0}, // subroutine
   116    {"dzffti", 0}, // subroutine
   117    {"ezfft1", 0}, // subroutine
   118    {"ezfftb", 0}, // subroutine
   119    {"ezfftf", 0}, // subroutine
   120    {"ezffti", 0}, // subroutine
   121    {"passb2", 0}, // subroutine
   122    {"passb3", 0}, // subroutine
   123    {"passb4", 0}, // subroutine
   124    {"passb5", 0}, // subroutine
   125    {"passb", 0}, // subroutine
   126    {"passf2", 0}, // subroutine
   127    {"passf3", 0}, // subroutine
   128    {"passf4", 0}, // subroutine
   129    {"passf5", 0}, // subroutine
   130    {"passf", 0}, // subroutine
   131    {"radb2", 0}, // subroutine
   132    {"radb3", 0}, // subroutine
   133    {"radb4", 0}, // subroutine
   134    {"radb5", 0}, // subroutine
   135    {"radbg", 0}, // subroutine
   136    {"radf2", 0}, // subroutine
   137    {"radf3", 0}, // subroutine
   138    {"radf4", 0}, // subroutine
   139    {"radf5", 0}, // subroutine
   140    {"radfg", 0}, // subroutine
   141    {"rfftb1", 0}, // subroutine
   142    {"rfftb", 0}, // subroutine
   143    {"rfftf1", 0}, // subroutine
   144    {"rfftf", 0}, // subroutine
   145    {"rffti1", 0}, // subroutine
   146    {"rffti", 0}, // subroutine
   147    {"sinqb", 0}, // subroutine
   148    {"sinqf", 0}, // subroutine
   149    {"sinqi", 0}, // subroutine
   150    {"sint1", 0}, // subroutine
   151    {"sint", 0}, // subroutine
   152    {"sinti", 0}, // subroutine
   153    {"zfftb", 0}, // subroutine
   154    {"zfftf", 0}, // subroutine
   155    {"zffti", 0}, // subroutine
   156    {NULL, 0}
   157  };
   185  wsave_);
   187  wsave_);
   191  wsave_);
   193  wsave_);
   197  wa2_);
   199  wa2_, real_8 _p_ wa3_);
   201  wa2_, real_8 _p_ wa3_, real_8 _p_ wa4_);
   203  real_8 _p_ c1_, real_8 _p_ c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_);
   206  wa2_);
   208  wa2_, real_8 _p_ wa3_);
   210  wa2_, real_8 _p_ wa3_, real_8 _p_ wa4_);
   212  real_8 _p_ c1_, real_8 _p_ c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_);
   215  );
   217  , real_8 _p_ wa3_);
   219  , real_8 _p_ wa3_, real_8 _p_ wa4_);
   221  real_8 _p_ c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_);
   224  );
   226  , real_8 _p_ wa3_);
   228  , real_8 _p_ wa3_, real_8 _p_ wa4_);
   230  real_8 _p_ c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_);
   241  ;
   247  int_4 _cfftb1 (int_4 _p_ n_, real_8 _p_ c_, real_8 _p_ ch_, real_8 _p_ wa_, int_4 _p_ ifac_)
   248  { // ** body not listed **
   347  }
   348  int_4 _cfftb (int_4 _p_ n_, complex_8 _p_ c_, real_4 _p_ wsave_)
   349  { // ** body not listed **
   360  }
   361  int_4 _cfftf1 (int_4 _p_ n_, real_8 _p_ c_, real_8 _p_ ch_, real_8 _p_ wa_, int_4 _p_ ifac_)
   362  { // ** body not listed **
   461  }
   462  int_4 _cfftf (int_4 _p_ n_, complex_8 _p_ c_, real_4 _p_ wsave_)
   463  { // ** body not listed **
   474  }
   475  int_4 _cffti1 (int_4 _p_ n_, real_8 _p_ wa_, int_4 _p_ ifac_)
   476  { // ** body not listed **
   592  }
   593  int_4 _cffti (int_4 _p_ n_, real_4 _p_ wsave_)
   594  { // ** body not listed **
   605  }
   606  int_4 _cosqb1 (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ w_, real_8 _p_ xh_)
   607  { // ** body not listed **
   639  }
   640  int_4 _cosqb (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ wsave_)
   641  { // ** body not listed **
   666  }
   667  int_4 _cosqf1 (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ w_, real_8 _p_ xh_)
   668  { // ** body not listed **
   698  }
   699  int_4 _cosqf (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ wsave_)
   700  { // ** body not listed **
   723  }
   724  int_4 _cosqi (int_4 _p_ n_, real_4 _p_ wsave_)
   725  { // ** body not listed **
   738  }
   739  int_4 _cost (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ wsave_)
   740  { // ** body not listed **
   802  }
   803  int_4 _costi (int_4 _p_ n_, real_4 _p_ wsave_)
   804  { // ** body not listed **
   826  }
   827  int_4 _dcosqb (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ wsave_)
   828  { // ** body not listed **
   863  }
   864  int_4 _dcosqf (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ wsave_)
   865  { // ** body not listed **
   898  }
   899  int_4 _dcosqi (int_4 _p_ n_, real_8 _p_ wsave_)
   900  { // ** body not listed **
   924  }
   925  int_4 _dcost (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ wsave_)
   926  { // ** body not listed **
   988  }
   989  int_4 _dcosti (int_4 _p_ n_, real_8 _p_ wsave_)
   990  { // ** body not listed **
  1023  }
  1024  int_4 _dfftb (int_4 _p_ n_, real_8 _p_ r_, real_8 _p_ wsave_)
  1025  { // ** body not listed **
  1033  }
  1034  int_4 _dfftf (int_4 _p_ n_, real_8 _p_ r_, real_8 _p_ wsave_)
  1035  { // ** body not listed **
  1043  }
  1044  int_4 _dffti (int_4 _p_ n_, real_8 _p_ wsave_)
  1045  { // ** body not listed **
  1053  }
  1054  int_4 _dsinqb (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ wsave_)
  1055  { // ** body not listed **
  1078  }
  1079  int_4 _dsinqf (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ wsave_)
  1080  { // ** body not listed **
  1100  }
  1101  int_4 _dsinqi (int_4 _p_ n_, real_8 _p_ wsave_)
  1102  { // ** body not listed **
  1106  }
  1107  int_4 _dsint (int_4 _p_ n_, real_8 _p_ x_, real_8 _p_ wsave_)
  1108  { // ** body not listed **
  1117  }
  1118  int_4 _dsinti (int_4 _p_ n_, real_8 _p_ wsave_)
  1119  { // ** body not listed **
  1147  }
  1148  int_4 _dzfftb (int_4 _p_ n_, real_8 _p_ r_, real_8 _p_ azero_, real_8 _p_ a_, real_8 _p_ b_, real_8 _p_ wsave_)
  1149  { // ** body not listed **
  1181  }
  1182  int_4 _dzfftf (int_4 _p_ n_, real_8 _p_ r_, real_8 _p_ azero_, real_8 _p_ a_, real_8 _p_ b_, real_8 _p_ wsave_)
  1183  { // ** body not listed **
  1224  }
  1225  int_4 _dzffti (int_4 _p_ n_, real_8 _p_ wsave_)
  1226  { // ** body not listed **
  1234  }
  1235  int_4 _ezfft1 (int_4 _p_ n_, real_8 _p_ wa_, int_4 _p_ ifac_)
  1236  { // ** body not listed **
  1365  }
  1366  int_4 _ezfftb (int_4 _p_ n_, real_4 _p_ r_, real_4 _p_ azero_, real_4 _p_ a_, real_4 _p_ b_, real_4 _p_ wsave_)
  1367  { // ** body not listed **
  1399  }
  1400  int_4 _ezfftf (int_4 _p_ n_, real_4 _p_ r_, real_4 _p_ azero_, real_4 _p_ a_, real_4 _p_ b_, real_4 _p_ wsave_)
  1401  { // ** body not listed **
  1440  }
  1441  int_4 _ezffti (int_4 _p_ n_, real_4 _p_ wsave_)
  1442  { // ** body not listed **
  1450  }
  1451  int_4 _passb2 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_)
  1452  { // ** body not listed **
  1486  }
  1487  int_4 _passb3 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_)
  1488  { // ** body not listed **
  1554  }
  1555  int_4 _passb4 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  1556  _p_ wa3_)
  1557  { // ** body not listed **
  1616  }
  1617  int_4 _passb5 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  1618  _p_ wa3_, real_8 _p_ wa4_)
  1619  { // ** body not listed **
  1730  }
  1731  int_4 _passb (int_4 _p_ nac_, int_4 _p_ ido_, int_4 _p_ ip_, int_4 _p_ l1_, int_4 _p_ idl1_, real_8 _p_ cc_, real_8 _p_ 
  1732  c1_, real_8 _p_ c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_)
  1733  { // ** body not listed **
  1874  }
  1875  int_4 _passf2 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_)
  1876  { // ** body not listed **
  1910  }
  1911  int_4 _passf3 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_)
  1912  { // ** body not listed **
  1978  }
  1979  int_4 _passf4 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  1980  _p_ wa3_)
  1981  { // ** body not listed **
  2040  }
  2041  int_4 _passf5 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  2042  _p_ wa3_, real_8 _p_ wa4_)
  2043  { // ** body not listed **
  2154  }
  2155  int_4 _passf (int_4 _p_ nac_, int_4 _p_ ido_, int_4 _p_ ip_, int_4 _p_ l1_, int_4 _p_ idl1_, real_8 _p_ cc_, real_8 _p_ 
  2156  c1_, real_8 _p_ c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_)
  2157  { // ** body not listed **
  2298  }
  2299  int_4 _radb2 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_)
  2300  { // ** body not listed **
  2348  }
  2349  int_4 _radb3 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_)
  2350  { // ** body not listed **
  2411  }
  2412  int_4 _radb4 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  2413  _p_ wa3_)
  2414  { // ** body not listed **
  2501  }
  2502  int_4 _radb5 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  2503  _p_ wa3_, real_8 _p_ wa4_)
  2504  { // ** body not listed **
  2604  }
  2605  int_4 _radbg (int_4 _p_ ido_, int_4 _p_ ip_, int_4 _p_ l1_, int_4 _p_ idl1_, real_8 _p_ cc_, real_8 _p_ c1_, real_8 _p_ 
  2606  c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_)
  2607  { // ** body not listed **
  2826  }
  2827  int_4 _radf2 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_)
  2828  { // ** body not listed **
  2876  }
  2877  int_4 _radf3 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_)
  2878  { // ** body not listed **
  2939  }
  2940  int_4 _radf4 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  2941  _p_ wa3_)
  2942  { // ** body not listed **
  3030  }
  3031  int_4 _radf5 (int_4 _p_ ido_, int_4 _p_ l1_, real_8 _p_ cc_, real_8 _p_ ch_, real_8 _p_ wa1_, real_8 _p_ wa2_, real_8 
  3032  _p_ wa3_, real_8 _p_ wa4_)
  3033  { // ** body not listed **
  3133  }
  3134  int_4 _radfg (int_4 _p_ ido_, int_4 _p_ ip_, int_4 _p_ l1_, int_4 _p_ idl1_, real_8 _p_ cc_, real_8 _p_ c1_, real_8 _p_ 
  3135  c2_, real_8 _p_ ch_, real_8 _p_ ch2_, real_8 _p_ wa_)
  3136  { // ** body not listed **
  3358  }
  3359  int_4 _rfftb1 (int_4 _p_ n_, real_8 _p_ c_, real_8 _p_ ch_, real_8 _p_ wa_, int_4 _p_ ifac_)
  3360  { // ** body not listed **
  3457  }
  3458  int_4 _rfftb (int_4 _p_ n_, real_4 _p_ r_, real_4 _p_ wsave_)
  3459  { // ** body not listed **
  3467  }
  3468  int_4 _rfftf1 (int_4 _p_ n_, real_8 _p_ c_, real_8 _p_ ch_, real_8 _p_ wa_, int_4 _p_ ifac_)
  3469  { // ** body not listed **
  3561  }
  3562  int_4 _rfftf (int_4 _p_ n_, real_4 _p_ r_, real_4 _p_ wsave_)
  3563  { // ** body not listed **
  3571  }
  3572  int_4 _rffti1 (int_4 _p_ n_, real_8 _p_ wa_, int_4 _p_ ifac_)
  3573  { // ** body not listed **
  3686  }
  3687  int_4 _rffti (int_4 _p_ n_, real_4 _p_ wsave_)
  3688  { // ** body not listed **
  3696  }
  3697  int_4 _sinqb (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ wsave_)
  3698  { // ** body not listed **
  3721  }
  3722  int_4 _sinqf (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ wsave_)
  3723  { // ** body not listed **
  3743  }
  3744  int_4 _sinqi (int_4 _p_ n_, real_4 _p_ wsave_)
  3745  { // ** body not listed **
  3749  }
  3750  int_4 _sint1 (int_4 _p_ n_, real_8 _p_ war_, real_8 _p_ was_, real_8 _p_ xh_, real_8 _p_ x_, int_4 _p_ ifac_)
  3751  { // ** body not listed **
  3818  }
  3819  int_4 _sint (int_4 _p_ n_, real_4 _p_ x_, real_4 _p_ wsave_)
  3820  { // ** body not listed **
  3872  }
  3873  int_4 _sinti (int_4 _p_ n_, real_4 _p_ wsave_)
  3874  { // ** body not listed **
  3895  }
  3896  int_4 _zfftb (int_4 _p_ n_, real_8 _p_ c_, real_8 _p_ wsave_)
  3897  { // ** body not listed **
  3908  }
  3909  int_4 _zfftf (int_4 _p_ n_, real_8 _p_ c_, real_8 _p_ wsave_)
  3910  { // ** body not listed **
  3921  }
  3922  int_4 _zffti (int_4 _p_ n_, real_8 _p_ wsave_)
  3923  { // ** body not listed **
  3934  }


© 2002-2025 J.M. van der Veer (jmvdveer@xs4all.nl)