home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / NAREGU.TST < prev    next >
Encoding:
Text File  |  1984-08-31  |  784 b   |  38 lines

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  NAREGU */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,n;
  9.         float eps,root,xlow,xhi;
  10.  
  11.         xlow = -1.;
  12.         xhi = 0.;
  13.         eps = .0001;
  14.         n = 1000;
  15.  
  16.         naregu(xlow,xhi,eps,&root,&n);
  17.  
  18.         *fp=fopen("PRN:","w");                /* open the printer */
  19.  
  20.         fprintf(*fp,"Test Results from NAREGU\n\n");
  21.          printf("Test Results from NAREGU\n\n");
  22.  
  23.         fprintf(*fp," ROOT = %15.7f   N = %d\n\n",root,n);
  24.          printf(   " ROOT = %15.7f   N = %d\n\n",root,n);
  25.  
  26.         }
  27.  
  28.     value(x,fx)
  29.  
  30.        float x,*fx;
  31.        {
  32.         extern double pow();
  33.  
  34.        *fx = x*x*x*x - (3*x*x*x) - (2*x*x) + (5*x) +1;
  35.  
  36.        }
  37.  
  38.