Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double taylor_tan(double uhel, unsigned int n){
- unsigned int i;
- double cit[13]={1, 1, 2, 17, 62, 1382, 21844, 929569, 6404582, 443861162, 18888466084, 113927491862, 58870668456604};
- double jme[13]={1, 3, 15, 315, 2835, 155925, 6081075, 638512875, 10854718875, 1856156927625, 194896477400625, 49308808782358125, 3698160658676859375};
- double xx=uhel;
- for(i=0;i<n;i++){
- xx=xx*uhel*uhel;
- printf("%e\n",(cit[i]*xx)/jme[i]);
- }
- return 0;
- }
- int main(){
- taylor_tan(1.024,10);
- return 0;
- }
- -------- výstup ------
- 1.073742e+00
- 3.753000e-01
- 1.574122e-01
- 6.680946e-02
- 2.838822e-02
- 1.206401e-02
- 5.126856e-03
- 2.178769e-03
- 9.259156e-04
- 3.934880e-04
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement