# L-29 MCS 507 Fri 28 Oct 2011 : usempmathivfun.py

# Illustration of the evaluation of functions using interval arithmetic 
# with the mpmath package of SymPy

import sympy as sp
from sympy.mpmath import iv
iv.dps = 15
e = iv.exp(1)
print 'e :', e 
print 'log(e) :', iv.log(e)
print 'sin(e) :', iv.sin(e)
print 'cos(e) :', iv.cos(e)
p = iv.pi
print 'pi :', p
print 'sin(pi) :', iv.sin(p)
print 'cos(pi) :', iv.cos(p)
