Astronomical Applications Department, U.S. Naval Observatory Sensitivity Integral Page 27

=

(

)

F

,

1

2

1

2

*k*

( )

*A*

*k*

1

*k*

*k*

( )

*B*

*k*

1

*k*

is purely a function of the frequencies (and coefficients

*a*

*i*

) and is well-behaved. Hence,

the frequency function

(

)

F

,

1

2

need be calculated *only once per integration over the sky*

, making evaluation of

very inexpensive.

**6.3.3. Fortran Subroutines**

Now we create optimized fortran subroutines to calculate the fourth-order expansion,

*defint_x4*

(

)

*S*

4

, , , ,

,

*r s g T*

1

1

(

)

+

1

1

2520

*s*

2

*r*

2

1

5

(

)

- +

1

*g*

2

=

280 *a*

4

(

)

+

+

2

3

3 (

)

+

+

+

+

+

+

6

6

5

15

4

21

3

18

2

9

3

1

4

315 *a*

3

(

)

+

2 (

)

+

+

2

2

2 (

)

+

+

+

+

4

4

3

6

2

4

2

1

3

+

360 *a*

2

(

)

+

+

+

+

+

+

6

7

5

21

4

35

3

35

2

21

7

1

2

+

420 *a*

1

(

)

+

2 (

)

+

+

2

3

3 (

)

+ +

2

1

1

504 *a*

0

(

)

+

+

+

+

5

10

10

2

5

3

4

+

+

and the corresponding error function,

. First we process the series approximation.

Create a Maple procedure to evaluate the series approximation expression.

:=

*tmp*

(

)

subs

,

,

(

)

seq

,

=

*a*

*k*

.

*a k*

=

*k*

..

0

4

=

1

1

(

)

rhs *defint_x4*

*F* :=

(

)

optimize/makeproc

,

[

]

(

)

optimize

,

*tmp tryhard*

=

*parameters*

[

]

,

,

, , ,

1

(

)

seq

,

.

*a i*

=

*i*

..

0

4

*s r g*

The cost of the optimized expression sequence is

(

)

cost

(

)

optimize

,

*tmp tryhard*

+

+

32 *additions*

52 *multiplications*

10 *assignments*

Create a fortran subroutine from the Maple procedure.

fortran *F optimized*

=

*mode*

*double*

=

*precision*

*double*

,

,

,

,

(

=

*filename*

"d:/FAMEStuff/PhotonSensitivity/expansion4.f" )

Next, we split the error function into geometrical and frequency parts, so that the

frequency part can be evaluated independently. Create a Maple procedure to evaluate the

frequency function:

(

)

remove

,

,

*has*

(

)

rhs *error_expr*

*s*

Page 27