Advertisement
Guest User

kudrnatá kunda

a guest
Nov 23rd, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. double taylor_tan(double uhel, unsigned int n){
  2. unsigned int i;
  3. double cit[13]={1, 1, 2, 17, 62, 1382, 21844, 929569, 6404582, 443861162, 18888466084, 113927491862, 58870668456604};
  4. double jme[13]={1, 3, 15, 315, 2835, 155925, 6081075, 638512875, 10854718875, 1856156927625, 194896477400625, 49308808782358125, 3698160658676859375};
  5. double xx=uhel;
  6. for(i=0;i<n;i++){
  7. xx=xx*uhel*uhel;
  8. printf("%e\n",(cit[i]*xx)/jme[i]);
  9. }
  10. return 0;
  11. }
  12. int main(){
  13. taylor_tan(1.024,10);
  14. return 0;
  15. }
  16. -------- výstup ------
  17.  
  18. 1.073742e+00
  19. 3.753000e-01
  20. 1.574122e-01
  21. 6.680946e-02
  22. 2.838822e-02
  23. 1.206401e-02
  24. 5.126856e-03
  25. 2.178769e-03
  26. 9.259156e-04
  27. 3.934880e-04
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement