homehome

Functions and operators


Function

  1. A function is a mathematical expression composed of numerical values, parameters, variables, parentheses, and operators.
  2. A parameter is specified by continuing a positive integer after character 'p'. The integer must be arranged in order of 0, 1, 2, .... For instance, it becomes p0, p1, p2 and so on.
  3. Variables are character 'x' and 'y'.
  4. Operators are binary operators, left unary and right unary operators. Refer to the following table.
  5. For instance, for a Gaussian function, the mathematical expression becomes p0*exp(-0.5*((x-p1)/p2)^2), where "2" is a numerical value, "p0", "p1" and "p2" are parameters, "x" is a variable, and "^" and "exp()" are operators.
  6. If you specify the exponent e(=2.71828) in the function, you can use character 'e'.
  7. If you specify (=3.14159...) in the function, you can use character string "pi".

Operators

The operators that you can use in this application are shown in the tables below.
Binary operators
OperatorOperationPriorityExampleMathematical formula
^power6x^axa
*multiplication5a*xa x
/division5x/a
+addtion4x+ax + a
-subtraction4x-ax - a

Left unary operators
OperatorOperationPriorityExampleMathematical formula
absabsolute value6abs(x)|x|
sqrsquare6sqr(x)x2
sqrtsquare root6sqrt(x)
expexponential6exp(x)ex
lnnatural logarithm6ln(x)logex
logcommon logarithm6log(x)log10x
sinsine6sin(x)sin x
coscosine6cos(x)cos x
tantangent6tan(x)tan x
asininverse sine6asin(x)sin-1x ( = arcsin x)
acosinverse cosine6acos(x)cos-1x ( = arccos x)
ataninverse tangent6atan(x)tan-1x ( = arctan x)
sinhhyperbolic sine6sinh(x)sinh x
coshhyperbolic cosine6cosh(x)cosh x
tanhhyperbolic tangent6tanh(x)tanh x
asinhinverse hyperbolic sine6asinh(x)sinh-1x ( = arcsinh x)
acoshinverse hyperbolic cosine6acosh(x)cosh-1x ( = arccosh x)
atanhinverse hyperbolic tangent6atanh(x)tanh-1x ( = arctanh x)
coseccosecant6cosec(x)cosec x ( = 1/sin x)
secsecant6sec(x)sec x ( = 1/cos x)
cotcotangent6cot(x)cot x ( = 1/tan x)
acosecinverse cosecant6acosec(x)cosec-1 x ( = arccosec x = arcsin 1/x = sin-1 1/x)
asecinverse secant6asec(x)sec-1 x ( = arcsec x = arccos 1/x = cos-1 1/x)
acotinverse cotangent6acot(x)cot-1 x ( = arccot x = arctan 1/x = tan-1 1/x)
cosechhyperbolic cosecant6cosech(x)cosech x (=1/sinh x)
sechhyperbolic secant6sech(x)sech x (=1/cosh x)
cothhyperbolic cotangent6coth(x)coth x (=1/tanh x)
acosechinverse hyperbolic cosecant6acosech(x)cosech-1 x ( = arccosech x = arcsinh 1/x = sinh-11/x)
asechinverse hyperbolic secant6asech(x)sech-1 x ( = arcsech x = arccosh 1/x = cosh-1 1/x)
acothinverse hyperbolic cotangent6acoth(x)coth-1 x ( = arccoth x = arctanh 1/x = tanh-1 1/x)

Right unary operators
OperatorOperationPriorityExampleMathematical formula
!factorial6n!
%percent6a%100 a

Input of parameters

Examples for functions

Polynomial function
f(x) = p0+p1*x+p2*x^2+....
Exponential function
f(x) = p0*exp(-p1*x)
Gaussian function
f(x) = p0*exp(-0.5*((x-p1)/p2)^2)
p0 : amplitude, p1 : mean(), p2 : standard deviation()
Breit-Wigner(Cauchy-Lorenz) function
f(x) = p0*p1/(p1^2+4*(x-p2)^2)
p0 : amplitude, p1 : Full Width at Half Maximum, p2 : most probable value(peak position)
Landau function
f(x) = p0*exp(-0.5*((x-p1)/p2+exp(-(x-p1)/p2)))
p0 : amplitude, p1 : most probable value(peak position), p2 : width
Ellipse
f(x,y) = p0*x^2+p1*x*y+p2*y^2+p3*x+p4*y-1.0


Kazushi Neichi
Department of Business Administration, Tohoku Gakuin University