Skip to main content

Algebraic and Transcendental Functions

Algebraic functions

FunctionDescription
sq(x)x2x^2
sqrt(x)x\sqrt{x}
qb(x)x3
qbrt(x)x3\sqrt[3]{x}

Polynomial "poly" (Horner scheme)

The poly() function can be used to efficiently calculate a polynomial by applying the Horner scheme. In the implementation, the explicit exponentiation of xx is avoided by the clever bracketing of terms.

p(x)=aNxn+...+a1x+a0=((aNx+aN1)x...+a1)x+a0p(x) = a_N \cdot x^n + ... + a_1 \cdot x + a_0 = ((a_N \cdot x + a_{N-1}) \cdot x ... + a_1) \cdot x + a_0
px1 = poly(x, an, ...a1, a0);
A_Coef = [an, ...a1, a0];
px2 = poly(x, A_Coef);

In the second form, the coefficients aN...a0a_N ... a_0 are passed as a vector.

Transcendent functions

FunctionDescription
log(x)log10(x)log_{10}(x), logarithm of x to the base 10
lg2(x)log2(x)log_{2}(x), logarithm of x to the base 2
ln(x)ln(x)ln(x), natural logarithm
ln1p(x)ln(1+x)ln(1 + x), (better resolution for x close to 0)
pow(x,y)
x^y
xyx^y, exponentiation of x with y
exp10(x)10x10^x, exponentiation of 10 with x
exp2(x)2x2^x, exponentiation of 2 with x
exp(x)exe^x, exponentiation of the Euler constant e with x
expm1(x)ex1e^x - 1, (better resolution for x near 0)

Trigonometric and arc functions

All angle arguments must be passed in radians. Accordingly, angles are also returned in radians

FunctionDescription
sin(x)sine of x
cos(x)cosine of x
tan(x)tangent of x
asin(x)arc sine of x
acos(x)arc cosine of x
atan(x)arc tangent of x
atanYX(y,x)Inverse tangent of anticathete y and anticathete x
Function also ensured for x = 0
Correct result for all quadrants in the range [π,π][-\pi, \pi]

Angle conversion

FunctionDescription
rad2deg(x)Conversion of the angle x from radians to degrees
deg2rad(x)Conversion of the angle x from radians to radians

Hyperbolic and area functions

FunctionDescription
sinh(x)hyperbolic sine of x
cosh(x)Cosine hyperbolic of x
tanh(x)hyperbolic tangent of x
asinh(x)area sine hyperbolic of x
acosh(x)area-cosine hyperbolic of x
atanh(x)area-tangent hyperbolic of x