Thiele's interpolation formula: Difference between revisions

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.
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:
 
<br>
'''[[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]]:
 
:: <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>
 
ρ<big><big><math> \rho </math></big></big> &nbsp; represents the &nbsp; [[wp:reciprocal difference|reciprocal difference]], &nbsp; demonstrated here for reference:
 
:: <big><big><math> \rho_1(x_0, x_1) = \frac{x_0 - x_1}{f(x_0) - f(x_1)} </math></big></big>
 
:: <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>
 
:: <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:
# Building a &nbsp; '''32''' &nbsp; row ''trig table'' of values of&nbsp; thefor trig&nbsp; functions<big><big><math> ''sin'',x ''cos''</math></big></big> and&nbsp; ''tan''.from e.g.&nbsp; '''for0''' x&nbsp; by &nbsp; '''from0.05''' 0&nbsp; to &nbsp; '''by1.55''' 0.05&nbsp; '''to'''of the trig functions: 1.55...
#* &nbsp; '''sin'''
#* &nbsp; '''cos'''
#* &nbsp; '''tan'''
# Using columns from this table define an inverse - using Thiele's interpolation - for each trig function;
# Finally: demonstrate the following well known trigonometric identities:
#* &nbsp; <big><big> 6 &times; sin<sup>-1</sup> &frac12; = &<math> \pi; </math> </big></big>
#* &nbsp; <big><big> 3 &times; cos<sup>-1</sup> &frac12; = &<math> \pi; </math> </big></big>
#* &nbsp; <big><big> 4 &times; tan<sup>-1</sup> 1 = &<math> \pi; </math> </big></big>
<br><br>