28 if Complex.generic?(z)
31 Complex(exp!(z.real) * cos!(z.image),
32 exp!(z.real) * sin!(z.image))
38 if Complex.generic?(z) and z >= 0 and (b.nil? or b >= 0)
42 a = Complex(log!(r.abs), theta)
51 if Complex.generic?(z)
59 if Complex.generic?(z)
67 sqrt(z.conjugate).conjugate
71 Complex(sqrt!((r + x) / 2), sqrt!((r - x) / 2))
77 if Complex.generic?(z)
80 Complex(sin!(z.real) * cosh!(z.image),
81 cos!(z.real) * sinh!(z.image))
86 if Complex.generic?(z)
89 Complex(cos!(z.real) * cosh!(z.image),
90 -sin!(z.real) * sinh!(z.image))
95 if Complex.generic?(z)
103 if Complex.generic?(z)
106 Complex(sinh!(z.real) * cos!(z.image),
107 cosh!(z.real) * sin!(z.image))
112 if Complex.generic?(z)
115 Complex(cosh!(z.real) * cos!(z.image),
116 sinh!(z.real) * sin!(z.image))
121 if Complex.generic?(z)
129 if Complex.generic?(z) and z >= -1 and z <= 1
132 -1.0.im * log(1.0.im * z + sqrt(1.0 - z * z))
137 if Complex.generic?(z) and z >= -1 and z <= 1
140 -1.0.im * log(z + 1.0.im * sqrt(1.0 - z * z))
145 if Complex.generic?(z)
148 1.0.im * log((1.0.im + z) / (1.0.im - z)) / 2.0
153 if Complex.generic?(y) and Complex.generic?(x)
156 -1.0.im * log((x + 1.0.im * y) / sqrt(x * x + y * y))
161 if Complex.generic?(z) and z >= 1
164 log(z + sqrt(z * z - 1.0))
169 if Complex.generic?(z)
172 log(z + sqrt(1.0 + z * z))
177 if Complex.generic?(z) and z >= -1 and z <= 1
180 log((1.0 + z) / (1.0 - z)) / 2.0
184 module_function :exp!
186 module_function :log!
188 module_function :log10!
189 module_function :log10
190 module_function :sqrt!
191 module_function :sqrt
193 module_function :sin!
195 module_function :cos!
197 module_function :tan!
200 module_function :sinh!
201 module_function :sinh
202 module_function :cosh!
203 module_function :cosh
204 module_function :tanh!
205 module_function :tanh
207 module_function :asin!
208 module_function :asin
209 module_function :acos!
210 module_function :acos
211 module_function :atan!
212 module_function :atan
213 module_function :atan2!
214 module_function :atan2
216 module_function :asinh!
217 module_function :asinh
218 module_function :acosh!
219 module_function :acosh
220 module_function :atanh!
221 module_function :atanh