Numerical integration/Gauss-Legendre Quadrature: Difference between revisions
Numerical integration/Gauss-Legendre Quadrature (view source)
Revision as of 14:42, 14 August 2014
, 9 years agoAdd expressions and SegmentBinding
(Add expressions and SegmentBinding) |
|||
Line 49:
RECORD ==> Record(x : List Fraction Integer, w : List Fraction Integer)
p := legendreP(n,z)
q := n/2*D(p, z)*legendreP(subtractIfCan(n,1)::NNI, z)
Line 56:
[x,w]
eps := 1/10^100
u :=
interval := segment segbind
var := variable segbind
a := lo interval
b := hi interval
c := (a+b)/2
h := (b-a)/2
h*reduce(+,[wi*
▲gaussInt(x +-> 4/(1+x^2), 0, 1, 20)
(1) 3.1415926535_8979323846_2643379815_9534002592_872901276
Line 69 ⟶ 72:
% - %pi
(2) - 0.3463549483_9378821092_475 E -26</lang>
=={{header|C}}==
|