Chebyshev coefficients: Difference between revisions
Content deleted Content added
m →{{header|Sidef}}: Replaced "Math::PI" with "Num.pi" |
m →{{header|Sidef}}: replaced "Num.pi" with "Number.pi" |
||
Line 513:
var bpa = (0.5 * b+a);
var pi_n = ((0..(n-1) »+» 0.5) »*» (
var f = (pi_n »cos»() »*» bma »+» bpa «call« callback);
var sums = (0..(n-1) «run« {|i| f »*« ((pi_n »*» i) »cos»()) «+» });
Line 522:
chebft(func(v){v.cos}, 0, 1, 10).each { |v|
say ("%+.10e" % v);
}
{{out}}
|