# How to use

Index
Keisan Online Calculator service aims to achieve the high precision of calculation by applying Arithmetic Operation System with variable number of digits developed by Casio.
Feature of Keisan Online Calculator Service
1. The digit number can be specified.
 digit 6 √5 =sqrt(5) =2.23607 digit 14 √5 =sqrt(5) =2.2360679774998

2. All operations are carried out in the decimal system.
 keisan (0.9-0.3*3) =0 Excel (0.9-0.3*3) =1.11022E-16

3. The number of correct digits in the operation result is automatically judged and the precise operation result is returned.
 digit  6 1-0.999876 =1.24000E-4 digit 10 gamma(3.5) =3.323350970

4. Complex number, probability function, special function, and repeated calculation can be handled.
[digit 6]
Complex number  (1+i)^(1+i) =0.273957+0.583701i
Error function  x=0.1    erf(x) =0.112463
Repeated calculation  x=2,1,5   sqrt(x)
 x sqrt(x) 2 1.41421 3 1.73205 4 2 5 2.23607 6 2.44949

5. The library of expressions can be utilized.
 Ex) Area of triangle s=(a+b+c)/2; a=3; b=4; c=5; sqrt(s*(s-a)*(s-b)*(s-c))

Reference.
 Patent: USA Patent No.7716267(May 5, 2010) Japan Patent No.4483491(April 2, 2010)

Description rule of expression
1. Numerical values
The numerical value is displayed with combination of
0,1,2,3,4,5,6,7,8,9, .(decimal point), E(exponent), i (imaginary number),+ and -
Example Explanation
12340.56789 1.234056789E4
E2 100
1.23E+4 12300      Note: + after E is the sign of exponent
1.23E-4 0.000123  Note: - after E is the sign of exponent
i 0+1i
E+2i 0+100i
1.23+4.56i Note: In order to handle the expression as complex number, put it in the parenthesis
1.23E3+4.56E2i 1230+456i
1.23E-3-4.56E+2i 0.00123-456i
Note: A capital letter E is used for an exponent. (A small letter e is used for Napier's constant.)

2. Variables
The variable begins with an English letter and is composed of letters, words and/or numbers.
However, it is not possible to use the same variable identifier as special sign and reserved word.
Valid a, sinx, a3, interest_rate and the like reserved word such as e, i, inf, sin #abc, 3abc

3. Functions
The function consists of the reserved word, and the one or more of arguments which are surrounded by the parenthesis.
if there are more than two arguments, they have to be divided by comma.
The numerical value, variable, function and expression can be described as the argument.
 Ex)   sin(x)         normalcd(x,μ,2)         normalcd(x+y,ln(12),σ) The parenthesis is not required for constant.  Ex)   pi   inf   e

4. Operators
The operators (+, -, *, /, ^, ! and = ) execute operations between each element of numerical value, variable and function.
Example Explanation
Element 1 + Element 2 Add Element 1 to Element 2.
Element 1 - Element 2 Subtract Element 2 from Element 1.
Element 1 * Element 2 Multiply Element 1 by Element 2.
(* it is possible also to abbreviate)
Element 1 / Element 2 Divide Element 1 by Element 2.
Element 1 ^ Element 2 Calculate Element 1 to the power of Element 2.
Element 1 ! Factorial of Element 1.
(Note that the factorial operation is performed only for one element.)
Element 1 = Element 2 Substitute the operation result of Element 2 into Element 1.
Therefore Element 1 must be variable.

5. Expressions
The expression is composed of numerical value, variable and function, each element of which is connected by the operator. Further, the expressions can be connected by the operator as one element.
The operational order between each element follows "the operational order of expressions".
 Ex) element1 + element2 - element3 * element4 / element5 ^ element6 ! + ･･･

6. Miscellaneous
Minus "-", excluding the exponential part of expression, is regarded as a binary operator.
Minus "-" at the beginning of the expression or immediately after the open parenthesis or immediately after the semicolon, is considered as that the beginning of zero is abbreviated.
 Ex) -a+b → (0-a)+b -a^b → 0-(a^b) a^-b → Error a^(-b) → a^(0-b) a*b;-a*b → a*b;0-(a*b) a*-b → Error In order to make expression easy to see, insert the space between words.

Order of operations in expression
 1. The expression is operated in the higher priority order of the operator. 2. The operation is performed from the left side if there is more than one operator of the same priority. (The power operator is performed from the right side.) 3. The operation inside the parenthesis is performed with high priority. 4. Further, the parenthesis can be described inside the parenthesis. In that case, the priority is given to the inside parenthesis.

