Issue link: http://dc.ee.ubm-us.com/i/71837

PROGRAMMER'S TOOLBOX e It doesn't take long to discover that if you take care of the people too well, they multiply like rabbits. The people plow under your croplands and build houses and stores on them. Next thing you know, everyone's starving, the cof· fers are empty, your army is in rebellion, and you're lucky to escape alive. that it's never stressed . Tha t approach is what passes for good engineering in consumer circles. In fact, l contend that some prod- LISTING 1 double precision function fmin(ax,bx,f,tol) double precision ax,bx,tol external f double precision f integer iter c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c Listing continued ~ p. 24 an approximation x to the point where f attains a miniiTUil on the interval (ax,bx) is determined. input .. ax bx f Left endpoint of initial interval right endpoint of initial interval function subprogram which evaluates f(x) for any x in the interval (ax,bx) tol result ( .ge.O.) output .. fmin abcissa approximating the point where f attains a miniiTUil the method used is a combination of golden section search and successive parabolic interpolation. convergence is never much slower than that for a fibonacci search. if f has a continuous second derivative which is positive at the miniiTUil (which is not at ax or bx), then convergence is superlinear, and usually of the order of about 1.324 .... the function f is never evaluated at two points closer together than eps*abs(fmin)+(tol/3), where eps is approximately the square root of the relative machine precision. function and the computed values of if f f are always unimodal when separated by at Least eps*abs(x)+(tol/3), then fmin approximates the abcissa of the global miniiTUil of f on the interval ax,bx with an error Less than 3*eps*abs(fmin)+tol. if f then fmin may approximate a Local, but perhaps non-global, miniiTUil to the same accuracy. this function subprogram i.s a slightly modified version of the algol 60 procedure Localmin given in richard brent, algorithms for minimization without derivatives, prentice-hall, inc. (1973). is not unimodal, desired Length of the interval of uncertainty of the final ucts were never intended to work. I'm talking about the fairly cheap ones tha t come in blister packs, and look very much like the products you used when you were younger. The manu- facturer coun ts on your buying it ba eel on pleasan l memori es. It's not unLil you get it home and unwrap it that you d iscover it's a fake; it doesn ' t ac tually do anythin g. Th e vendo r counts on your not deeming it worth the effort to return the junk. My favorite example is one of those cir- cle-drawin g compasses like we all used in grade school. The new ones look just like the old ones, but they won ' t ho ld a se tting. Wha t? Yo u expected to actually draw a circle? You expected the staple r to actually dri ve staples? Silly you. Nevertheless, un til recently, manu- facturers at least made some pretense of trying to keep th eir custome rs happy. If your product didn 't work right, th ey'd u-y to make it good . They'd replace it, fix it for you, some- times even of fe r you extra perks to keep you happy. Now we move on L o the concept of acceptable loss. Years ago, in the early clays of pe rsonal computing, I got a game fo•- my TRS-80 call ed Hammurabi , the ancestor of all the Si m City sorts of games. In is a unimodal Hammurabi , you' re the king of Babylon, and it's your j ob to run the country so that it prospers, along with you. I reckon everyone who's ever played the game starts out resolving to be the world 's most benevolent king. No starvation, no lack for th e citizens of my coun try. I'm going to be remem- bered for keeping th e populace safe, happy, and well feel . It doe n ' t take long, playing such a game, to discove r that if you take care of th e peopl e too well , they multiply like rabbits. Immigra nts move in from outside to take advan- tage of yo ur la rgesse. The people 20 SEPTEMBER 2000 Embedded Systems Programming

- September001
- September002
- September003
- September004
- September005
- September006
- September007
- September008
- September009
- September010
- September011
- September012
- September013
- September014
- September015
- September016
- September017
- September018
- September019
- September020
- September021
- September022
- September023
- September024
- September025
- September026
- September027
- September028
- September029
- September030
- September031
- September032
- September033
- September034
- September035
- September036
- September037
- September038
- September039
- September040
- September041
- September042
- September043
- September044
- September045
- September046
- September047
- September048
- September049
- September050
- September051
- September052
- September053
- September054
- September055
- September056
- September057
- September058
- September059
- September060
- September061
- September062
- September063
- September064
- September065
- September066
- September067
- September068
- September069
- September070
- September071
- September072
- September073
- September074
- September075
- September076
- September077
- September078
- September079
- September080
- September081
- September082
- September083
- September084
- September085
- September086
- September087
- September088
- September089
- September090
- September091
- September092
- September093
- September094
- September095
- September096
- September097
- September098
- September099
- September100
- September101
- September102
- September103
- September104
- September105
- September106
- September107
- September108
- September109
- September110
- September111
- September112
- September113
- September114
- September115
- September116
- September117
- September118
- September119
- September120
- September121
- September122
- September123
- September124
- September125
- September126
- September127
- September128
- September129
- September130
- September131
- September132
- September133
- September134
- September135
- September136
- September137
- September138
- September139
- September140
- September141
- September142
- September143
- September144
- September145
- September146
- September147
- September148
- September149
- September150
- September151
- September152
- September153
- September154
- September155
- September156
- September157
- September158
- September159
- September160
- September161
- September162
- September163
- September164
- September165
- September166
- September167
- September168
- September169
- September171
- September172
- September173
- September174
- September175
- September176
- September177
- September178
- September179
- September180
- September181
- September182
- September183
- September184
- September185
- September186
- September187
- September188
- September189
- September190
- September191
- September192
- September193
- September194
- September195
- September196
- September197
- September198
- September199
- September200
- September201
- September202
- September203
- September204
- September205
- September206
- September207
- September208
- September209
- September210
- September211
- September212
- September213
- September214
- September215
- September216
- September217
- September218
- September219
- September220
- September221
- September222
- September223
- September224
- September225
- September226
- September227
- September228
- September229
- September230
- September231