The Sign: sign
Keywords: the sign: sign syntax description x y atomic derivative example

| Prev | Next |  |  |  |  |  |  |

The Sign: sign
Syntax
`y = sign(x)`
Description
Evaluates the `sign` function which is defined by sign ( x ) = { + 1 if x > 0 0 if x = 0 -1 if x < 0
x, y
See the possible types for a unary standard math function.
Atomic
This is an atomic operation .
Derivative
CppAD computes the derivative of the `sign` function as zero for all argument values `x` . The correct mathematical derivative is different and is given by sign ( 1 ) ( x ) = 2 δ ( x ) where δ ( x ) is the Dirac Delta function.
Example
The file sign.cpp contains an example and test of this function. It returns true if it succeeds and false otherwise.

Input File: cppad/local/sign.hpp