1
CLS
e = .0001
a = .08
b = 1.5
x = (b - a) / 2 + a
sigma = 2 * x - 3 * LOG(x) - 2
iter = 0
DO WHILE sigma > e OR -sigma > e
x = (b - a) / 2 + a
sigma = 2 * x - 3 * LOG(x) - 2
iter = iter + 1
IF sigma > 0 THEN
a = x
ELSE
b = x
END IF
LOOP
PRINT "x1 = "; x
PRINT "iteracii: "; iter
a = 1.5
b = 3
x = (b - a) / 2 + a
sigma = 2 * x - 3 * LOG(x) - 2
iter = 0
DO WHILE sigma > e OR -sigma > e
x = (b - a) / 2 + a
sigma = 2 * x - 3 * LOG(x) - 2
iter = iter + 1
IF sigma > 0 THEN
b = x
ELSE
a = x
END IF
LOOP
PRINT "x2 = "; x
PRINT "iteracii: "; iter
2
CLS
e = .0001
a = .08
b = 1.5
sigma = 999999
iter = 0
FOR i = a TO b STEP e
Y = 2 * i - 3 * LOG(i) - 2
iter = iter + 1
IF ABS(Y) < sigma THEN
X = i
sigma = ABS(Y)
END IF
NEXT
PRINT "X1 = "; X
PRINT "iteracii: "; iter
a = 1.5
b = 3
sigma = 999999
iter = 0
FOR i = a TO b STEP e
Y = 2 * i - 3 * LOG(i) - 2
iter = iter + 1
IF ABS(Y) < sigma THEN
X = i
sigma = ABS(Y)
END IF
NEXT
PRINT "X2 = "; X
PRINT "iteracii: "; iter