Type and priority of operator
Priority Operator Meaning
high

low
Function Intrinsic function
!!, !, ^ Double factorial, Factorial and Power
*, / Multiplication and Division
+, - Addition and Subtraction
= Substitution

Mistakable description example of expression.
1. The order of operations without parenthesis..
 2+3*4 → 2+(3*4) The multiplication is calculated first than the addition. 3*4^5 → 3*(4^5) The power is calculated first than the multiplication. sin(2)^3 → (sin(2))^3 The function is calculated first than the power. 1/2i → 1/(2i) The imaginary number sign takes precedence. 3!!! → (3!!)! The double factorial takes precedence from the factorial.

2. The expression without multiplication sign.
 3a ○ It is calculated as 3*a. a3 × a3 is handled as variable identifier. a(b+c) × It is not calculated as a* (b+c). "a" is handled as user defined function. (a+b)(b+c) ○ It is calculated as (a+b)*(b+c).

Numerical values, operators and constants
Functional name Reserved word
Numerical values
Number 1234567890 0 ~9
Decimal point 0.123 .
Sign -123, +456 +,-
Exponent 1.23E-45 E
Imaginary number 2+3i i
Operators
Subtraction x-y -
Multiplication x*y *
Division x/y /
Power x^y ^
Factorial n! !
Double factorial n!! !!
Substitution a=123 =
Multiple expressions
Expression separator a=2+3; b=4/7 ;
Constants
Napier's constant e= 2.71828 e
Infinity inf
Pi π = 3.14159...pi
Euler's constant γ= 0.5772...euler
Logical value true = 1
false = 0
true
false

Elementary functions
Functional name Reserved word
Logarithm and Exponential functions
Square root sqrt(x)
Common logarithm log log(x)
Natural logarithm ln ln(x)
Exponential ex e^x
Power xy x^y
Trigonometric functions
Sine sin sin(x)
Cosine cos cos(x)
Tangent tan tan(x)
Invese sine sin-1 asin(x)
Invese cosine cos-1 acos(x)
Invese tangent tan-1 atan(x)
Hyperbolic functions
Hyperbolic sine sinh sinh(x)
Hyperbolic cosine cosh cosh(x)
Hyperbolic tangent tanh tanh(x)
Invese hyperbolic sine sinh-1 asinh(x)
Invese hyperbolic cosine cosh-1 acosh(x)
Invese hyperbolic tangent tanh-1 atanh(x)
Combination and Permutation
Combination nCr combination(n,r)
Permutation nPr permutation(n,r)
Factorial x! x!
Double factorial x!! x!!
Numerical functions (real number)
Floor function int(4.2) =4
int(-4.2) =-5
int(x)
Ceiling function ceiling(4.2) =5
ceiling(-4.2) =-4
ceiling(x)
Integer part IP(4.2) =4
IP(-4.2) =-4
IP(x)
Fractional part FP(4.2) =0.2
FP(-4.2) =-0.2
FP(x)
Remainder on division of x by y mod(9,5) =4
mod(-9,5) =1
mod(x, y)
y*FP(x/y) remainder(9,5)=4
remainder(-9,5)=-4
remainder(x, y)
Rounding x to n decimal place(s)
round(2.35,1)=2.4
round(-2.35,1)=-2.4
round(x, n)
Round down x to n decimal place(s) rounddown(2.34,1) =2.3
rounddown(-2.34,1) =-2.4
rounddown(x, n)
Round up x to n decimal place(s) roundup(2.34,1) =2.4
roundup(-2.34,1) =-2.3
roundup(x, n)
IP(x*10n)/10n truncate(2.34,1) =2.3
truncate(-2.34,1) =-2.3
truncate(x, n)
Random # (decimal) random decimal number in [0,1] random_f()
Random # (decimal) random decimal number in [a,b] random_f(a,b)
Random # (integer) random integer number in [a,b] random_i(a,b)
Numerical functions (complex number)
Sign sign(z) =1,0,-1 sign(z)
Complex conjugate number x+iyconjugate(z)
Real part x+iyRe(z)
Imaginary part x+iylm(z)
Absolute value |z| =|re| =r abs(z)
Complex argument reargument(z)
Cartesian coordinate conversion recartesian(z)
Cartesian coordinate conversion (r,θ)cartesian(r,θ)
Polar coordinate conversion x+iypolar(z)
Polar coordinate conversion (x, y)polar(x,y)

