Thiele's interpolation formula: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl 6}}: default to 12 element table, 'cos' converges slowly)
m (added whitespace to the task's preamble, used a better glyph for pi, added bullet points, used a large font for the Greek and math symbols, italics, and subscripts to make them easier to read, made the rho glyph consistent as in the formulae.)
Line 3: Line 3:


<br>
<br>
'''[[wp:Thiele's_interpolation_formula|Thiele's interpolation formula]]''' is an interpolation formula for a function ''f''(•) of a single variable. It is expressed as a [[continued fraction]]:
'''[[wp:Thiele's_interpolation_formula|Thiele's interpolation formula]]''' is an interpolation formula for a function ''f''(•) of a single variable. &nbsp; It is expressed as a [[continued fraction]]:


:<math> f(x) = f(x_1) + \cfrac{x-x_1}{\rho_1(x_1,x_2) + \cfrac{x-x_2}{\rho_2(x_1,x_2,x_3) - f(x_1) + \cfrac{x-x_3}{\rho_3(x_1,x_2,x_3,x_4) - \rho_1(x_1,x_2) + \cdots}}} </math>
:: <big><big><math> f(x) = f(x_1) + \cfrac{x-x_1}{\rho_1(x_1,x_2) + \cfrac{x-x_2}{\rho_2(x_1,x_2,x_3) - f(x_1) + \cfrac{x-x_3}{\rho_3(x_1,x_2,x_3,x_4) - \rho_1(x_1,x_2) + \cdots}}} </math></big></big>


ρ represents the [[wp:reciprocal difference|reciprocal difference]], demonstrated here for reference:
<big><big><math> \rho </math></big></big> &nbsp; represents the &nbsp; [[wp:reciprocal difference|reciprocal difference]], &nbsp; demonstrated here for reference:


:<math>\rho_1(x_0, x_1) = \frac{x_0 - x_1}{f(x_0) - f(x_1)}</math>
:: <big><big><math> \rho_1(x_0, x_1) = \frac{x_0 - x_1}{f(x_0) - f(x_1)} </math></big></big>


:<math>\rho_2(x_0, x_1, x_2) = \frac{x_0 - x_2}{\rho_1(x_0, x_1) - \rho_1(x_1, x_2)} + f(x_1)</math>
:: <big><big><math> \rho_2(x_0, x_1, x_2) = \frac{x_0 - x_2}{\rho_1(x_0, x_1) - \rho_1(x_1, x_2)} + f(x_1) </math></big></big>


:<math>\rho_n(x_0,x_1,\ldots,x_n)=\frac{x_0-x_n}{\rho_{n-1}(x_0,x_1,\ldots,x_{n-1})-\rho_{n-1}(x_1,x_2,\ldots,x_n)}+\rho_{n-2}(x_1,\ldots,x_{n-1})</math>
:: <big><big><math> \rho_n(x_0,x_1,\ldots,x_n)=\frac{x_0-x_n}{\rho_{n-1}(x_0,x_1,\ldots,x_{n-1})-\rho_{n-1}(x_1,x_2,\ldots,x_n)}+\rho_{n-2}(x_1,\ldots,x_{n-1}) </math></big></big>


Demonstrate Thiele's interpolation function by:
Demonstrate Thiele's interpolation function by:
# Building a 32 row ''trig table'' of values of the trig functions ''sin'', ''cos'' and ''tan''. e.g. '''for''' x '''from''' 0 '''by''' 0.05 '''to''' 1.55...
# Building a &nbsp; '''32''' &nbsp; row ''trig table'' of values &nbsp; for &nbsp; <big><big><math> x </math></big></big> &nbsp; from &nbsp; '''0''' &nbsp; by &nbsp; '''0.05''' &nbsp; to &nbsp; '''1.55''' &nbsp; of the trig functions:
#* &nbsp; '''sin'''
#* &nbsp; '''cos'''
#* &nbsp; '''tan'''
# Using columns from this table define an inverse - using Thiele's interpolation - for each trig function;
# Using columns from this table define an inverse - using Thiele's interpolation - for each trig function;
# Finally: demonstrate the following well known trigonometric identities:
# Finally: demonstrate the following well known trigonometric identities:
#* 6 &times; sin<sup>-1</sup> &frac12; = &pi;
#* &nbsp; <big><big> 6 &times; sin<sup>-1</sup> &frac12; = <math> \pi </math> </big></big>
#* 3 &times; cos<sup>-1</sup> &frac12; = &pi;
#* &nbsp; <big><big> 3 &times; cos<sup>-1</sup> &frac12; = <math> \pi </math> </big></big>
#* 4 &times; tan<sup>-1</sup> 1 = &pi;
#* &nbsp; <big><big> 4 &times; tan<sup>-1</sup> 1 = <math> \pi </math> </big></big>
<br><br>
<br><br>