DataMuseum.dk

Presents historical artifacts from the history of:

MIKADOS

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about MIKADOS

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦94b27b649⟧

    Length: 1192 (0x4a8)
    Notes: Mikados TextFile, Mikados_K
    Names: »BISECTIO«

Derivation

└─⟦bcf7b34c7⟧ Bits:30003895/4xCOMAL2.imd 4 * COMAL - SPC/1 - Disketter til bogen
    └─⟦this⟧ »BISECTIO« 

Text

0010 // ------------------------- bisection ------------------------
0020 // 
0030 PROC FNF(X1)
0040 FNF:=X1*X1-3*X1-4
0050 ENDPROC FNF
0060 // 
0070 CLEAR 
0080 DIM S$ OF 1
0085 INTEGER I
0090 PRINT "Bisection"
0100 PRINT 
0110 REPEAT 
0120 REPEAT 
0130 INPUT "Indtast intervallets venstre endepunkt:   ":VENSTRE
0140 INPUT "Indtast intervallets højre endepunkt:     ":HØJRE
0150 UNTIL HØJRE-VENSTRE>0
0160 GLVENSTRE:=VENSTRE;GLHØJRE:=HØJRE
0170 FV:=FNF(VENSTRE)
0175 FH:=FNF(HØJRE)
0180 I:=0
0190 IF FV*FH>0 THEN 
0200 PRINT "Funktionen har ikke modsat fortegn i ";VENSTRE;" og ";HØJRE
0210 PRINT 
0220 INPUT "                                                Tast 'Return!":S$
0230 CLEAR 
0240 ENDIF 
0250 UNTIL FV*FH<=0
0260 INPUT "Indtast den nøjagtighed hvormed roden ønskes bestemt:   ":EPS
0270 REPEAT 
0280 I:=I+1
0290 MIDTPUNKT:=(HØJRE+VENSTRE)/2
0300 FM:=FNF(MIDTPUNKT)
0310 IF FV*FM<=0 THEN 
0320 HØJRE:=MIDTPUNKT
0330 FH:=FM
0340 ELSE 
0350 VENSTRE:=MIDTPUNKT
0360 FV:=FM
0370 ENDIF 
0380 UNTIL HØJRE-VENSTRE<2*EPS
0390 ROD:=(HØJRE+VENSTRE)/2
0400 PRINT 
0410 PRINT "Efter ";I;" halveringer af intervallet fra ";GLVENSTRE;" til ";
0420 PRINT GLHØJRE;" er roden med ";
0430 PRINT "en nøjagtighed på ";EPS;" fundet til:   ";ROD