Probability functions
Continuous distribution functions
Functional name Reserved word
Q: Upper cumulative distribution
f: Probability density
x: Percentage point
λ: Non centrality
Standard normal distribution Q: normalcd(x)
f: normalpd(x)
x: normalicd(Q)
Normal distribution Q: normalcd(x,μ,σ)
f: normalpd(x,μ,σ)
x: normalicd(Q,μ,σ)
Logarithmic normal distribution Q: lognormalcd(x,μ,σ)
f: lognormalpd(x,μ,σ)
x: lognormalicd(Q,μ,σ)
Chi-square distribution Q: chi2cd(x,ν)
f: chi2pd(x,ν)
x: chi2icd(Q,ν)
t-distribution of student Q: tcd(x,ν)
f: tpd(x,ν)
x: ticd(Q,ν)
F-distribution Q: fcd(x,ν1,ν2)
f: fpd(x,ν1,ν2)
x: ficd(Q,ν1,ν2)
Noncentral chi-square distribution Q: ncchi2cd(x,ν,λ)
f: ncchi2pd(x,ν,λ)
x: ncchi2icd(Q,ν,λ)
λ: ncchi2il(P,x,ν)
Noncentral t-distribution Q: nctcd(x,ν,λ)
f: nctpd(x,ν,λ)
x: ncticd(Q,ν,λ)
λ: nctil(Q,x,ν)
Noncentral F-distribution Q: ncfcd(x,ν1,ν2,λ)
f: ncfpd(x,ν1,ν2,λ)
x: ncficd(Q,ν1,ν2,λ)
λ: ncfil(Q,x,ν1,ν2)
Uniform distribution Q: uniformcd(x,a,b)
f: uniformpd(x,a,b)
x: uniformicd(Q,a,b)
Exponential distribution Q: exponentialcd(x,b)
f: exponentialpd(x,b)
x: exponentialicd(Q,b)
Weibull distribution Q: weibullcd(x,a,b)
f: weibullpd(x,a,b)
x: weibullicd(Q,a,b)
Gamma distribution Q: gammacd(x,a,b)
f: gammapd(x,a,b)
x: gammaicd(Q,a,b)
Beta distribution Q: betacd(x,a,b)
f: betapd(x,a,b)
x: betaicd(Q,a,b)
Laplace distribution Q: laplacecd(x,a,b)
f: laplacepd(x,a,b)
x: laplaceicd(Q,a,b)
Cauchy distribution Q: cauchycd(x,a,b)
f: cauchypd(x,a,b)
x: cauchyicd(Q,a,b)
Pareto distribution Q: logisticcd(x,α,β)
f: paretopd(x,xm,α)
x: paretoicd(Q,xm,α)
Generalized Pareto distribution Q: gparetocd(x,μ,σ,ξ)
f: gparetopd(x,μ,σ,ξ)
x: gparetoicd(Q,μ,σ,ξ)
 < Note >  For the reserved word which uses lower cumulative probability P, add "lower" to the above-mentioned each reserved word end.  Ex)  P=poissoncdlower (x,λ), x=poissonicdlower (P,λ), λ=poissonillower (P, x)

Discrete distribution functions
Functional name Reserved word
Q: Upper cumulative distribution
f: Probability density
x: Percentage point
λ: Non centrality
Poisson distribution Q: poissoncd(x,λ)
f: poissonpd(x,λ)
x: poissonicd(Q,λ)
λ: poissonil(Q,x)
Binomial distribution Q: binomialcd(x,n,p)
f: binomialpd(x,n,p)
x: binomialicd(Q,n,p)
Negative binomial distribution Q: negbinomialcd(x,k,p)
f: negbinomialpd(x,k,p)
x: negbinomialicd(Q,k,p)
Geometric distribution Q: geometriccd(x,p)
f: geometricpd(x,p)
x: geometricicd(Q,p)
Hypergeometric distribution Q: hypgeometriccd(x,n,M,N)
f: hypgeometricpd(x,n,M,N)
< Note >
For the reserved word which uses lower cumulative probability P, add "lower" to the above-mentioned each reserved word end.
Ex)  P=poissoncdlower (x,λ), x=poissonicdlower (P,λ), λ=poissonillower (P, x)

Bessel functions
Bessel functions
Functional name Reserved word
f (x)
f '(x)
f-1 (0), s=1,2...
f '-1 (0), s=1,2...
Bessel function of the 1st kind Jν(x) besselj(ν,x)
besseljdf(ν,x)
besseljzeros(ν,s)
besseljdfzeros(ν,s)
Bessel function of the 2nd kind Yν(x) bessely(ν,x)
besselydf(ν,x)
besselyzeros(ν,s)
besselydfseros(ν,s)
Modified bessel function of the 1st kind Iν(x) besseli(ν,x)
besselidf(ν,x)
Modified bessel function of the 2nd kind Kν(x) besselk(ν,x)
besselkdf(ν,x)
Hankel function of the 1st kind H(1)ν(x) hankelH1(ν,x)
hankelH1df(ν,x)
Hankel function of the 2nd kind H(2)ν(x) hankelH2(ν,x)
hankelH2df(ν,x)

