Misplaced Pages

Sign function

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In mathematics , the sign function or signum function (from signum , Latin for "sign") is a function that has the value −1 , +1 or 0 according to whether the sign of a given real number is positive or negative, or the given number is itself zero. In mathematical notation the sign function is often represented as sgn ⁡ x {\displaystyle \operatorname {sgn} x} or sgn ⁡ ( x ) {\displaystyle \operatorname {sgn}(x)} .

#256743

89-670: The signum function of a real number x {\displaystyle x} is a piecewise function which is defined as follows: sgn ⁡ x := { − 1 if  x < 0 , 0 if  x = 0 , 1 if  x > 0. {\displaystyle \operatorname {sgn} x:={\begin{cases}-1&{\text{if }}x<0,\\0&{\text{if }}x=0,\\1&{\text{if }}x>0.\end{cases}}} The law of trichotomy states that every real number must be positive, negative or zero. The signum function denotes which unique category

178-506: A − b b a ] / | c | {\displaystyle {\boldsymbol {Q}}={\boldsymbol {P}}=\left[{\begin{array}{rr}a&-b\\b&a\end{array}}\right]/|c|} and identify with the complex signum of c {\displaystyle c} , sgn ⁡ c = c / | c | {\displaystyle \operatorname {sgn} c=c/|c|} . In this sense, polar decomposition generalizes to matrices

267-518: A {\displaystyle a} as n {\displaystyle n} becomes sufficiently large. In the notation of mathematical limits , continuity of f {\displaystyle f} at a {\displaystyle a} requires that f ( a n ) → f ( a ) {\displaystyle f(a_{n})\to f(a)} as n → ∞ {\displaystyle n\to \infty } for any sequence (

356-547: A {\textstyle a} , b {\textstyle b} are real numbers), that are used for generalization of this notion to other domains: Non-negativity, positive definiteness, and multiplicativity are readily apparent from the definition. To see that subadditivity holds, first note that | a + b | = s ( a + b ) {\displaystyle |a+b|=s(a+b)} where s = ± 1 {\displaystyle s=\pm 1} , with its sign chosen to make

445-390: A n {\displaystyle a_{n}} to be the sequence 1 , 1 2 , 1 3 , 1 4 , … , {\displaystyle 1,{\tfrac {1}{2}},{\tfrac {1}{3}},{\tfrac {1}{4}},\dots ,} which tends towards zero as n {\displaystyle n} increases towards infinity. In this case,

534-436: A n → a {\displaystyle a_{n}\to a} as required, but sgn ⁡ ( a ) = 0 {\displaystyle \operatorname {sgn}(a)=0} and sgn ⁡ ( a n ) = + 1 {\displaystyle \operatorname {sgn}(a_{n})=+1} for each n , {\displaystyle n,} so that sgn ⁡ (

623-468: A n ) n = 1 ∞ {\displaystyle \left(a_{n}\right)_{n=1}^{\infty }} for which a n → a . {\displaystyle a_{n}\to a.} The arrow symbol can be read to mean approaches , or tends to , and it applies to the sequence as a whole. This criterion fails for the sign function at a = 0 {\displaystyle a=0} . For example, we can choose

712-416: A n ) → 1 ≠ sgn ⁡ ( a ) {\displaystyle \operatorname {sgn}(a_{n})\to 1\neq \operatorname {sgn}(a)} . This counterexample confirms more formally the discontinuity of sgn ⁡ x {\displaystyle \operatorname {sgn} x} at zero that is visible in the plot. Despite the sign function having a very simple form,

801-407: A + b | = s ⋅ ( a + b ) = s ⋅ a + s ⋅ b ≤ | a | + | b | {\displaystyle |a+b|=s\cdot (a+b)=s\cdot a+s\cdot b\leq |a|+|b|} , as desired. Some additional useful properties are given below. These are either immediate consequences of the definition or implied by

890-680: A r c t a n ( n x ) = lim n → ∞ 2 π tan − 1 ⁡ ( n x ) . {\displaystyle \operatorname {sgn} x=\lim _{n\to \infty }{\frac {2}{\pi }}{\rm {arctan}}(nx)\,=\lim _{n\to \infty }{\frac {2}{\pi }}\tan ^{-1}(nx)\,.} as well as, sgn ⁡ x = lim n → ∞ tanh ⁡ ( n x ) . {\displaystyle \operatorname {sgn} x=\lim _{n\to \infty }\tanh(nx)\,.} Here, tanh ⁡ ( x ) {\displaystyle \tanh(x)}

