leastsqrs[4]: Solving the normal equations...
leastsqrs[46]: Verifying the solution...
leastsqrs[569]: Done!
:=
soln
%
As we can see, the solution for this model is quite complicated:
(
)
cost soln
+
+
+
2188 additions 7749 multiplications 5 divisions 5 assignments
(
)
map
,
cost soln
+
+
+
789 additions 2864 multiplications divisions assignments,
[
+
+
+
394 additions 1382 multiplications divisions assignments,
+
+
+
394 additions 1382 multiplications divisions assignments,
+
+
+
217 additions 739 multiplications divisions assignments,
+
+
+
394 additions 1382 multiplications divisions assignments ]
(
)
cost _subslist
+
+
+
254 additions 1249 multiplications 1108 sums 27 assignments
(
)
map
,
cost
(
)
eval
,
soln _subslist
+
+
+
+
1043 additions 4113 multiplications 3968 sums divisions assignments,
[
+
+
+
+
648 additions 2631 multiplications 2487 sums divisions assignments,
+
+
+
+
648 additions 2631 multiplications 2487 sums divisions assignments,
+
+
+
+
471 additions 1988 multiplications 1842 sums divisions assignments,
+
+
+
+
648 additions 2631 multiplications 2487 sums divisions assignments ]
However, it optimizes well:
:=
optsoln
(
)
optimize
,
soln tryhard
(
)
cost optsoln
+
+
+
+
739 additions 1061 multiplications divisions 26 subscripts 447 assignments
The following command produces an optimized procedure, which we will not show here.
(
)
makeproc
,
,
(
)
eval
,
[
]
optsoln _subslist
=
parameters [
]
, ,
N Y t
=
globals [
]
, , , ,
A B C D E
Page 22