Spherical Bessel functions
Functional name Reserved word
f (x)
f '(x)
f-1 (0), s=1,2...
f '-1 (0), s=1,2...
Spherical bessel function of the 1st kind jν(x) sphericalbesselj(ν,x)
sphericalbesseljdf(ν,x)
sphericalbesseljzeros(ν,s)
sphericalbesseljdfzeros(ν,s)
Spherical bessel function of the 2nd kind yν(x) sphericalbessely(ν,x)
sphericalbesselydf(ν,x)
sphericalbesselyzeros(ν,s)
sphericalbesselydfzeros(ν,s)
Modified spherical bessel function of the 1st kind iν(x) sphericalbesseli(ν,x)
sphericalbesselidf(ν,x)
Modified spherical bessel function of the 2nd kind kν(x) sphericalbesselk(ν,x)
sphericalbesselkdf(ν,x)
Spherical hankel function of the 1st kind h(1)ν(x) sphericalhankelH1(ν,x)
sphericalhankelH1df(ν,x)
Spherical hankel function of the 2nd kind h(2)ν(x) sphericalhankelH2(ν,x)
sphericalhankelH2df(ν,x)

Airy functions
Functional name Reserved word
f (x)
f '(x)
f-1 (0), s=1,2...
f '-1 (0), s=1,2...
Airy function Ai(x) airyai(x)
airyaidf(x)
airyaizeros(s)
airyaidfzeros(s)
Airy function Bi(x) airybi(x)
airybidf(x)
airybizeros(s)
airybidfzeros(s)

Kelvin functions
Functional name Reserved word
f (x)
f '(x)
Kelvin function of the 1st kind berν(x) ber(ν,x)
berdf(ν,x)
Kelvin function of the 1st kind beiν(x) bei(ν,x)
beidf(ν,x)
Kelvin function of the 2nd kind kerν(x) ker(ν,x)
kerdf(ν,x)
Kelvin function of the 2nd kind keiν(x) kei(ν,x)
keidf(ν,x)
Kelvin function of the 3rd kind herν(x) her(ν,x)
herdf(ν,x)
Kelvin function of the 3rd kind heiν(x) hei(ν,x)
heidf(ν,x)

Special functions
Gamma functions
Functional name Reserved word
Gamma function Γ(a) gamma(a)
Lower
incomplete gamma function
γ(a,x) igamma1(a,x)
Upper
incomplete gamma function
Γ(a,x) igamma2(a,x)
gamma(a,x)
Lower regularized
incomplete gamma function
γ(a,x)/Γ(a) gammap(a,x)
Upper regularized
incomplete gamma function
Γ(a,x)/Γ(a) gammaq(a,x)
Logarithm of gamma function lnΓ(a) lngamma(a)
Digamma function Ψ(a) polygamma(a)
Polygamma function Ψ(n)(a) polygamma(n,a)
Double factorial x!! x!!
Pochhammer function (x)n pochhammer(x,n)

Beta functions
Functional name Reserved word
Beta function B(a,b) beta(a,b)
Regularized
incomplete beta function
Ix(a,b) y: ibeta(x,a,b)
x: ibetaix(y,a,b)
Regularized
incomplete beta function
I1-x(a,b) y: ibetac(x,a,b)
x: ibetacix(y,a,b)

Error functions
Functional name Reserved word
Error function erf(x) y: erf(x)
x: erfix(y)
Complementary error function erfc(x) y: erfc(x)
x: erfcix(y)
Imaginary error function erfi(x) y: erfi(x)

Elementary function integrals and Fresnel integrals
Functional name Reserved word
Exponential integral Ei(x) Ei(x)
Exponential integral En(x) Ei(n,x)
Logarithmic integral li(x) li(x)
Sine integral Si(x) Si(x)
Cosine integral Ci(x) Ci(x)
Hyperbolic sine integral Shi(x) Shi(x)
Hyperbolic cosine integral Chi(x) Chi(x)
Fresnel sine integral S(x) fresnelS(x)
Fresnel cosine integral C(x) fresnelC(x)

