Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float coth(float x, float epsilon)
- {
- float last_n = x/3;
- float sum = last_n;
- float n = 0;
- for(int i = 2; i<=12, i++)
- {
- n = ((-1)^(i+1)*2^(2i))/faculty(2*n) * bernoulli[i] * x^(2*n-1)
- sum += n;
- if((n - last_n) > epsilon))
- return sum;
- }
- return sum;
- }
Add Comment
Please, Sign In to add comment