| 130 | } |
| 131 | |
| 132 | inline Rcomplex complex__asin(Rcomplex z) |
| 133 | { |
| 134 | Rcomplex r ; |
| 135 | double alpha, bet, t1, t2, x, y; |
| 136 | x = z.r; |
| 137 | y = z.i; |
| 138 | t1 = 0.5 * ::hypot(x + 1, y); |
| 139 | t2 = 0.5 * ::hypot(x - 1, y); |
| 140 | alpha = t1 + t2; |
| 141 | bet = t1 - t2; |
| 142 | r.r = ::asin(bet); |
| 143 | r.i = ::log(alpha + ::sqrt(alpha*alpha - 1)); |
| 144 | if(y < 0 || (y == 0 && x > 1)) r.i *= -1; |
| 145 | return r ; |
| 146 | } |
| 147 | |
| 148 | inline Rcomplex complex__acos(Rcomplex z) |
| 149 | { |
no test coverage detected