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

PROGRAMMER'S TOOLBOX • Remember, because the shape of the function near its minimum is almost always parabolic when looked at with enough "zoom" applied, the trough of the minimum gets more and more shallow as we get closer to it. smaller, and a a result, y_range will increase. Given these two ranges, I can now defin e what I consider to be a robust criterion for convergence: double-precision computations. The best we can hope for is roughly the square root of the machine pl-ecision. On the other hand, we can expect = Yo +..L(X2 -XO -~lm c 2 - or: (12) About error criteria A moment ago I said that I felt Brent's choice of a relative error criterion in x was unfortunate, because it may lead to division by zero. Only the addition of an arbitrary constant prevents numerical disaster. A far better approach is to use an absolute criterion in the first place. Fortunately, we are in a perfect posi- tio n to take this approach because the original search range is given going in . If we can reduce the e rror in x to, say, one part in a million of the o riginal range, I'd have to say we've pinned down the minimum pre tly doggone well. Remembe r, because the shape of the fun ction near its minimum i almost always para boli c when looked at with enough "zoom" applied, the trough of the minimum gets more and more shallow as we ge t close r to it. Therefore, we can't expect this algo- rithm (or any othe r) to give the kind of precision we' re used to seeing in .f. (X2 -XO)- ~l 2 2 the y-value to be accu rate to machine precision , and I'm intending to use both . Again , I intend to use an absolute measure (or, to be more pre- cise, a measure that is relative, as mea- sured by the full range as opposed to the change from step to step) . The only problem is, the full range of val- ues of x is known going in, but those of Y = j( x) are not. Nevertheless, we can determine the full range simply by recording the largest and smallest val- ue of y found so far. Based on these notions, I'm going to define the following error critel;a for convergence. Let e be some input value giving the precision desired, as a precision relative to the maximum range. Then define: x_range = x2 - xO (13) where the x2 and xO referred to here are the original values, that is, they define the overall range within which we search for a minimum. Likewise, let: y_range = bis-y - LittLe-y (14) where the values of bis-y and L it- t Le-y are dynamic. The parameter bis-y will, of necessity, be either the original Yo or Y2, depending on which is larger. The starting value for L it- tLe-y will be the first value of )'1> the result after we get in to the configura- tion where Equation 1 holds. As the search proceeds, we will hopefully find poin ts whose heights are lower than the current minimum; that is, we are sliding downhill to the true minimum. As this happens, L ittLe-y can only get 26 DECEMBER 2000 Embedded Systems Programming ~ < .f;(x _ range) ~y < e(y _ range) Here, I've been necessarily vague as to what ~x and ~Y are. In general , they' re the differences between two estimates of the minimum values, but I can't be more specific at this time. We might define ~x, for example, to be the dif- ference between the values given by the two parabolic fits of a five-point fit. We also might define it to be the dif- ference between the results of two suc- cessive passes or, as Brent does, we might define it to be the difference between estimates two passes apart. Those are details that remain to be worked out. Either way, Equation 15 defin es the condition that we are ready to accept the estimate as a con- verged solution. Also, either way, both of the conditions of Equation 15 must be satisfied. Recall that in the golden section method we stop when the points bracketing the minimum (Xo and ~, in our current notation) are shmnk together to the necessary degree of accuracy. I am not sure yet that this is a reasonable requirement on the par- abolic solution. I have the feeling that we cannot reasonably achieve this condition without using golden sec- tions. That is why both Brent and I lean towards comparing successive estimates, rather than the bracketing values. The test functions Until now, I've been mostly using a single function for my testing. This is the now familiar one: (16) (15)

- 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