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.)
m (→‎{{header|Perl 6}}: default to 12 element table, 'cos' converges slowly)
Line 746:
 
=={{header|Perl 6}}==
{{worksWorks with|Rakudorakudo|20152016.0307}}<br>
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:
Output (table size of 6 for want of resources):
 
<pre>pi = 3.14159265358979
estimations using a table of 612 elements:
sin interpolation: 3.1415336398544114159265358961
cos interpolation: 13.687793216562331387286696692
tan interpolation: 3.1482623637861214159090545243</pre>
 
=={{header|PicoLisp}}==
2,392

edits