SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Bisecção
Viver é algo que se faz agora ou nunca...
Qual você faz?
Piet Hein
< Implementação | Definir Funções | Testes >

Definir Funções

Python Listing: ../Functions.py.
def Print(f,xs):
    titles=["N","x_k","|f(x_k)|"]
    print "\t".join(titles)
    for n in range( len(xs) ):
        comps=[
            "%02d" % (n+1),
            "%.6f" % xs[n],
            "%.6e" % abs(f(xs[n])),
        ]
        print "\t".join(comps)

        
def f1(x):
    return x*x-1.0

def f2(x):
    return x**4.0-2.0*x**2.0-1.0

#....
< Implementação | Definir Funções | Testes >
Messages:
0 secs.