Advertisement
paulohrpinheiro

Exercício 4 capítulo 3

Dec 28th, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --ep4
  2. fatorial x  | (x==1) = 1
  3.             | otherwise = x * fatorial (x-1)
  4.  
  5. e_x x n | (n==0) = 1
  6.         | otherwise = ( (x**n) / fatorial n ) + (e_x x (n-1) )
  7.  
  8. delta' x n  | ((exp x) - (e_x x n)) < 0.001 = 0
  9.            | otherwise = 1 + delta' x (n+1)
  10.  
  11. delta x = delta' x 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement