Курсовая работа: Отыскание корня уравнения методом половинного деления
LOCATE 2, 18
PRINT "Gruppa PS0601, Kudlo Alexey"
LOCATE 4, 15
INPUT "Vvedite a, b, E"; afix, bfix, E
PRINT TAB(14); "Znacheniya f(x) na [a;b]"
PRINT TAB(19); "x f(x)"
FOR i = 0 TO 10
PRINT USING " ##.### ##.####"; i * .3; integr(0, i * .3, .0001)
NEXT i
xx = uravn(afix, bfix, E)
PRINT TAB(5); "Iskomij koren` x*="; xx; " bil najden s tochnost`ju E="; E
END
FUNCTION fint (t)
IF t = 0 THEN fint = 1 ELSE fint = SIN(t) / t
END FUNCTION
FUNCTION integr (afix, x, E)
aint = afix: bint = x
nint = 2: h = (bint - aint) / 2: s = (fint(aint) + 4 * fint((aint + bint) / 2) + fint(bint)) * (h / 3)
DO
nint = 2 * nint: h = (bint - aint) / nint: s1 = s: cin = 4: x = aint: s = fint(aint) + fint(bint)
FOR i = 1 TO nint - 1
x = x + h: s = s + cin * fint(x): cin = 6 - cin
NEXT i
s = s * h / 3
LOOP UNTIL ABS(s - s1) < E
x = bint
integr = s - 1.570796
END FUNCTION