daily pastebin goal
67%
SHARE
TWEET

Untitled

a guest May 17th, 2018 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <cmath>
  2. #include <stdio.h>
  3.  
  4. double y(double x)
  5. {
  6.     return sqrt(4 - (x*x));
  7. }
  8.  
  9. int main()
  10. {
  11.     double h = 0.5, x0 = 0.0, x1 = 0.5, x2 = 1.0;
  12.     double Derivative = 0.0;
  13.     Derivative = (1 / (h*h))*(y(x0)*(2 * x0 - x1 - x1) - 2 * y(x1)*(2 * x0 - x1 - x1) + y(x1)*(2 * x0 - x1 - x1));
  14.     printf("%f\n", Derivative);
  15.  
  16.  
  17.     return 0;
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top