root / branches / pthreads737 / src / linad99 / cumd_cau.cpp @ 765
History  View  Annotate  Download (888 Bytes)
1 
/*


2 
* $Id: cumd_cau.cpp 542 20120710 21:04:06Z johnoel $

3 
*

4 
* Author: David Fournier

5 
* Copyright (c) 20082012 Regents of the University of California

6 
*/

7 
/**

8 
* \file

9 
* Description not yet available.

10 
*/

11 
#include <fvar.hpp> 
12  
13 
/**

14 
* Description not yet available.

15 
* \param

16 
*/

17 
double cumd_cauchy(const double& x) 
18 
{ 
19 
double t=0.0; 
20 
const double r2=sqrt(2.0); 
21 
t=atan(x/r2); 
22 
return (0.5 + t/PI); 
23 
} 
24  
25 
/**

26 
* Description not yet available.

27 
* \param

28 
*/

29 
double density_cauchy(const double& x) 
30 
{ 
31 
const double r2=PI*sqrt(2.0); 
32 
return 1./(r2*(1+0.5*x*x)); 
33 
} 
34  
35 
/**

36 
* Description not yet available.

37 
* \param

38 
*/

39 
double log_density_cauchy(const double& x) 
40 
{ 
41 
const double r2=PI*sqrt(2.0); 
42 
return log(r2*(1+0.5*x*x)); 
43 
} 
44  
45 
/**

46 
* Description not yet available.

47 
* \param

48 
*/

49 
double inv_cumd_cauchy(const double& x) 
50 
{ 
51 
const double r2=sqrt(2.0); 
52 
return (r2*tan(PI*(x0.5))); 
53 
} 