File: run_voigt.c

package info (click to toggle)
libcerf 3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 760 kB
  • sloc: ansic: 4,905; f90: 250; makefile: 18
file content (42 lines) | stat: -rw-r--r-- 872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Library libcerf:
 *   Compute complex error functions, based on a new implementation of
 *   Faddeeva's w_of_z. Also provide Dawson and Voigt functions.
 *
 * File run_voigt.c:
 *   Interactive evaluation of Voigt's function.
 *
 * Copyright:
 *   (C) 2013 Forschungszentrum Jülich GmbH
 *
 * Licence:
 *   Public domain.
 *
 * Author:
 *   Joachim Wuttke, Forschungszentrum Jülich, 2013
 *
 * Website:
 *   http://apps.jcns.fz-juelich.de/libcerf
 */

#include <stdio.h>
#include <stdlib.h>
#include "cerf.h"

int main( int argc, char **argv )
{
    double x, s, g;

    if( argc!=4 ){
        fprintf( stderr,  "usage:\n" );
        fprintf( stderr,  "   run_voigt <x> <sigma> <gamma>\n" );
        exit(-1);
    }

    x = atof( argv[1] );
    s = atof( argv[2] );
    g = atof( argv[3] );

    double y = voigt(x,s,g);
    printf( "%25.19g\n", y);
    return 0;
}