/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:33:11 */
/*FOR_C Options SET: ftn=u io=c no=p op=aimnv pf=,p_dmpval s=dbov str=l x=f - prototypes */
#include <math.h>
#include "fcrt.h"
#include <stdio.h>
#include <stdlib.h>
#include "p_dmpval.h"
/*     program DRDMPVAL
 *     Demonstrates DMPDRV, DMPINT, and DMPVAL.
 *>> 1997-05-29 DRDMPVAL Krogh Special code for C conversion.
 *>> 1996-05-28 DRDMPVAL Krogh Added external statement.
 *>> 1994-10-19 DRDMPVAL Krogh  Changes to use M77CON
 *>> 1993-02-04 DRDMPVAL CLL
 *>> 1987-12-09 DRDMPVAL Lawson  Initial Code.
 *     ------------------------------------------------------------------
 *--D replaces "?": DR?MPVAL, ?MPDRV, ?MPINT, ?MPVAL
 *     ------------------------------------------------------------------
 *++ Code for .C. is active */
   long int n;
 
int main( )
{
	long int nq, nr;
	double q[7], r[6], z;
	static double p[6]={5.e0,2.e0,4.e0,-4.e0,12.e0,16.e0};
		/* OFFSET Vectors w/subscript range: 1 to dimension */
	double *const P = &p[0] - 1;
	double *const Q = &q[0] - 1;
	double *const R = &r[0] - 1;
		/* end of OFFSET VECTORS */
 
/*++ End */
	/*     ------------------------------------------------------------------ */
	dmpint( p, 3, q, &nq );
	dmpdrv( q, nq, r, &nr );
	z = dmpval( q, nq, 6.e0 ) - dmpval( q, nq, 4.e0 );
	/*++ Code for ~.C. is inactive
	 *      print '(21x,''P ='',2f4.0,2x,4f7.2/)', P
	 *      print '('' INTEGRAL OF P.      Q ='',2f4.0,2x,5f7.2/)', Q
	 *      print '('' DERIVATIVE OF Q.    R ='',2f4.0,2x,4f7.2/)', R
	 *      print '('' DEFINITE INTEGRAL.  Z ='',f20.8)', Z
	 *++ Code for .C. is active */
   printf("                     P =%4.0f%4.0f", p[0], p[1]);
   for(n=2L; n < (long)(sizeof(p)/sizeof(p[1])); n++)
           printf("%7.2f", p[n]);
   printf("\n");
   printf(" INTEGRAL OF P.      Q =%4.0f%4.0f", q[0], q[1]);
   for(n=2L; n < (long)(sizeof(q)/sizeof(q[1])); n++)
           printf("%7.2f", q[n]);
   printf("\n");
   printf(" DERIVATIVE OF Q.    R =%4.0f%4.0f", r[0], r[1]);
   for(n=2L; n < (long)(sizeof(r)/sizeof(r[1])); n++)
           printf("%7.2f", r[n]);
   printf("\n");
   printf(" DEFINITE INTEGRAL.  Z =%20.8f\n", z);
	exit(0);
	/*++ End */
} /* end of function */