(50G) Gauss-Legendre Abscissae & Weights Programme
05-17-2015, 12:20 PM (This post was last modified: 06-15-2017 01:41 PM by Gene.)
Post: #1
 Gerald H Senior Member Posts: 1,452 Joined: May 2014
(50G) Gauss-Legendre Abscissae & Weights Programme
For positive integer input the programme NLGFW returns two lists, one of abscissae & the other the associated weights for Gaussian integration.

eg For input 5 the programme returns

{ 0. .538469310106 .906179845939 }
{ .568888888889 .478628670496 .236926885055 }

NLGFW

::
CK1&Dispatch
BINT1
::
DUP
%2
%<
caseSIZEERR
DUP
%FP
%0=
NcaseSIZEERR
FPTR2 ^PUSHFLAGS_
BINT105
SetSysFlag
FPTR2 ^LEGENDRE
FPTR2 ^RCLVX
ONE{}N
FPTR2 ^VXXLext
INNERDUP
#1+_ONE_DO
SWAP
DUPTYPEZINT?
ITE
FPTR2 ^Z>R
%%>%
ISTOP@
UNROLL
LOOP
DUP
ONE{}N
SWAP
FPTR2 ^XEQ>ARRAY1
SWAPDROPDUP
FPTR 3 92
FPTR2 ^MATRE
FPTR2 ^XEQARRY>
CARCOMP
NULL{}
SWAP
COERCE
#2/
ZERO_DO
SWAP
%ABS
>HCOMP
SWAPDROP
LOOP
OVER
%0=
IT
::
SWAP
>HCOMP
;
SWAP
FPTR 7 3
FPTR2 ^PDer
FPTR 7 1
DROPSWAP
DUPLENCOMP
DUP1LAMBIND
#1+_ONE_DO
2DUP
INDEX@
NTHCOMPDROP
DUPUNROT
FPTR2 ^PEVAL
%SQ_
%1
ROT
%SQ_
%-
%*
%2
SWAP
%/
3UNROLL
LOOP
SWAPDROP
1GETABND
FPTR2 ^POPFLAGS_
DUPUNROT
#2+UNROLL
{}N
;
;
 « Next Oldest | Next Newest »

 Messages In This Thread (50G) Gauss-Legendre Abscissae & Weights Programme - Gerald H - 05-17-2015 12:20 PM

User(s) browsing this thread: 1 Guest(s)