Anonymous user
Numerical integration/Gauss-Legendre Quadrature: Difference between revisions
Numerical integration/Gauss-Legendre Quadrature (view source)
Revision as of 13:04, 1 November 2013
, 10 years ago→version 2: removed timing statements, they weren't meant to be included; I don't feel that exact timings should be used for comparisons; relative timings are ok. -- ~~~~
Walterpachl (talk | contribs) m (REXX made V2 timing work and added it to output. Also add timing to V1) |
m (→version 2: removed timing statements, they weren't meant to be included; I don't feel that exact timings should be used for comparisons; relative timings are ok. -- ~~~~) |
||
Line 1,236:
Note that the function values for '''pi''' and '''e''' should have more precision than the number of digits specified.
<lang rexx>/*REXX pgm does numerical integration using Gauss-Legendre Quadrature.*/
digs=40; d2=digs*2
numeric digits digs; tiny='1e-'d2; pi=pi(); a=-3; b=3; bma=b-a; bpa=b+a
Line 1,282 ⟶ 1,281:
say sep; say left('',4) true " {exact}"
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────COS subroutine───────────────────────────────*/
Line 1,324 ⟶ 1,322:
──── ─────────────────────────────────────────── ────────────
20.035749854819803797949187238931656120356208246365726928811306502092785210360717 {exact}
</pre>
=={{header|Tcl}}==
|