MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / complex__atan

Function complex__atan

inst/include/Rcpp/sugar/functions/complex.h:164–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162/* if y >= 1, and continuous from the left if y <= -1. */
163
164inline Rcomplex complex__atan(Rcomplex z)
165{
166 Rcomplex r;
167 double x, y;
168 x = z.r;
169 y = z.i;
170 r.r = 0.5 * ::atan(2 * x / ( 1 - x * x - y * y));
171 r.i = 0.25 * ::log((x * x + (y + 1) * (y + 1)) /
172 (x * x + (y - 1) * (y - 1)));
173 if(x*x + y*y > 1) {
174 r.r += M_PI_2;
175 if(x < 0 || (x == 0 && y < 0)) r.r -= M_PI;
176 }
177 return r ;
178}
179
180
181inline Rcomplex complex__acosh(Rcomplex z){

Callers 1

complex__atanhFunction · 0.85

Calls 1

logFunction · 0.50

Tested by

no test coverage detected