Astronomical Applications Department, U.S. Naval Observatory Sensitivity Integral Page 13
6
a
4
(
)
cos (
)
 +
2 s
r
r g x
(
)
 +
2 s
r
r g
4
6
a
4
(
)
cos (
)
+ 
2 s
r
r g x
(
)
+ 
2 s
r
r g
4
6
a
4
(
)
cos (
)
+ +
2 s
r
r g x
(
)
+ +
2 s
r
r g
4
+
+

6
a
4
(
)
cos (
)
 
2 s
r
r g x
(
)
 
2 s
r
r g
4
3
16
a
4
(
)
cos (
)

2 s
2 r g x
(
)

s
r g
4
1
2
a
4
x
4

+
+
x
d
:=
last_integral
%
(
)
kernelopts bytesalloc
1024.0
2
35.61847687
We see that we needed over 35 MB of memory to perform the simplifications. This last integral
leads to a fatal explosion of terms if evaluated as a whole:
(
)
value last_integral
System error, ran out of memory
Warning, computation interrupted
This is on a machine with more than 110 MB of memory available for use. Thwarted again by the
easy approach, we will instead do this last integral in pieces.
:=
pieces
[
]
(
)
op
(
)
op
,
1 last_integral
(
)
nops pieces
14
:=
time0
( )
time
:=
k
4
for
in
do
od
p
pieces
;
:=
parts
k
factor
combine
,
d
1
2
p x trig
:=
k
+
k
1
Much better. Now combine those pieces.
:=
sump
0;
for
from
to
do
od
k
4
+
3
(
)
nops pieces
:=
sump
+
sump
parts
k
;
:=
parts
4
(
)
collect
,
,
sump [
]
,
,
,
(
)
seq
,
a
k
=
k
..
0
4
sin cos s
factor
There, we've done the entire sensitivity integral. Let's see what we've got in terms of bloat.
(
)
cost parts
0
+
+
+
+
91 additions
164 multiplications
28 divisions
26 functions
46 subscripts
(
)
cost parts
1
+
+
+
+
174 additions
466 multiplications
32 divisions
26 functions
244 subscripts
Page 13