Created
December 13, 2017 06:49
-
-
Save pureexe/39100fb244c024254472bcc398d306ad to your computer and use it in GitHub Desktop.
Numerical differential with 2 point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| #include<math.h> | |
| int main(){ | |
| double h = 1 / pow(2,16); | |
| double df = (sin(1+h) - sin(1)) / h; | |
| printf("cos(1) = %.6f \nd/dx sin(1) = %.6f",cos(1),df); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment