source: CIVL/examples/fortran/cv2018/equivalence/harmonic/driver.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: 495 bytes
Line 
1#include <math.h>
2#include <stdio.h>
3$input double IN;
4$output double OUT;
5$assume (IN > 0);
6
7void F_HARMONIC(double, double, double, double, double, double *);
8
9int main(){
10 double x[5],f,v;
11 double alpha,beta,gamma,beta2,beta3;
12
13 v = IN;
14 x[0] = sin(v);
15 x[1] = cos(v);
16 x[2] = sqrt(v);
17 x[3] = log(v);
18 x[4] = sin(1./v);
19 alpha = x[0];
20 beta = x[1];
21 gamma = x[2];
22 beta2 = x[3];
23 beta3 = x[4];
24 F_HARMONIC(alpha,beta,gamma,beta2,beta3,&f);
25 printf("f = %g\n",f);
26 OUT = f;
27}
Note: See TracBrowser for help on using the repository browser.