TAILIEUCHUNG - Evaluation of Functions part 8

Imagine that you have a procedure which computes a function f(x), and now you want to compute its derivative f (x). Easy, right? The definition of the derivative, the limit as h → 0 of f (x) ≈ f(x + h) − f(x) h () | 186 Chapter5. Evaluation ofFunctions Numerical Derivatives Imagine that you have a procedure which computes a function f x and now you want to compute its derivative f 0 x . Easy right The definition of the derivative the limit as h 0 of s o S ffx a f x h - f x h 0 0 0 71 71 practically suggests the program Pick a small value h evaluate f x h you f j j probably have f x already evaluated but if not do it too finally apply equation i E . What more needs to be said o S Quite a lot actually. Applied uncritically the above procedure is almost guaranteed to produce inaccurate results. Applied properly it can be the right way to compute a derivative only when the function f is fiercely expensive to compute 5 when you already have invested in computing f x and when therefore you want to get the derivative in no more than a single additional function evaluation. In such a situation the remaining issue is to choose h properly an issue we now discuss I I. There are two sources of error in equation truncation error and roundoff 2 a error. The truncation error comes from higher terms in the Taylor series expansion O C. Eg f x h f x hf x 1 h2f x 1 tif x I Hi 2 6 o whence 1 x I - 1 x f 2 hf fill o O - M W The roundoff error has various contributions. First there is roundoff error in h . . . . . Suppose by way of an example that you are at a point x and you blindly e 3 g choose h . Neither x nor x h is a number with s g- Q. 0 3 an exact representation in binary each is therefore represented with some fractional error characteristic of the machine s floating-point format em whose value in single precision may be 10-7. The error in the effective value of h namely the difference 8 - between x h and x as represented in the machine is therefore on the order of em x g which implies a fractional error in h of order emx h 10-2 By equation S-a g SS this immediately implies at least the same large fractional error in the

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.