Home

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

r = |z| = sqrt(x^2 + y^2),

a = sqrt((r + x)/2),

b = sign(y) sqrt((r − x)/2).

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

x
<
0,
sqrtc(z)
is
purely
imaginary,
equal
to
i
sqrt(-x).
The
result
is
chosen
so
that
a
≥
0,
and
when
y
≠
0
the
sign
of
b
matches
the
sign
of
y.
typically
has
a
branch
cut
along
the
negative
real
axis,
ensuring
continuity
on
the
complex
plane
excluding
that
cut.
The
square
root
is
multivalued,
with
the
two
values
differing
by
a
sign;
trying
to
multiply
square
roots
requires
careful
branch
choice.
and
stably,
often
via
the
algebraic
formula
or
polar
methods.