Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- double f(double x,double h){
- return (sin(x+h)-sin(x))/h;
- }
- int main(){
- double h = 1 / pow(2,16);
- double a1 = (4*f(1,h) - f(1,2*h))/3;
- printf("cos(1) = %.12f \nd/dx sin(1) = %.12f",cos(1),a1);
- return 0;
- }
Add Comment
Please, Sign In to add comment