source: CIVL/examples/fortran/cv2018/equivalence/harmonic/driver2.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 513 bytes
Line 
1#include <math.h>
2#include <stdio.h>
3
4$input double IN;
5$output double OUT;
6$assume (IN > 0.0);
7
8void F_HARMONIC(double*, double*, double*, double*, double*, double *);
9
10int main(){
11 double x[5],f;
12 double alpha,beta,gamma,beta2,beta3;
13
14 double v = IN;
15 x[0] = sin(v);
16 x[1] = cos(v);
17 x[2] = sqrt(v);
18 x[3] = log(v);
19 x[4] = sin(1./v);
20 alpha = x[0];
21 beta = x[1];
22 gamma = x[2];
23 beta2 = x[3];
24 beta3 = x[4];
25 F_HARMONIC(&alpha,&beta,&gamma,&beta2,&beta3,&f);
26 printf("f = %g\n",f);
27 OUT = f;
28}
Note: See TracBrowser for help on using the repository browser.