Editing LogZp1oZm1
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 19: | Line 19: | ||
for minor speed gains. | for minor speed gains. | ||
Modified 2008 01 11 by Ph. Le Grand: | Modified 2008 01 11 by Ph. Le Grand: | ||
− | Reduced some operations for minor speed gains | + | Reduced some operations for minor speed gains. |
− | |||
-------------------------------------------------------------------------------*/ | -------------------------------------------------------------------------------*/ | ||
inline cmplex logZm1oZp1(const cmplex &Z) | inline cmplex logZm1oZp1(const cmplex &Z) | ||
Line 27: | Line 26: | ||
double y(Z.imag()); | double y(Z.imag()); | ||
double r2=x*x+y*y; | double r2=x*x+y*y; | ||
− | + | double den(r2+x+x+1.0); | |
− | return cmplex(0.5*log(1.0-4.0*x/ | + | double add=0.0; |
− | + | if ((r2)<1.0){ | |
+ | add=-PI; | ||
+ | if (y>=0.0){add=PI;} | ||
+ | } | ||
+ | return cmplex(0.5*log(1.0-4.0*x/den), | ||
+ | add+atan( (y+y) /(r2-1.0) )); | ||
} | } |