HP Forums
(50G) Gauss-Legendre Abscissae & Weights Programme - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (50G) Gauss-Legendre Abscissae & Weights Programme (/thread-3874.html)



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

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
;
;