Guest User

Untitled

a guest
Dec 15th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3. double f(double x,double h){
  4. return (sin(x+h)-sin(x))/h;
  5. }
  6. int main(){
  7. double h = 1 / pow(2,16);
  8. double a1 = (4*f(1,h) - f(1,2*h))/3;
  9. printf("cos(1) = %.12f \nd/dx sin(1) = %.12f",cos(1),a1);
  10. return 0;
  11. }
Add Comment
Please, Sign In to add comment