Question: A useful application of Lagrange interpolation is called a table look-up. As the name implies, this involves looking-up an intermediate value from a table. To

A useful application of Lagrange interpolation is called a table look-up. As the name implies, this involves “looking-up” an intermediate value from a table. To develop such an algorithm, the table of x and ƒ(x) values are first stored in a pair of one-dimensional arrays. These values are then passed to a function along with the x value you wish to evaluate. The function then performs two tasks. First, it loops down through the table unit it finds the interval within which the unknown lies. Then it applies a technique like Lagrange interpolation to determine the proper ƒ(x) value. Develop such a function using a cubic Lagrange polynomial to perform the interpolation. For intermediate intervals, this is a nice choice because the unknown will be located in the interval in the middle of the four points necessary to generate the cubic. For the first and last intervals, use a quadratic Lagrange polynomial. Also have your code detect when the user requests a value outside the range of x’s. For such cases, the function should display an error massage. Test your program for ƒ(x) = In x using data from x = 0, 1, 2,., 10.

Step by Step Solution

3.34 Rating (166 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The following VBA program uses cubic interpolation for all inte... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

45-M-N-A-C-F (48).docx

120 KBs Word File

Students Have Also Explored These Related Numerical Analysis Questions!