Astronomical Applications Department, U.S. Naval Observatory Sensitivity Integral Page 6
(
)
cost
(
)
optimize tmp
+
+
+
+
119 additions
186 multiplications
91 divisions
26 functions
108 assignments
This is about as simplified as we can possibly make this integration result. Finally, create a fortran
subroutine from the Maple procedure and write it to disk.
fortran sensitivity_expr optimized
=
mode
double
=
precision
double
,
,
,
,
(
=
filename
"d:/FAMEStuff/PhotonSensitivity/SensitivityIntegral.f" )
For reference, both the indefinite integration result and the optimized fortran subroutine are shown
in the
Appendix
.
3. Check of the Indefinite Integral
Differentiate the indefinite integration result and check that it is equal to the integrand.
:=
gawdawfulmess
expand
-
x
(
)
rhs indef
integrand
1
(
)
cost %
+
+
+
+
5770 additions
27247 multiplications
2328 divisions
5754 functions
2243 subscripts
(
)
collect
,
,
gawdawfulmess [
]
,
,
,
sin cos
(
)
seq
,
a
k
=
k
..
0
4
x
factor
(
)
cost %
+
+
+
54 additions
174 multiplications
13 functions
55 subscripts
(
)
factor
(
)
combine %%
0
Whew.
4. Definite Integration by Parts
=
(
)
S , , , ,
,
r s g T
1
2
d
1
2
integrand
1
x
=
(
)
S , , , ,
,
r s g T
1
2
d
1
2
(
)
+
+
+
+
a
0
a
1
x
a
2
x
2
a
3
x
3
a
4
x
4
(
)
sin s x
2
(
)
-
(
)
sin r x
(
)
sin r g x
2
x
:=
integral
(
)
rhs %
Page 6