979-436: A piecewise function (also called a piecewise-defined function , a hybrid function , or a function defined by cases ) is a function whose domain is partitioned into several intervals ("subdomains") on which the function may be defined differently. Piecewise definition is actually a way of specifying the function, rather than a characteristic of the resulting function itself. Piecewise functions can be defined using

SECTION 10

#1732793433257

1068-606: A classical derivative. Although it is not differentiable at x = 0 {\displaystyle x=0} in the ordinary sense, under the generalized notion of differentiation in distribution theory , the derivative of the signum function is two times the Dirac delta function . This can be demonstrated using the identity sgn ⁡ x = 2 H ( x ) − 1 , {\displaystyle \operatorname {sgn} x=2H(x)-1\,,} where H ( x ) {\displaystyle H(x)}

1157-434: A constant function within the positive open region x > 0 , {\displaystyle x>0,} where the corresponding constant is +1. Although these are two different constant functions, their derivative is equal to zero in each case. It is not possible to define a classical derivative at x = 0 {\displaystyle x=0} , because there is a discontinuity there. Nevertheless,

1246-451: A function, and d d x | f ( x ) | = f ( x ) | f ( x ) | f ′ ( x ) {\displaystyle {d \over dx}|f(x)|={f(x) \over |f(x)|}f'(x)} if another function is inside the absolute value. In the first case, the derivative is always discontinuous at x = 0 {\textstyle x=0} in

1335-721: A more common and less ambiguous notation. For any real number x {\displaystyle x} , the absolute value or modulus of x {\displaystyle x} is denoted by | x | {\displaystyle |x|} , with a vertical bar on each side of the quantity, and is defined as | x | = { x , if  x ≥ 0 − x , if  x < 0. {\displaystyle |x|={\begin{cases}x,&{\text{if }}x\geq 0\\-x,&{\text{if }}x<0.\end{cases}}} The absolute value of x {\displaystyle x}

1424-924: A number falls into by mapping it to one of the values −1 , +1 or 0, which can then be used in mathematical expressions or further calculations. For example: sgn ⁡ ( 2 ) = + 1 , sgn ⁡ ( π ) = + 1 , sgn ⁡ ( − 8 ) = − 1 , sgn ⁡ ( − 1 2 ) = − 1 , sgn ⁡ ( 0 ) = 0 . {\displaystyle {\begin{array}{lcr}\operatorname {sgn}(2)&=&+1\,,\\\operatorname {sgn}(\pi )&=&+1\,,\\\operatorname {sgn}(-8)&=&-1\,,\\\operatorname {sgn}(-{\frac {1}{2}})&=&-1\,,\\\operatorname {sgn}(0)&=&0\,.\end{array}}} Any real number can be expressed as

1513-497: A product Q P {\displaystyle {\boldsymbol {Q}}{\boldsymbol {P}}} where Q {\displaystyle {\boldsymbol {Q}}} is a unitary matrix and P {\displaystyle {\boldsymbol {P}}} is a self-adjoint, or Hermitian, positive definite matrix, both in K n × n {\displaystyle \mathbb {K} ^{n\times n}} . If A {\displaystyle {\boldsymbol {A}}}

1602-430: A representation system to provide sparse approximations of this model class in 2D and 3D. Piecewise defined functions are also commonly used for interpolation, such as in nearest-neighbor interpolation . Absolute value In mathematics , the absolute value or modulus of a real number x {\displaystyle x} , denoted | x | {\displaystyle |x|} ,

1691-429: A set X  ×  X is called a metric (or a distance function ) on  X , if it satisfies the following four axioms: The definition of absolute value given for real numbers above can be extended to any ordered ring . That is, if  a is an element of an ordered ring  R , then the absolute value of  a , denoted by | a | , is defined to be: where − a is the additive inverse of 

1780-517: Is | z | = r . {\displaystyle |z|=r.} Since the product of any complex number z {\displaystyle z} and its complex conjugate z ¯ = x − i y {\displaystyle {\bar {z}}=x-iy} , with the same absolute value, is always the non-negative real number ( x 2 + y 2 ) {\displaystyle \left(x^{2}+y^{2}\right)} ,

1869-509: Is sgn ⁡ x ≈ x x 2 + ε 2 . {\displaystyle \operatorname {sgn} x\approx {\frac {x}{\sqrt {x^{2}+\varepsilon ^{2}}}}\,.} which gets sharper as ε → 0 {\displaystyle \varepsilon \to 0} ; note that this is the derivative of x 2 + ε 2 {\displaystyle {\sqrt {x^{2}+\varepsilon ^{2}}}} . This

SECTION 20

#1732793433257

1958-475: Is differentiable everywhere except when x = 0. {\displaystyle x=0.} Its derivative is zero when x {\displaystyle x} is non-zero: d ( sgn ⁡ x ) d x = 0 for  x ≠ 0 . {\displaystyle {\frac {{\text{d}}\,(\operatorname {sgn} x)}{{\text{d}}x}}=0\qquad {\text{for }}x\neq 0\,.} This follows from

2047-430: Is negative (in which case negating x {\displaystyle x} makes − x {\displaystyle -x} positive), and | 0 | = 0 {\displaystyle |0|=0} . For example, the absolute value of 3 is 3, and the absolute value of −3 is also 3. The absolute value of a number may be thought of as its distance from zero. Generalisations of

2136-413: Is a special case of multiplicativity that is often useful by itself. The real absolute value function is continuous everywhere. It is differentiable everywhere except for x = 0 . It is monotonically decreasing on the interval (−∞, 0] and monotonically increasing on the interval [0, +∞) . Since a real number and its opposite have the same absolute value, it is an even function , and

2225-431: Is accepted to be equal to 1, the signum can also be written for all real numbers as sgn ⁡ x = 0 ( − x + | x | ) − 0 ( x + | x | ) . {\displaystyle \operatorname {sgn} x=0^{\left(-x+\left\vert x\right\vert \right)}-0^{\left(x+\left\vert x\right\vert \right)}\,.} Although

2314-506: Is an example of a continuous function that achieves a global minimum where the derivative does not exist. The subdifferential of  | x | at  x = 0 is the interval  [−1, 1] . The complex absolute value function is continuous everywhere but complex differentiable nowhere because it violates the Cauchy–Riemann equations . The second derivative of  | x | with respect to  x

2403-756: Is defined by | z | = Re ⁡ ( z ) 2 + Im ⁡ ( z ) 2 = x 2 + y 2 , {\displaystyle |z|={\sqrt {\operatorname {Re} (z)^{2}+\operatorname {Im} (z)^{2}}}={\sqrt {x^{2}+y^{2}}},} the Pythagorean addition of x {\displaystyle x} and y {\displaystyle y} , where Re ⁡ ( z ) = x {\displaystyle \operatorname {Re} (z)=x} and Im ⁡ ( z ) = y {\displaystyle \operatorname {Im} (z)=y} denote

2492-435: Is either positive or negative. These observations are confirmed by any of the various equivalent formal definitions of continuity in mathematical analysis . A function f ( x ) {\displaystyle f(x)} , such as sgn ⁡ ( x ) , {\displaystyle \operatorname {sgn}(x),} is continuous at a point x = a {\displaystyle x=a} if

2581-461: Is hence not invertible . The real absolute value function is a piecewise linear , convex function . For both real and complex numbers the absolute value function is idempotent (meaning that the absolute value of any absolute value is itself). The absolute value function of a real number returns its value irrespective of its sign, whereas the sign (or signum) function returns a number's sign irrespective of its value. The following equations show

2670-619: Is inspired from the fact that the above is exactly equal for all nonzero x {\displaystyle x} if ε = 0 {\displaystyle \varepsilon =0} , and has the advantage of simple generalization to higher-dimensional analogues of the sign function (for example, the partial derivatives of x 2 + y 2 {\displaystyle {\sqrt {x^{2}+y^{2}}}} ). See Heaviside step function § Analytic approximations . The signum function sgn ⁡ x {\displaystyle \operatorname {sgn} x}

2759-452: Is invertible then such a decomposition is unique and Q {\displaystyle {\boldsymbol {Q}}} plays the role of A {\displaystyle {\boldsymbol {A}}} 's signum. A dual construction is given by the decomposition A = S R {\displaystyle {\boldsymbol {A}}={\boldsymbol {S}}{\boldsymbol {R}}} where R {\displaystyle {\boldsymbol {R}}}

Sign function - Misplaced Pages Continue

2848-475: Is often only required to be locally finite. For example, consider the piecewise definition of the absolute value function: For all values of x {\displaystyle x} less than zero, the first sub-function ( − x {\displaystyle -x} ) is used, which negates the sign of the input value, making negative numbers positive. For all values of x {\displaystyle x} greater than or equal to zero,

2937-647: Is the Heaviside step function using the standard H ( 0 ) = 1 2 {\displaystyle H(0)={\frac {1}{2}}} formalism. Using this identity, it is easy to derive the distributional derivative: d sgn ⁡ x d x = 2 d H ( x ) d x = 2 δ ( x ) . {\displaystyle {\frac {{\text{d}}\operatorname {sgn} x}{{\text{d}}x}}=2{\frac {{\text{d}}H(x)}{{\text{d}}x}}=2\delta (x)\,.} The Fourier transform of

3026-569: Is the Hyperbolic tangent and the superscript of -1, above it, is shorthand notation for the inverse function of the Trigonometric function , tangent. For k > 1 {\displaystyle k>1} , a smooth approximation of the sign function is sgn ⁡ x ≈ tanh ⁡ k x . {\displaystyle \operatorname {sgn} x\approx \tanh kx\,.} Another approximation

3115-406: Is the complex argument function . For reasons of symmetry, and to keep this a proper generalization of the signum function on the reals, also in the complex domain one usually defines, for z = 0 {\displaystyle z=0} : sgn ⁡ ( 0 + 0 i ) = 0 {\displaystyle \operatorname {sgn}(0+0i)=0} Another generalization of

3204-404: Is the non-negative value of x {\displaystyle x} without regard to its sign . Namely, | x | = x {\displaystyle |x|=x} if x {\displaystyle x} is a positive number , and | x | = − x {\displaystyle |x|=-x} if x {\displaystyle x}

3293-411: Is the point on the unit circle of the complex plane that is nearest to z {\displaystyle z} . Then, for z ≠ 0 {\displaystyle z\neq 0} , sgn ⁡ z = e i arg ⁡ z , {\displaystyle \operatorname {sgn} z=e^{i\arg z}\,,} where arg {\displaystyle \arg }

3382-484: Is the constant value +1 , which equals the value of sgn ⁡ x {\displaystyle \operatorname {sgn} x} there. Because the absolute value is a convex function , there is at least one subderivative at every point, including at the origin. Everywhere except zero, the resulting subdifferential consists of a single value, equal to the value of the sign function. In contrast, there are many subderivatives at zero, with just one of them taking

3471-575: Is the loss of commutativity . In particular, the generalized signum anticommutes with the Dirac delta function ε ( x ) δ ( x ) + δ ( x ) ε ( x ) = 0 ; {\displaystyle \varepsilon (x)\delta (x)+\delta (x)\varepsilon (x)=0\,;} in addition, ε ( x ) {\displaystyle \varepsilon (x)} cannot be evaluated at x = 0 {\displaystyle x=0} ; and

3560-551: Is the real part of z {\displaystyle z} and Im ( z ) {\displaystyle {\text{Im}}(z)} is the imaginary part of z {\displaystyle z} . We then have (for z ≠ 0 {\displaystyle z\neq 0} ): csgn ⁡ z = z z 2 = z 2 z . {\displaystyle \operatorname {csgn} z={\frac {z}{\sqrt {z^{2}}}}={\frac {\sqrt {z^{2}}}{z}}.} Thanks to

3649-459: Is then a similar jump to sgn ⁡ ( x ) = + 1 {\displaystyle \operatorname {sgn}(x)=+1} when x {\displaystyle x} is positive. Either jump demonstrates visually that the sign function sgn ⁡ x {\displaystyle \operatorname {sgn} x} is discontinuous at zero, even though it is continuous at any point where x {\displaystyle x}

Sign function - Misplaced Pages Continue

3738-421: Is thus always either a positive number or zero , but never negative . When x {\displaystyle x} itself is negative ( x < 0 {\displaystyle x<0} ), then its absolute value is necessarily positive ( | x | = − x > 0 {\displaystyle |x|=-x>0} ). From an analytic geometry point of view,

3827-484: Is unitary, but generally different than Q {\displaystyle {\boldsymbol {Q}}} . This leads to each invertible matrix having a unique left-signum Q {\displaystyle {\boldsymbol {Q}}} and right-signum R {\displaystyle {\boldsymbol {R}}} . In the special case where K = R ,   n = 2 , {\displaystyle \mathbb {K} =\mathbb {R} ,\ n=2,} and

3916-448: Is zero everywhere except zero, where it does not exist. As a generalised function , the second derivative may be taken as two times the Dirac delta function . The antiderivative (indefinite integral ) of the real absolute value function is where C is an arbitrary constant of integration . This is not a complex antiderivative because complex antiderivatives can only exist for complex-differentiable ( holomorphic ) functions, which

4005-504: The Cauchy principal value . The signum function can be generalized to complex numbers as: sgn ⁡ z = z | z | {\displaystyle \operatorname {sgn} z={\frac {z}{|z|}}} for any complex number z {\displaystyle z} except z = 0 {\displaystyle z=0} . The signum of a given complex number z {\displaystyle z}

4094-838: The Iverson bracket notation: sgn ⁡ x = − [ x < 0 ] + [ x > 0 ] . {\displaystyle \operatorname {sgn} x=-[x<0]+[x>0]\,.} The signum can also be written using the floor and the absolute value functions: sgn ⁡ x = ⌊ x | x | + 1 ⌋ − ⌊ − x | x | + 1 ⌋ . {\displaystyle \operatorname {sgn} x={\Biggl \lfloor }{\frac {x}{|x|+1}}{\Biggr \rfloor }-{\Biggl \lfloor }{\frac {-x}{|x|+1}}{\Biggr \rfloor }\,.} If 0 0 {\displaystyle 0^{0}}

4183-492: The Polar decomposition theorem, a matrix A ∈ K n × n {\displaystyle {\boldsymbol {A}}\in \mathbb {K} ^{n\times n}} ( n ∈ N {\displaystyle n\in \mathbb {N} } and K ∈ { R , C } {\displaystyle \mathbb {K} \in \{\mathbb {R} ,\mathbb {C} \}} ) can be decomposed as

4272-418: The Pythagorean theorem : for any complex number z = x + i y , {\displaystyle z=x+iy,} where x {\displaystyle x} and y {\displaystyle y} are real numbers, the absolute value or modulus of z {\displaystyle z} is denoted | z | {\displaystyle |z|} and

4361-442: The square root symbol represents the unique positive square root , when applied to a positive number, it follows that | x | = x 2 . {\displaystyle |x|={\sqrt {x^{2}}}.} This is equivalent to the definition above, and may be used as an alternative definition of the absolute value of real numbers. The absolute value has the following four fundamental properties (

4450-454: The (invertible) matrix A = [ a − b b a ] {\displaystyle {\boldsymbol {A}}=\left[{\begin{array}{rr}a&-b\\b&a\end{array}}\right]} , which identifies with the (nonzero) complex number a + i b = c {\displaystyle a+\mathrm {i} b=c} , then the signum matrices satisfy Q = P = [

4539-407: The absolute value for real numbers occur in a wide variety of mathematical settings. For example, an absolute value is also defined for the complex numbers , the quaternions , ordered rings , fields and vector spaces . The absolute value is closely related to the notions of magnitude , distance , and norm in various mathematical and physical contexts. In 1806, Jean-Robert Argand introduced

SECTION 50

#1732793433257

4628-418: The absolute value of x {\textstyle x} is generally represented by abs( x ) , or a similar expression. The vertical bar notation also appears in a number of other mathematical contexts: for example, when applied to a set, it denotes its cardinality ; when applied to a matrix , it denotes its determinant . Vertical bars denote the absolute value only for algebraic objects for which

4717-520: The absolute value of a complex number z {\displaystyle z} is the square root of z ⋅ z ¯ , {\displaystyle z\cdot {\overline {z}},} which is therefore called the absolute square or squared modulus of z {\displaystyle z} : | z | = z ⋅ z ¯ . {\displaystyle |z|={\sqrt {z\cdot {\overline {z}}}}.} This generalizes

4806-410: The absolute value of a real number is that number's distance from zero along the real number line , and more generally the absolute value of the difference of two real numbers (their absolute difference ) is the distance between them. The notion of an abstract distance function in mathematics can be seen to be a generalisation of the absolute value of the difference (see "Distance" below). Since

4895-474: The absolute value of the difference of two real or complex numbers is the distance between them. The standard Euclidean distance between two points and in Euclidean n -space is defined as: This can be seen as a generalisation, since for a 1 {\displaystyle a_{1}} and b 1 {\displaystyle b_{1}} real, i.e. in a 1-space, according to

4984-403: The alternative definition for reals: | x | = x ⋅ x {\textstyle |x|={\sqrt {x\cdot x}}} . The complex absolute value shares the four fundamental properties given above for the real absolute value. The identity | z | 2 = | z 2 | {\displaystyle |z|^{2}=|z^{2}|}

5073-415: The alternative definition of the absolute value, and for a = a 1 + i a 2 {\displaystyle a=a_{1}+ia_{2}} and b = b 1 + i b 2 {\displaystyle b=b_{1}+ib_{2}} complex numbers, i.e. in a 2-space, The above shows that the "absolute value"-distance, for real and complex numbers, agrees with

5162-408: The common functional notation , where the body of the function is an array of functions and associated subdomains. A semicolon or comma may follow the subfunction or subdomain columns. The if {\displaystyle {\text{if}}} or for {\displaystyle {\text{for}}} is rarely omitted at the start of the right column. The subdomains together must cover

5251-402: The complex absolute value function is not. The following two formulae are special cases of the chain rule : d d x f ( | x | ) = x | x | ( f ′ ( | x | ) ) {\displaystyle {d \over dx}f(|x|)={x \over |x|}(f'(|x|))} if the absolute value is inside

5340-429: The conditions. In applied mathematical analysis, "piecewise-regular" functions have been found to be consistent with many models of the human visual system , where images are perceived at a first stage as consisting of smooth regions separated by edges (as in a cartoon ); a cartoon-like function is a C function, smooth except for the existence of discontinuity curves. In particular, shearlets have been used as

5429-449: The correct sub-function—and produce the correct output value. A piecewise-defined function is continuous on a given interval in its domain if the following conditions are met: The pictured function, for example, is piecewise-continuous throughout its subdomains, but is not continuous on the entire domain, as it contains a jump discontinuity at x 0 {\displaystyle x_{0}} . The filled circle indicates that

SECTION 60

#1732793433257

5518-456: The definition given at the top for the real absolute value cannot be directly applied to complex numbers. However, the geometric interpretation of the absolute value of a real number as its distance from 0 can be generalised. The absolute value of a complex number is defined by the Euclidean distance of its corresponding point in the complex plane from the origin . This can be computed using

5607-464: The definition of the absolute value | x | {\displaystyle |x|} on the separate regions x < 0 {\displaystyle x<0} and x < 0. {\displaystyle x<0.} For example, the absolute value function is identical to x {\displaystyle x} in the region x > 0 , {\displaystyle x>0,} whose derivative

5696-419: The differentiability of any constant function , for which the derivative is always zero on its domain of definition. The signum sgn ⁡ x {\displaystyle \operatorname {sgn} x} acts as a constant function when it is restricted to the negative open region x < 0 , {\displaystyle x<0,} where it equals -1 . It can similarly be regarded as

5785-407: The first case and where f ( x ) = 0 {\textstyle f(x)=0} in the second case. The absolute value is closely related to the idea of distance . As noted above, the absolute value of a real or complex number is the distance from that number to the origin, along the real number line, for real numbers, or in the complex plane, for complex numbers, and more generally,

5874-405: The four fundamental properties above. Two other useful properties concerning inequalities are: These relations may be used to solve inequalities involving absolute values. For example: The absolute value, as "distance from zero", is used to define the absolute difference between arbitrary real numbers, the standard metric on the real numbers. Since the complex numbers are not ordered ,

5963-460: The graph of the sign function with a vertical line through the origin, making it continuous as a two dimensional curve. In integration theory, the signum function is a weak derivative of the absolute value function. Weak derivatives are equivalent if they are equal almost everywhere , making them impervious to isolated anomalies at a single point. This includes the change in gradient of the absolute value function at zero, which prohibits there being

6052-432: The limits sgn ⁡ x = lim n → ∞ 1 − 2 − n x 1 + 2 − n x . {\displaystyle \operatorname {sgn} x=\lim _{n\to \infty }{\frac {1-2^{-nx}}{1+2^{-nx}}}\,.} and sgn ⁡ x = lim n → ∞ 2 π

6141-671: The notion of an absolute value is defined, notably an element of a normed division algebra , for example a real number, a complex number, or a quaternion. A closely related but distinct notation is the use of vertical bars for either the Euclidean norm or sup norm of a vector in R n {\displaystyle \mathbb {R} ^{n}} , although double vertical bars with subscripts ( ‖ ⋅ ‖ 2 {\displaystyle \|\cdot \|_{2}} and ‖ ⋅ ‖ ∞ {\displaystyle \|\cdot \|_{\infty }} , respectively) are

6230-405: The point x = 0 {\displaystyle x=0} , unlike sgn {\displaystyle \operatorname {sgn} } , for which ( sgn ⁡ 0 ) 2 = 0 {\displaystyle (\operatorname {sgn} 0)^{2}=0} . This generalized signum allows construction of the algebra of generalized functions , but the price of such generalization

6319-1237: The product of its absolute value and its sign function: x = | x | sgn ⁡ x . {\displaystyle x=|x|\operatorname {sgn} x\,.} It follows that whenever x {\displaystyle x} is not equal to 0 we have sgn ⁡ x = x | x | = | x | x . {\displaystyle \operatorname {sgn} x={\frac {x}{|x|}}={\frac {|x|}{x}}\,.} Similarly, for any real number x {\displaystyle x} , | x | = x sgn ⁡ x . {\displaystyle |x|=x\operatorname {sgn} x\,.} We can also be certain that: sgn ⁡ ( x y ) = ( sgn ⁡ x ) ( sgn ⁡ y ) , {\displaystyle \operatorname {sgn}(xy)=(\operatorname {sgn} x)(\operatorname {sgn} y)\,,} and so sgn ⁡ ( x n ) = ( sgn ⁡ x ) n . {\displaystyle \operatorname {sgn}(x^{n})=(\operatorname {sgn} x)^{n}\,.} The signum can also be written using

6408-535: The real and imaginary parts of z {\displaystyle z} , respectively. When the imaginary part y {\displaystyle y} is zero, this coincides with the definition of the absolute value of the real number x {\displaystyle x} . When a complex number z {\displaystyle z} is expressed in its polar form as z = r e i θ , {\displaystyle z=re^{i\theta },} its absolute value

6497-401: The relationship between these two functions: or and for x ≠ 0 , Let s , t ∈ R {\displaystyle s,t\in \mathbb {R} } , then and The real absolute value function has a derivative for every x ≠ 0 , but is not differentiable at x = 0 . Its derivative for x ≠ 0 is given by the step function : The real absolute value function

6586-660: The result positive. Now, since − 1 ⋅ x ≤ | x | {\displaystyle -1\cdot x\leq |x|} and + 1 ⋅ x ≤ | x | {\displaystyle +1\cdot x\leq |x|} , it follows that, whichever of ± 1 {\displaystyle \pm 1} is the value of s {\displaystyle s} , one has s ⋅ x ≤ | x | {\displaystyle s\cdot x\leq |x|} for all real x {\displaystyle x} . Consequently, |

6675-403: The second sub-function ( x {\displaystyle x} ) is used, which evaluates trivially to the input value itself. The following table documents the absolute value function at certain values of x {\displaystyle x} : In order to evaluate a piecewise-defined function at a given input value, the appropriate subdomain needs to be chosen in order to select

6764-802: The sign function for real and complex expressions is csgn {\displaystyle {\text{csgn}}} , which is defined as: csgn ⁡ z = { 1 if  R e ( z ) > 0 , − 1 if  R e ( z ) < 0 , sgn ⁡ I m ( z ) if  R e ( z ) = 0 {\displaystyle \operatorname {csgn} z={\begin{cases}1&{\text{if }}\mathrm {Re} (z)>0,\\-1&{\text{if }}\mathrm {Re} (z)<0,\\\operatorname {sgn} \mathrm {Im} (z)&{\text{if }}\mathrm {Re} (z)=0\end{cases}}} where Re ( z ) {\displaystyle {\text{Re}}(z)}

6853-529: The sign function takes the value −1 when x {\displaystyle x} is negative, the ringed point (0, −1) in the plot of sgn ⁡ x {\displaystyle \operatorname {sgn} x} indicates that this is not the case when x = 0 {\displaystyle x=0} . Instead, the value jumps abruptly to the solid point at (0, 0) where sgn ⁡ ( 0 ) = 0 {\displaystyle \operatorname {sgn}(0)=0} . There

6942-517: The signum function has a definite integral between any pair of finite values a and b , even when the interval of integration includes zero. The resulting integral for a and b is then equal to the difference between their absolute values: ∫ a b ( sgn ⁡ x ) d x = | b | − | a | . {\displaystyle \int _{a}^{b}(\operatorname {sgn} x)\,{\text{d}}x=|b|-|a|\,.} Conversely,

7031-420: The signum function is ∫ − ∞ ∞ ( sgn ⁡ x ) e − i k x d x = P V 2 i k , {\displaystyle \int _{-\infty }^{\infty }(\operatorname {sgn} x)e^{-ikx}{\text{d}}x=PV{\frac {2}{ik}},} where P V {\displaystyle PV} means taking

7120-463: The signum function is the derivative of the absolute value function, except where there is an abrupt change in gradient before and after zero: d | x | d x = sgn ⁡ x for  x ≠ 0 . {\displaystyle {\frac {{\text{d}}|x|}{{\text{d}}x}}=\operatorname {sgn} x\qquad {\text{for }}x\neq 0\,.} We can understand this as before by considering

7209-437: The signum-modulus decomposition of complex numbers. At real values of x {\displaystyle x} , it is possible to define a generalized function –version of the signum function, ε ( x ) {\displaystyle \varepsilon (x)} such that ε ( x ) 2 = 1 {\displaystyle \varepsilon (x)^{2}=1} everywhere, including at

7298-443: The special name, ε {\displaystyle \varepsilon } is necessary to distinguish it from the function sgn {\displaystyle \operatorname {sgn} } . ( ε ( 0 ) {\displaystyle \varepsilon (0)} is not defined, but sgn ⁡ 0 = 0 {\displaystyle \operatorname {sgn} 0=0} .) Piecewise In mathematics ,

7387-442: The standard Euclidean distance, which they inherit as a result of considering them as one and two-dimensional Euclidean spaces, respectively. The properties of the absolute value of the difference of two real or complex numbers: non-negativity, identity of indiscernibles, symmetry and the triangle inequality given above, can be seen to motivate the more general notion of a distance function as follows: A real valued function d on

7476-413: The step change at zero causes difficulties for traditional calculus techniques, which are quite stringent in their requirements. Continuity is a frequent constraint. One solution can be to approximate the sign function by a smooth continuous function; others might involve less stringent approaches that build on classical methods to accommodate larger classes of function. The signum function coincides with

7565-703: The term module , meaning unit of measure in French, specifically for the complex absolute value, and it was borrowed into English in 1866 as the Latin equivalent modulus . The term absolute value has been used in this sense from at least 1806 in French and 1857 in English. The notation | x | , with a vertical bar on each side, was introduced by Karl Weierstrass in 1841. Other names for absolute value include numerical value and magnitude . In programming languages and computational software packages,

7654-485: The value f ( a ) {\displaystyle f(a)} can be approximated arbitrarily closely by the sequence of values f ( a 1 ) , f ( a 2 ) , f ( a 3 ) , … , {\displaystyle f(a_{1}),f(a_{2}),f(a_{3}),\dots ,} where the a n {\displaystyle a_{n}} make up any infinite sequence which becomes arbitrarily close to

7743-437: The value sgn ⁡ ( 0 ) = 0 {\displaystyle \operatorname {sgn}(0)=0} . A subderivative value 0 occurs here because the absolute value function is at a minimum. The full family of valid subderivatives at zero constitutes the subdifferential interval [ − 1 , 1 ] {\displaystyle [-1,1]} , which might be thought of informally as "filling in"

7832-406: The value of the right sub-function is used in this position. For a piecewise-defined function to be differentiable on a given interval in its domain, the following conditions have to fulfilled in addition to those for continuity above: Some sources only examine the function definition, while others acknowledge the property iff the function admits a partition into a piecewise definition that meets

7921-409: The whole domain ; often it is also required that they are pairwise disjoint, i.e. form a partition of the domain. In order for the overall function to be called "piecewise", the subdomains are usually required to be intervals (some may be degenerated intervals, i.e. single points or unbounded intervals). For bounded intervals, the number of subdomains is required to be finite, for unbounded intervals it

#256743