By B.V. Cordingley, D.J. Chamund
Read or Download Advanced BASIC Scientific Subroutines PDF
Best languages & tools books
Classification conception is a mathematical topic whose significance in numerous components of laptop technology, so much significantly the semantics of programming languages and the layout of courses utilizing summary facts forms, is generally stated. This e-book introduces classification concept at a degree applicable for desktop scientists and gives useful examples within the context of programming language layout.
This booklet begins with an summary of Hypertext Preprocessor information items (PDO), through getting all started with PDO. Then it covers blunders dealing with, ready statements, and dealing with rowsets, prior to overlaying complicated makes use of of PDO and an instance of its use in an MVC program. eventually an appendix covers the recent object-oriented gains of Hypertext Preprocessor five.
Additional info for Advanced BASIC Scientific Subroutines
PROB. OF EXACTLY NUMSUC SUCCESSES LOCAL: ... R, OB The Subroutines 2170 2180 2190 2200 2210 2220 2230 2240 2250 2260 2270 2280 2290 2300 2310 2320 2330 2340 2350 REM REM 21 CHECK INPUT DATA IF PB < 0 OR PB > 1 OR NB < 1 THEN GOTO 2310 IF NUMSUC > NB OR NUMSUC < 0 THEN GOTO 2310 LET QB 1 - PB LET PX = QB~NB LET FX = PX IF NUMSUC = 0 THEN GOTO 2290 FOR R = 1 TO NUMSUC LET PX (NB + 1 - R)*PB*PX/(R*QB) LET FX = FX + PX NEXT R REM RETURN REM PRINT " PB, NB OR NUMSUC INVALID" PRINT" PB = "; PB; ", NB = "; NB; PRINT ", NUMSUC = "; NUMSUC END Sample Program If five dice are thrown, determine (a) the probability that exactly three sixes are thrown and (b) the probability of throwing three or more sixes.
P, Q, R, V1, V2 ARRAY DIMENSIONS: A() ..... (NUMDAT + 1) V() ..... (NUMDAT) F() ..... 01) LET PVAL = (A(V1) + A(V2»/2 CUMULATIVE FREQUENCY LET NITM = 1 FOR P = 1 TO NUMDAT LET F(NITM) = P LET V(NITM) = A(P) IF A(P) <> A(P + 1) THEN LET NITM = NITM + 1 IF P = NUMDAT THEN LET NITM = NITM - 1 NEXT P RETURN REM REM SHELL SORT LET V1 = NUMDAT REM SET GAP LENGTH LET V1 = INT(V1/2) IF V1 = 0 THEN GOTO 2740 FOR P = 1 TO NUMDAT - V1 FOR Q = P TO 1 STEP -1 LET R = Q + V1 REM COMPARE DATA IF A(Q) > A(R) THEN GOTO 2660 LET Q = 0 GOTO 2700 REM EXCHANGE DATA LET V2 = A(Q) LET A(Q) = A(R) LET A(R) = V2 REM NEXT Q NEXT P The Subroutines 55 2730 GOTO 2560 2740 REM 2750 RETURN Sample Program The following list gives the marks obtained in a test by a class of 60 students.
DFX PRINT" AREA UNDER CURVE ". FX >RUN TIME = 50. 006312. 31 The Subroutines NATURAL LOGARITHM OF THE COMPLETE GAMMA FUNCTION Subroutine: LlVGAAfAf Description Evaluates the natural logarithm of the complete gamma function rea) for a > O. 5ln(27T) + ~ n=l :n_ (l)n-l B - 2n(2n - 1)x n 1 where B 2n are the Bernoulli numbers. Subroutine Listing 2000 2010 2020 2030 2040 2050 2060 2070 2080 2090 2100 2110 2120 2130 2140 2150 2160 2170 REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM REM NATURAL LOGARITHM OF GAMMA FUNCTION SUBROUTINE: LNGAMM EVALUATES THE NATURAL LOGARITHM OF THE GAMMA FUNCTION FOR PARAMETER ALPHA FOR ALPHA> O.