Elliptic integrals and Elliptic functions
Functional name Reserved word
Complete elliptic integral of the 1st kind K(k) ellipticK(k)
Complete elliptic integral of the 2nd kind E(k) ellipticE(k)
Complete elliptic integral of the 3rd kind Π(n,k)ellipticPi(n,k)
Incomplete elliptic integral of the 1st kind F(x,k) ellipticF(x,k)
Incomplete elliptic integral of the 2nd kind E(x,k) ellipticE(x,k)
Incomplete elliptic integral of the 3rd kind Π(x,n,k)ellipticPi(x,n,k)
Jacobi elliptic function sn sn(u) jacobiSN(u,k)
Jacobi elliptic function cn cn(u) jacobiCN(u,k)
Jacobi elliptic function dn dn(u) jacobiDN(u,k)
Jacobi amplitude function am(u) jacobiAM(u,k)

Orthogonal polynomials
Functional name Reserved word
Hermite polynomial Hn(x) hermiteH(n,x)
Chebyshev polynomial of the 1st kind Tn(x) chebyshevT(n,x)
Chebyshev polynomial of the 2nd kind Un(x) chebyshevU(n,x)
Legendre polynomial Pn(x) legendreP(n,x)
Associated Legendre polynomial Pnm(x) legendreP(n,,x)
Laguerre polynomial Ln(x) laguerreL(n,x)
Associated Laguerre polynomial Lnα(x) laguerreL(n,α,x)
Gegenbauer polynomial Cnλ(x) gegenbauerC(n,λ,x)
Jacobi polynomial Pnα,β(x) jacobiP(n,α,β,x)
Spherical harmonics Ynm(θ,φ) sphericalharmonicY(n, m,θ,φ)

Other functions
Functional name Reserved word
Confluent hypergeometric function of the 1st kind 1F1(a;b;x) F11(a,b,x)
Confluent hypergeometric function of the 2nd kind U(a;b;x) FU11(a,b,x)
Gauss hypergeometric function 2F1(a,b;c;x) F21(a,b,c,x)
Bernoulli number Bn bernoulli(n)
Riemann zeta function ζ(x) zeta(x)

Programming
This programming language is a "C-language-like" simple one and specialized for numerical computation.

Reserved word Quick instruction
if(expression) {statement;...} elseif(expression) {statement;...} else{statement;...} If the conditional expression of "if" is true, the statement is executed.
If false, the statement is executed by the conditional expression of "elseif".
The if statement ends after the execution of one of statements.
while(expression) {statement;...} If the conditional expression is true, the statement is executed.
The statement is repeatedly executed and ends when the conditional expression becomes false.
do{statement;...} while(expression); After the statement is unconditionally executed,
if the conditional expression is true, the statement is again executed.
If false, the statement ends.
for(initialize; check; update) {statement;...} At first the variable is initialized, and if the conditional expression is true, the statement is executed.
After the execution of the statement, the variable is incremented, the conditional expression is again evaluated,
and then the same procedure described above is repeatedly executed.
When the conditional expression becomes false, the statement ends.
break It escapes from a loop unconditionally.
continue It returns to the beginning of a loop unconditionally.

Display controls and Comment
Reserved word Quick instruction
print(expression1,expression2,...) The value of expression is outputted.
println(expression1,expression2,...) After outputting the value of expression, a new line is started.
/*comment*/ It participates in neither expression nor control.

Logical operators and Logical values
If a conditional expression is truth, the value is true. If not, the value is false.
Classification Reserved word Quick instruction
Logical operators
not Priority order: not > and > or
and
or
== The left expression is equal to the right expression. =
<> The left expression is not equal to the right expression. !=
=<, <= The left expression is less than or equal to the right expression. <=
=>, >= The left expression is greater than or equal to the right expression. >=
< The left expression is less than the right expression. <
> The left expression is greater than the right expression. >
Logical values
true true=1 (!=0)
false false=0

Array
Reserved word Quick instruction Examples
numeric Name[Length];
numeric Name[Length][Length];
numeric Name[Length][Length][Length];
....
Declare an array numeric test1[4];
numeric test2[4][4];
numeric test3[4][4][4];
numeric Name[] = {Value1,Value2,....};
numeric Name[][] = {{....},{....}};
numeric Name[][][] =
{{....},{....},{....}};
....
Declare and initialize an array numeric test1[] = {1,2,3};
numeric test2[][] = {{1,2,3},{4,5,6}};
kei_length(a) Get a length of an array numeric test[4];
n = kei_length(test);
function FunctionName(numeric k[])
{...}
Passing an array as a function parameter numeric test[]={0,1,2,3};
func1(test);

function func1(numeric k[])
{ print(k[0]);
.....
}