Mathematical Functions

Mathematical functions available from within Tao's synthesis language are inhereted directly from the gnu C++ math library. These include:  

    acos(x)     arc cosine.
    acosh(x)    inverse hyperbolic cosine.
    asin(x)     arc sine.
    atan(x)     arc tangent.
    atanh(x)    inverse hyperbolic tangent.
    atan2(x,y)  arc tangent of two variables.
    cbrt(x)     cube root.
    cos(x)      cosine.
    cosh(x)     hyperbolic cosine.
    drem(x,y)   floating point remainder.
    exp(x)      exponential.
    fabs(x)     absolute value of floating point number.
    ceil(x)     smallest integral number not less than x.
    floor(x)    largest integral number not greater than x.
    hypot(x,y)  Euclidean distance function.
    log(x)      natural logarithm.
    log10(x)    base-10 logarithm.
    log1p(x)    logarithm of 1+x.
    pow(x,y)    value of x raised to the power of y.
    rint(x)     round to closest integer.
    sin(x)      sine.
    sinh(x)     hyperbolic sine.
    sqrt(x)     square root.
    tan(x)      tangent.
    tanh(x)     hyperbolic tangent.

The set of functions which are available is currently governed by what Tao's script parser has been told to expect. If Tao is ported to an OS other than Linux in the future this strategy will have to be rethought, since different math libraries often vary in the names and availability of functions.

In addition to the standard math library functions two random number functions are also provided. These are randomi(x,y) , which returns a random integer in the range [x..y]; and randomf(x,y) , which returns a random floating point number in the range [x..y] inclusive.


©1999,2000 Mark Pearson m.pearson@ukonline.co.uk April 30, 2000