Trigonometric functions
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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
— Method.
1 | Base.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
.