Trigonometric functions
Trigonometric functions are supported for arbitrary uncertain values of different types. Like for elementary operations, a resampling approach is used for the computations.
Syntax
Because elementary operations should work on arbitrary uncertain values, a resampling approach is used to perform the mathematical operations. All mathematical operations thus return a vector containing the results of repeated element-wise operations (where each element is a resampled draw from the furnishing distribution(s) of the uncertain value(s)).
Each trigonometric function comes in two versions.
- The first syntax allows skipping providing the number of draws, which is set to 10000 by default (e.g.
cos(x::AbstractUncertainValue; n::Int = 10000). - Using the second syntax, you have to explicitly provide the number of draws (e.g.
cos(x::AbstractUncertainValue, n::Int)).
Possible errors
Beware: if the support of the funishing distribution for an uncertain value lies partly outside the domain of the function, you risk encountering errors.
Supported trigonometric functions
Sine
Base.sin — MethodBase.sin(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the sine of the uncertain value x, where x is in radians. Computes the element-wise sine for n realizations.
Base.sin — MethodBase.sin(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the sine of the uncertain value x, where x is in radians. Computes the element-wise sine for n realizations.
Base.Math.sind — MethodBase.sind(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the sine of the uncertain value x, where x is in degrees. Computes the element-wise sine for n realizations.
Base.Math.sind — MethodBase.sind(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the sine of the uncertain value x, where x is in degrees. Computes the element-wise sine for n realizations.
Base.sinh — MethodBase.sinh(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the hyperbolic sine of the uncertain value x. Computes the element-wise hyperbolic sine for n realizations.
Base.sinh — MethodBase.sinh(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the hyperbolic sine of the uncertain value x. Computes the element-wise hyperbolic sine for n realizations.
Cosine
Base.cos — MethodBase.cos(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the cosine of the uncertain value x, where x is in radians. Computes the element-wise cosine for n realizations.
Base.cos — MethodBase.cos(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the cosine of the uncertain value x, where x is in radians. Computes the element-wise cosine for n realizations.
Base.Math.cosd — MethodBase.cos(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the cosine of the uncertain value x, where x is in degrees. Computes the element-wise cosine for n realizations.
Base.Math.cosd — MethodBase.cos(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the cosine of the uncertain value x, where x is in degrees. Computes the element-wise cosine for n realizations.
Base.cosh — MethodBase.cos(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the hyperbolic cosine of the uncertain value x. Computes the element-wise hyperbolic cosine for n realizations.
Base.cosh — MethodBase.cos(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the hyperbolic cosine of the uncertain value x. Computes the element-wise hyperbolic cosine for n realizations.
Tangent
Base.atan — MethodBase.atan(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse tangent of the uncertain value x, where x is in radians. Computes the element-wise inverse tangent for n realizations.
Base.atan — MethodBase.atan(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse tangent of the uncertain value x, where x is in radians. Computes the element-wise inverse tangent for n realizations.
Base.Math.atand — MethodBase.atand(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse tangent of the uncertain value x, where x is in degrees. Computes the element-wise inverse tangent for n realizations.
Base.Math.atand — MethodBase.atand(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse tangent of the uncertain value x, where x is in degrees. Computes the element-wise inverse tangent for n realizations.
Base.atanh — MethodBase.atanh(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse hypoerbolic tangent of the uncertain value x. Computes the element-wise inverse hypoerbolic tangent for n realizations.
Base.atanh — MethodBase.atanh(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse hypoerbolic tangent of the uncertain value x. Computes the element-wise inverse hypoerbolic tangent for n realizations.
Reciprocal trig functions
Cosecant
Base.Math.csc — MethodBase.csc(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the cosecant of the uncertain value x, where x is in radians. Computes the element-wise cosecant for n realizations.
Base.Math.csc — MethodBase.csc(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the cosecant of the uncertain value x, where x is in radians. Computes the element-wise cosecant for n realizations.
Base.Math.cscd — MethodBase.cscd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the cosecant of the uncertain value x, where x is in degrees. Computes the element-wise cosecant for n realizations.
Base.Math.cscd — MethodBase.cscd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the cosecant of the uncertain value x, where x is in degrees. Computes the element-wise cosecant for n realizations.
Base.Math.csch — MethodBase.cscd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the hyperbolic cosecant of the uncertain value x, where x is in degrees. Computes the element-wise hyperbolic cosecant for n realizations.
Base.Math.csch — MethodBase.cscd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the hyperbolic cosecant of the uncertain value x, where x is in degrees. Computes the element-wise hyperbolic cosecant for n realizations.
Secant
Base.Math.sec — MethodBase.sec(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the secant of the uncertain value x, where x is in radians. Computes the element-wise secant for n realizations.
Base.Math.sec — MethodBase.sec(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the secant of the uncertain value x, where x is in radians. Computes the element-wise secant for n realizations.
Base.Math.secd — MethodBase.secd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the secant of the uncertain value x, where x is in degrees. Computes the element-wise cosecant for n realizations.
Base.Math.secd — MethodBase.secd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the secant of the uncertain value x, where x is in degrees. Computes the element-wise cosecant for n realizations.
Base.Math.sech — MethodBase.sech(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the hyperbolic secant of the uncertain value x, where x is in degrees. Computes the element-wise hyperbolic secant for n realizations.
Base.Math.sech — MethodBase.sech(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the hyperbolic secant of the uncertain value x, where x is in degrees. Computes the element-wise hyperbolic secant for n realizations.
Cotangent
Base.Math.cot — MethodBase.cot(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the cotangent of the uncertain value x, where x is in radians. Computes the element-wise cotangent for n realizations.
Base.Math.cot — MethodBase.cot(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the cotangent of the uncertain value x, where x is in radians. Computes the element-wise cotangent for n realizations.
Base.Math.cotd — MethodBase.cotd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the cotangent of the uncertain value x, where x is in degrees. Computes the element-wise cotangent for n realizations.
Base.Math.cotd — MethodBase.cotd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the cotangent of the uncertain value x, where x is in degrees. Computes the element-wise cotangent for n realizations.
Base.Math.coth — MethodBase.coth(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the hyperbolic cotangent of the uncertain value x, where x is in radians. Computes the element-wise hyperbolic cotangent for n realizations.
Base.Math.coth — MethodBase.coth(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the hyperbolic cotangent of the uncertain value x, where x is in radians. Computes the element-wise hyperbolic cotangent for n realizations.
Inverse trig functions
Sine
Base.asin — MethodBase.asin(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse sine of the uncertain value x, where x is in radians. Computes the element-wise inverse sine for n realizations.
Base.asin — MethodBase.asin(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse sine of the uncertain value x, where x is in radians. Computes the element-wise inverse sine for n realizations.
Base.Math.asind — MethodBase.asind(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse sine of the uncertain value x, where x is in degrees. Computes the element-wise inverse sine for n realizations.
Base.Math.asind — MethodBase.asind(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse sine of the uncertain value x, where x is in degrees. Computes the element-wise inverse sine for n realizations.
Base.asinh — MethodBase.asinh(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic sine of the uncertain value x. Computes the element-wise inverse hyperbolic csine for n realizations.
Base.asinh — MethodBase.asinh(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic sine of the uncertain value x. Computes the element-wise inverse hyperbolic csine for n realizations.
Cosine
Base.acos — MethodBase.acos(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse cosine of the uncertain value x, where x is in radians. Computes the element-wise inverse cosine for n realizations.
Base.acos — MethodBase.acos(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse cosine of the uncertain value x, where x is in radians. Computes the element-wise inverse cosine for n realizations.
Base.Math.acosd — MethodBase.acosd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse cosine of the uncertain value x, where x is in degrees. Computes the element-wise inverse cosine for n realizations.
Base.Math.acosd — MethodBase.acosd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse cosine of the uncertain value x, where x is in degrees. Computes the element-wise inverse cosine for n realizations.
Base.acosh — MethodBase.acosh(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic cosine of the uncertain value x. Computes the element-wise inverse hyperbolic cosine for n realizations.
Base.acosh — MethodBase.acosh(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic cosine of the uncertain value x. Computes the element-wise inverse hyperbolic cosine for n realizations.
Tangent
Base.tan — MethodBase.tan(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the tangent of the uncertain value x, where x is in radians. Computes the element-wise tangent for n realizations.
Base.tan — MethodBase.tan(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the tangent of the uncertain value x, where x is in radians. Computes the element-wise tangent for n realizations.
Base.Math.tand — MethodBase.tand(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the tangent of the uncertain value x, where x is in degrees. Computes the element-wise tangent for n realizations.
Base.Math.tand — MethodBase.tand(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the tangent of the uncertain value x, where x is in degrees. Computes the element-wise tangent for n realizations.
Base.tanh — MethodBase.tanh(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the hyperbolic tangent of the uncertain value x. Computes the element-wise hyperbolic tangent for n realizations.
Base.tanh — MethodBase.tanh(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the hyperbolic tangent of the uncertain value x. Computes the element-wise hyperbolic tangent for n realizations.
Inverse cosecant
Base.Math.acsc — MethodBase.acsc(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse cosecant of the uncertain value x, where x is in radians. Computes the element-wise inverse cosecant for n realizations.
Base.Math.acsc — MethodBase.acsc(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse cosecant of the uncertain value x, where x is in radians. Computes the element-wise inverse cosecant for n realizations.
Base.Math.acscd — MethodBase.acscd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse cosecant of the uncertain value x, where x is in degrees. Computes the element-wise inverse cosecant for n realizations.
Base.Math.acscd — MethodBase.acscd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse cosecant of the uncertain value x, where x is in degrees. Computes the element-wise inverse cosecant for n realizations.
Base.Math.acsch — MethodBase.acscd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic cosecant of the uncertain value x. Computes the element-wise inverse hypoerbolic cosecant for n realizations.
Base.Math.acsch — MethodBase.acscd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic cosecant of the uncertain value x. Computes the element-wise inverse hypoerbolic cosecant for n realizations.
Inverse secant
Base.Math.asec — MethodBase.asec(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse secant of the uncertain value x, where x is in radians. Computes the element-wise inverse secant for n realizations.
Base.Math.asec — MethodBase.asec(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse secant of the uncertain value x, where x is in radians. Computes the element-wise inverse secant for n realizations.
Base.Math.asecd — MethodBase.asecd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse secant of the uncertain value x, where x is in degrees. Computes the element-wise inverse secant for n realizations.
Base.Math.asecd — MethodBase.asecd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse secant of the uncertain value x, where x is in degrees. Computes the element-wise inverse secant for n realizations.
Base.Math.asech — MethodBase.asech(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic secant of the uncertain value x. Computes the element-wise inverse hyperbolic secant for n realizations.
Base.Math.asech — MethodBase.asech(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic secant of the uncertain value x. Computes the element-wise inverse hyperbolic secant for n realizations.
Inverse cotangent
Base.Math.acot — MethodBase.acot(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse cotangent of the uncertain value x, where x is in radians. Computes the element-wise inverse secant for n realizations.
Base.Math.acot — MethodBase.acot(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse cotangent of the uncertain value x, where x is in radians. Computes the element-wise inverse secant for n realizations.
Base.Math.acotd — MethodBase.acotd(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse cotangent of the uncertain value x, where x is in degrees. Computes the element-wise inverse secant for n realizations.
Base.Math.acotd — MethodBase.acotd(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse cotangent of the uncertain value x, where x is in degrees. Computes the element-wise inverse secant for n realizations.
Base.Math.acoth — MethodBase.acoth(x::AbstractUncertainValue; n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic cotangent of the uncertain value x. Computes the element-wise inverse hyperbolic secant for n realizations.
Base.Math.acoth — MethodBase.acoth(x::AbstractUncertainValue, n::Int = 10000) -> Vector{Float64}Compute the inverse hyperbolic cotangent of the uncertain value x. Computes the element-wise inverse hyperbolic secant for n realizations.
Other trig functions
Base.Math.sincos — MethodBase.sincos(x::AbstractUncertainValue; n::Int = 10000)Simultaneously compute the sine and cosine of the uncertain value x, where x is in radians. Computes the element-wise sincos for n realizations.
Base.Math.sincos — MethodBase.sincos(x::AbstractUncertainValue, n::Int = 10000)Simultaneously compute the sine and cosine of the uncertain value x, where x is in radians. Computes the element-wise sincos for n realizations.
Base.Math.sinc — MethodBase.sinc(x::AbstractUncertainValue; n::Int = 10000)In an element-wise manner for n realizations of the uncertain value x, compute $\sin(\pi x) / (\pi x)$ if $x \neq 0$, and $1$ if $x = 0$.
Base.Math.sinc — MethodBase.sinc(x::AbstractUncertainValue, n::Int = 10000)Compute $\sin(\pi x) / (\pi x)$ if $x \neq 0$, and $1$ if $x = 0$ element-wise over n realizations of the uncertain value x.
Base.Math.sinpi — MethodBase.sinpi(x::AbstractUncertainValue; n::Int = 10000)Compute $\sin(\pi x)$ more accurately than sin(pi*x), especially for large x, in an element-wise over n realizations of the uncertain value x.
Base.Math.sinpi — MethodBase.sinpi(x::AbstractUncertainValue; n::Int = 10000)Compute $\sin(\pi x)$ more accurately than sin(pi*x), especially for large x, in an element-wise over n realizations of the uncertain value x.
Base.Math.cosc — MethodBase.cosc(x::AbstractUncertainValue; n::Int = 10000)Compute $\cos(\pi x) / x - \sin(\pi x) / (\pi x^2)$ if $x \neq 0$, and $0$ if $x = 0$, in an element-wise manner over n realizations of the uncertain value x.
This is the derivative of sinc(x).
Base.Math.cosc — MethodBase.cosc(x::AbstractUncertainValue, n::Int = 10000)Compute $\cos(\pi x) / x - \sin(\pi x) / (\pi x^2)$ if $x \neq 0$, and $0$ if $x = 0$, in an element-wise manner over n realizations of the uncertain value x.
This is the derivative of sinc(x).
Base.Math.cospi — MethodBase.cospi(x::AbstractUncertainValue; n::Int = 10000)Compute $\cos(\pi x)$ more accurately than cos(pi*x), especially for large x, in an element-wise over n realizations of the uncertain value x.
Base.Math.cospi — MethodBase.cospi(x::AbstractUncertainValue, n::Int = 10000)Compute $\cos(\pi x)$ more accurately than cos(pi*x), especially for large x, in an element-wise over n realizations of the uncertain value x.