Thiele's interpolation formula: Difference between revisions
m
→{{header|Perl 6}}: default to 12 element table, 'cos' converges slowly
m (added whitespace before the TOC, added a Task (bold) header.) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: default to 12 element table, 'cos' converges slowly) |
||
Line 746:
=={{header|Perl 6}}==
{{
Implemented to parallel the (generalized) formula. (i.e. clearer, but naive and very slow.)
<lang perl6>use v6;
Line 783:
}
sub MAIN($tblsz = 12) {
my %invsin = mk-inv(&sin, 0.05, $tblsz);
my %invcos = mk-inv(&cos, 0.05, $tblsz);
Line 799:
}</lang>
Output:
<pre>pi = 3.14159265358979
estimations using a table of
sin interpolation: 3.
cos interpolation:
tan interpolation: 3.
=={{header|PicoLisp}}==
|