Numerical integration: Difference between revisions

m
→‎{{header|Perl 6}}: moved commentary to top, fixed language version tag
m (→‎{{header|Perl 6}}: corrected formatting tags)
m (→‎{{header|Perl 6}}: moved commentary to top, fixed language version tag)
Line 3,340:
 
=={{header|Perl 6}}==
The addition of <tt>'''Promise'''</tt>/<tt>'''await'''</tt>, in two places, allows for concurrent computation, and brings a significant speed-up in running time. Which is not to say that it makes this code fast, but it does make it less slow.
 
{{works with|rakudo|2018-09}}
Note that these integrations are done with rationals rather than floats, so should be fairly precise (though of course with so few iterations they are not terribly accurate (except when they are)). Some of the sums do overflow into <tt>Num</tt> (floating point)--currently Rakudo allows 64-bit denominators--but at least all of the interval arithmetic is exact.
{{works with|rakudoRakudo|2018-.09}}
 
<lang perl6>use MONKEY-SEE-NO-EVAL;
 
Line 3,437 ⟶ 3,440:
composite trapezoidal rule: 18000000
quadratic simpsons rule: 18000000</pre>
 
Note that these integrations are done with rationals rather than floats, so should be fairly precise (though of course with so few iterations they are not terribly accurate (except when they are)). Some of the sums do overflow into <tt>Num</tt> (floating point)--currently Rakudo allows 64-bit denominators--but at least all of the interval arithmetic is exact.
 
=={{header|Phix}}==
2,392

edits