GremlinEq
fractions.h
1 //---------------------------------------------------------------------------
2 //
3 // $Id: fractions.h,v 1.1 2013/05/17 15:30:12 sahughes Exp $
4 //
5 //---------------------------------------------------------------------------
6 
7 /* radialfrac.h
8  * evaluate the continued fraction */
9 
10 #ifndef RADIALFRAC_H_SEEN
11 #define RADIALFRAC_H_SEEN
12 
13 #include "teukolskydefs.h"
14 
15 /* estimate of the precision of the results of the fractions, as
16  * a multiple of their term sizes
17  * This is generally a very generous bound, because we want to catch outliers
18  */
19 #define TERM_NOISE 1e-14
20 
21 /* evaluate the fraction with increasing n
22  * - a_0 / (b1 - a_1 / (... */
23 Real plusfrac(Real nu, Real epsilon, Real q, int m, Real lambda,
24  Real *term);
25 Complex cplusfrac(Complex nu, Real epsilon, Real q, int m, Real lambda,
26  Real *term);
27 
28 /* evaluate the fraction with decreasing n
29  * - a_-1 / (b_-1 - a_-2 / (... */
30 Real minusfrac(Real nu, Real epsilon, Real q, int m, Real lambda,
31  Real *term);
32 Complex cminusfrac(Complex nu, Real epsilon, Real q, int m, Real lambda,
33  Real *term);
34 
35 /* evaluate the whole thing */
36 Real radialfrac(Real nu, Real epsilon, Real q, int m, Real lambda,
37  Real *term);
38 Complex cradialfrac(Complex nu, Real epsilon, Real q, int m, Real lambda,
39  Real *term);
40 
41 /* Evaluate the continued fraction on the special line Re(nu) = -1/2
42  * It is guaranteed to be real there */
43 Real radialfrac_half(Real imnu, Real epsilon, Real q, int m, Real lambda,
44  Real *term);
45 
46 #endif /* RADIALFRAC_H_SEEN */
47 /* renangmom.h
48  * compute the renormalized angular momentum nu by solving the radial
49  * continued fraction equation
50  */
51 
52 #ifndef RENANGMOM_H_SEEN
53 #define RENANGMOM_H_SEEN
54 
55 #include "teukolskydefs.h"
56 
57 /* calculates nu
58  * returns 1 if it suceeds, 0 else */
59 int renangmom(Real epsilon, Real q, int l, int m, Real lambda, Complex *nu);
60 
61 /* calulates nu assuming it is real. returns 1 if it suceeds, 0 else */
62 int renangmom_real(Real epsilon, Real q, int l, int m, Real lambda, Real *nu);
63 
64 /* uses about the closest thing to a brute force root finder that I could
65  * come up with to search for real nu. Returns 1 if it succeeds */
66 int renangmom_real_divide_search(Real epsilon, Real q, int l, int m,
67  Real lambda, Real *nu);
68 
69 /* calulates nu assuming it is on the special line.
70  * Returns 1 if it suceeds, 0 else */
71 int renangmom_half(Real epsilon, Real q, int l, int m, Real lambda,
72  Real *imnu);
73 
74 /* calculates nu assuming it is on the line Re(nu) = 1 (so any int is
75  * then a solution)
76  * Returns 1 if it suceeds, 0 else */
77 int renangmom_iint(Real epsilon, Real q, int l, int m, Real lambda,
78  Real *imnu);
79 
80 /* Calculates nu when epsilon is too large for the region checks to work
81  * Assumes nu is complex */
82 int renangmom_far(Real epsilon, Real q, int l, int m, Real lambda,
83  Complex *nu);
84 
85 /* a very rough guess at Im(nu), used internally.
86  * returns the imaginary part of the nu such that beta(0) vanishes */
87 Real nu_predictor(Real epsilon,Real q,int m,Real lambda);
88 
89 #endif /* RENANGMOM_H_SEEN */
90 /* specialradial.h
91  * Functions to calculate properties of the radial continued fraction
92  * at special points
93  */
94 
95 #ifndef SPECIALRADIAL_H_SEEN
96 #define SPECIALRADIAL_H_SEEN
97 
98 #include "teukolskydefs.h"
99 
100 /* estimate of the precision of the results of the special functions, as
101  * a multiple of their term sizes */
102 #define SPECIAL_TERM_NOISE 3e-15
103 
104 /* calculate the value of the function at nu = -1/2
105  * If term is not NULL, the address it points to will be set to the magnitude
106  * of one of the terms in the final addition */
107 Real radial_half_value(Real epsilon, Real q, int m, Real lambda, Real *term);
108 
109 /* calculate the slope of the function at nu = 1
110  * If term is not NULL, the address it points to will be set to the magnitude
111  * of one of the terms in the final addition */
112 Real radial_int_slope(Real epsilon, Real q, int m, Real lambda, Real *term);
113 
114 #endif /* SPECIALRADIAL_H_SEEN */