如何用C语言编写arctan(x⼀y)

2024-12-21 18:37:39
推荐回答(1个)
回答1:

如果math.h库中没有的话,提供你一条思路,在数学手册上去查一下 arctan的级数展开式。我多年前曾用汇编编制过tan函数,就用此方法。

搜到一些公式,不知你以后是否会用,都写上了。

arctan x = x - x^3/3 + x^5/5 - ... (x≤1)
ex = 1+x+x2/2!+x3/3!+...+xn/n!+...
ln(1+x)= x-x2/3+x3/3-...(-1)k-1*xk/k+... (|x|<1)
sin x = x-x3/3!+x5/5!-...(-1)k-1*x2k-1/(2k-1)!+... (-∞ cos x = 1-x2/2!+x4/4!-...(-1)k*x2k/(2k)!+... (-∞ arcsin x = x + 1/2*x3/3 + 1*3/(2*4)*x5/5 + ... (|x|<1)
arccos x = π - ( x + 1/2*x3/3 + 1*3/(2*4)*x5/5 + ... ) (|x|<1)
sinh x = x+x3/3!+x5/5!+...(-1)k-1*x2k-1/(2k-1)!+... (-∞ cosh x = 1+x2/2!+x4/4!+...(-1)k*x2k/(2k)!+... (-∞ arcsinh x = x - 1/2*x3/3 + 1*3/(2*4)*x5/5 - ... (|x|<1)
arctanh x = x + x^3/3 + x^5/5 + ... (|x|<1)