Chebyshev coefficients: Difference between revisions

Content deleted Content added
m →‎{{header|REXX}}: changed wording in the REXX section header.
Trizen (talk | contribs)
Line 53:
my @pin = map { ($_ + 0.5) * (PI/$n) } 0..$n-1;
my @f = map { $func->( cos($_) * $bma + $bpa ) } @pin;
my @c = (0) x $n;
for my $j (0 .. $n-1) {
$c[$j] += $f[$_] * cos($j * $pin[$_]) for 0..$n-1;
Line 63:
print "$_\n" for chebft(sub{cos($_[0])}, 0, 1, 10);</lang>
 
{{out}}<pre>
<pre>1.64716947539031
-0.232299371615172
-0.0537151146220477
Line 73:
1.15214274787334e-08
6.59629917354465e-10
-1.00219943455215e-11</pre>
</pre>
 
=={{header|Perl 6}}==