Evaluation of Functions part 4

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. | Polynomials and Rational Functions 173 Thompson . and Barnett . 1986 Journal ofComputational Physics vol. 64 pp. 490-509. 5 Lentz WJ. 1976 Applied Optics vol. 15 pp. 668-671. 6 Jones . 1973 in Padé Approximants and Their Applications PR. Graves-Morris ed. London Academic Press p. 125. 7 Polynomials and Rational Functions A polynomial of degree N is represented numerically as a stored array of coefficients c j with j 0 . N. We will always take c 0 to be the constant term in the polynomial c N the coefficient of xN but of course other conventions are possible. There are two kinds of manipulations that you can do with a polynomial numerical manipulations such as evaluation where you are given the numerical value of its argument or algebraic manipulations where you want to transform the coefficient array in some way without choosing any particular argument. Let s start with the numerical. We assume that you know enough never to evaluate a polynomial this way p c 0 c 1 x c 2 x x c 3 x x x c 4 x x x x or even worse p c 0 c 1 x c 2 pow x c 3 pow x c 4 pow x Come the computer revolution all persons found guilty of such criminal behavior will be summarily executed and their programs won t be It is a matter of taste however whether to write p c 0 x c 1 x c 2 x c 3 x c 4 or p c 4 x c 3 x c 2 x c 1 x c 0 If the number of coefficients c is large one writes p c n for j n-1 j 0 j p p x c j or p c j n while j 0 p p x c j Another useful trick is for evaluating a polynomial P x and its derivative dP x dx simultaneously Sample page from NUMERICAL RECIPES IN C THE ART OF SCIENTIFIC COMPUTING ISBN 0-521-43108-5 p c n dp for j n-1 j 0 j dp dp x p p p x c j 174 Chapter5. Evaluation ofFunctions or p c j n dp while j 0 dp dp x p p p x c j which yields the polynomial as p and its derivative as dp. The above trick which is basically synthetic division 1 2 generalizes to the evaluation of the polynomial and nd of its derivatives simultaneously void .

Bấm vào đây để xem trước nội dung
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.