def acosh(x):
z = _make_complex(x)
if abs(z.real) > _LARGE_DOUBLE or abs(z.imag) > _LARGE_DOUBLE:
return complex(math.log(math.hypot(z.real/2, z.imag/2)) + 2*_LOG_2,
math.atan2(z.imag, z.real))
s1 = sqrt(complex(z.real-1, z.imag))
s2 = sqrt(complex(z.real+1, z.imag))
return complex(math.asinh(s1.real*s2.real + s1.imag*s2.imag),
2*math.atan2(s1.imag, s2.real))
评论列表
文章目录