c10-2 (Numerical Recipes in C), страница 2
Описание файла
Файл "c10-2" внутри архива находится в папке "Numerical Recipes in C". PDF-файл из архива "Numerical Recipes in C", который расположен в категории "". Всё это находится в предмете "цифровая обработка сигналов (цос)" из 8 семестр, которые можно найти в файловом архиве МГТУ им. Н.Э.Баумана. Не смотря на прямую связь этого архива с МГТУ им. Н.Э.Баумана, его также можно найти и в других разделах. Архив можно найти в разделе "книги и методические указания", в предмете "цифровая обработка сигналов" в общих файлах.
Просмотр PDF-файла онлайн
Текст 2 страницы из PDF
Therefore in the code belowyou will find several tests and modifications of a potential new point, imposing thisrestriction. This restriction also interacts subtly with the test for “doneness,” whichthe method takes into account.A typical ending configuration for Brent’s method is that a and b are 2 × x × tolapart, with x (the best abscissa) at the midpoint of a and b, and therefore fractionallyaccurate to ±tol.Indulge us a final reminder that tol should generally be no smaller than thesquare root of your machine’s floating-point precision.10.3 One-Dimensional Search with First Derivatives405}CITED REFERENCES AND FURTHER READING:Brent, R.P.
1973, Algorithms for Minimization without Derivatives (Englewood Cliffs, NJ: PrenticeHall), Chapter 5. [1]Forsythe, G.E., Malcolm, M.A., and Moler, C.B. 1977, Computer Methods for MathematicalComputations (Englewood Cliffs, NJ: Prentice-Hall), §8.2.10.3 One-Dimensional Search with FirstDerivativesHere we want to accomplish precisely the same goal as in the previoussection, namely to isolate a functional minimum that is bracketed by the triplet ofabscissas (a, b, c), but utilizing an additional capability to compute the function’sfirst derivative as well as its value.Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).etemp=e;e=d;if (fabs(p) >= fabs(0.5*q*etemp) || p <= q*(a-x) || p >= q*(b-x))d=CGOLD*(e=(x >= xm ? a-x : b-x));The above conditions determine the acceptability of the parabolic fit. Here wetake the golden section step into the larger of the two segments.else {d=p/q;Take the parabolic step.u=x+d;if (u-a < tol2 || b-u < tol2)d=SIGN(tol1,xm-x);}} else {d=CGOLD*(e=(x >= xm ? a-x : b-x));}u=(fabs(d) >= tol1 ? x+d : x+SIGN(tol1,d));fu=(*f)(u);This is the one function evaluation per iteration.if (fu <= fx) {Now decide what to do with our funcif (u >= x) a=x; else b=x;tion evaluation.SHFT(v,w,x,u)Housekeeping follows:SHFT(fv,fw,fx,fu)} else {if (u < x) a=u; else b=u;if (fu <= fw || w == x) {v=w;w=u;fv=fw;fw=fu;} else if (fu <= fv || v == x || v == w) {v=u;fv=fu;}}Done with housekeeping.
Back for}another iteration.nrerror("Too many iterations in brent");*xmin=x;Never get here.return fx;.