****6A Humanidades
xa=float(input("dar el valor de xa="))
xb=float(input("dar el valor de xb="))
ep=float(input("dar el valor de ep="))
xm=(xa+xb)/2
epp=abs((xb-xm)/2)
while ep<epp:
xm=(xa+xb)/2
fxa=(xa*xa*xa)+(2*xa*xa)-(10*xa)-20
fxb=(xb*xb*xb)+(2*xb*xb)-(10*xb)-20
fxm=(xm*xm*xm)+(2*xm*xm)-(10*xm)-20
epp=abs((xb-xm)/2)
print (round(xa,8)," ",round(xm,8)," ",round(xb,8)," ",round(fxa,8)," ",round(fxm,8)," ",round(fxb,8)," ",round(epp,8))
if (fxm*fxb)>0:
xb=xm
else:
xa=xm
dar el valor de xa=2.7994168
dar el valor de xb=3.4992710
dar el valor de ep=.001
2.7994168 3.1493439 3.499271 -10.38241317 -0.42035639 12.34529989 0.17496355
3.1493439 3.32430745 3.499271 -0.42035639 5.59595373 12.34529989 0.08748177
3.1493439 3.23682567 3.32430745 -0.42035639 2.49817768 5.59595373 0.04374089
3.1493439 3.19308479 3.23682567 -0.42035639 1.01675646 2.49817768 0.02187044
3.1493439 3.17121434 3.19308479 -0.42035639 0.29269287 1.01675646 0.01093522
3.1493439 3.16027912 3.17121434 -0.42035639 -0.06520463 0.29269287 0.00546761
3.16027912 3.16574673 3.17121434 -0.06520463 0.11340042 0.29269287 0.00273381
3.16027912 3.16301293 3.16574673 -0.06520463 0.02401203 0.11340042 0.0013669
3.16027912 3.16164602 3.16301293 -0.06520463 -0.02061776 0.02401203 0.00068345