sqrtc
sqrtc denotes the square root of a complex number, commonly used to emphasize a complex-domain square root or to refer to a principal complex square root in programming libraries. In mathematics, the square root of a complex number z = x + iy is a number w such that w^2 = z, and there are two closely related values: ±w. The term sqrtc is often used to denote the principal value of this square root.
For z = x + iy, the principal square root sqrtc(z) can be written as a + ib, where
If y = 0 and x ≥ 0, sqrtc(z) = sqrt(x) (a real nonnegative value). If y = 0 and
Equivalent formulations exist using polar coordinates: z = re^{iθ} with θ ∈ (−π, π], then sqrtc(z) = sqrt(r) e^{iθ/2}. The principal branch
In practice, sqrtc is implemented in software libraries to compute the principal complex square root efficiently