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

PROGRAMMER'S TOOLBOX
Suppose, as I suggested earlier, we retain (at least) five successive data
points, with the middle one being the best minimum to date. This means that we have two points on either side of the minimum.
one. If the fun ction is indeed an absolute value, we should find the solution immediately. Consider th e two straight li ne segments:
Suppose, as r suggested earli er, we
reta in (at least) five successive data points, with the middle one be ing the best minimum to date. This means
LISTING 2 11/2
II Local minimizer; Sets up conditions for iteration double minimize(double (*f)(double), double xO, double x2, long nH double yO, x1, y1, y2, xmin, ymin, x, y;
double dx = (x2 - xO)/n;
yO = f(xQ); xmin = xO; ymin = yO; x1 = xO+dx; y1 = f(x1);
II wait for function to turn downwards while«x1 < x2) && (y1 > ymin»{ xO = x1; yO = y1; x1 += dx; y1 = f(x1);
}
if(x1 >= x2) return xmi n;
II now watch for it to turn up again
x = x1-+1:Jx; y = f(x); while«x < x2) && (y < y1»{ xO = x1; yO = y1;
x1 = x; y1 = y; x = min(x + dx, x2); y = f(x);
}
i f(x >= x2) return x;
else return findmin(f, xO, yO, x1, y1, x2, y2); }
= Y4 - Y3 X4 -X3
(21)
Where these two lines cross, their val- ues are equaL Hence, at this point:
th at we have two points on either side of the minimum. And that means we can fi t straight lines through the two points o n either side of the middle
I I (x) = Yo +ml(x -xo) h(X)=Y3 + 1112 (X -X3)
(20) where 11!1 and nl

- December001
- December002
- December003
- December004
- December005
- December006
- December007
- December008
- December009
- December010
- December011
- December012
- December013
- December014
- December015
- December016
- December017
- December018
- December019
- December020
- December021
- December022
- December023
- December024
- December025
- December026
- December027
- December028
- December029
- December030
- December031
- December032
- December033
- December034
- December035
- December036
- December037
- December038
- December039
- December040
- December041
- December042
- December043
- December044
- December045
- December046
- December047
- December048
- December049
- December050
- December051
- December052
- December053
- December054
- December055
- December056
- December057
- December058
- December059
- December060
- December061
- December062
- December063
- December064
- December065
- December066
- December067
- December068
- December069
- December070
- December071
- December072
- December073
- December074
- December075
- December076
- December077
- December078
- December079
- December080
- December081
- December082
- December083
- December084
- December085
- December086
- December087
- December088
- December089
- December090
- December091
- December092
- December093
- December094
- December095
- December096
- December097
- December098
- December099
- December100
- December101
- December102
- December103
- December104
- December105
- December106
- December107
- December108
- December109
- December110
- December111
- December112
- December113
- December114
- December115
- December116
- December117
- December118
- December119
- December120
- December121
- December122
- December123
- December124
- December125
- December126
- December127
- December128
- December129
- December130
- December131
- December132
- December133
- December134
- December135
- December136
- December137
- December138
- December139
- December140
- December141
- December142
- December143
- December144
- December145
- December146
- December147
- December148
- December149
- December150
- December151
- December152
- December153
- December154
- December155
- December156
- December157
- December158
- December159
- December160
- December161
- December162
- December163
- December164
- December165
- December166
- December167
- December168
- December169
- December170
- December171
- December172
- December173
- December174
- December175
- December176
- December177
- December178
- December179
- December180
- December181
- December182
- December183
- December184
- December185
- December186
- December187
- December188
- December189
- December190
- December191
- December192
- December193
- December194
- December195
- December196
- December197
- December198