functions abs erf log tanh atan erfc log10 atan2 exp sin cos int sqrtThe above math functions return a double precision value and take a double precision argument. The exception is atan2 with two double precision arguments.
These functions call the library routines supplied by the compiler.
math
trigonometric function of radian argument.
mathtrigonometric function of radian argument.
see sin
mathreturns the arc-tangent of y/x in the range -PI/2 to PI/2. (x > 0)
math
radians = atan2(y, x)
atan2(0,0) for i=-1,1 { print atan2(i*1e-6, 10) } for i=-1,1 { print atan2(i*1e-6, -10) } for i=-1,1 { print atan2(10, i*1e-6) } for i=-1,1 { print atan2(-10, i*1e-6) } atan2(10,10) atan2(10,-10) atan2(-10,10) atan2(-10,-10)
mathhyperbolic tangent. see tanh for the Vector class.
mathlogarithm to the base e see log for the Vector class.
mathlogarithm to the base 10
see log10 for the Vector class.
math
When exp is used in model descriptions, it is often the case that the cvode variable step integrator extrapolates voltages to values which return out of range values for the exp (often used in rate functions). There were so many of these false warnings that it was deemed better to turn off the warning message when Cvode is active. In any case the return value is exp(700). This message is not turned off at the interpreter level or when cvode is not active.
for i=690, 710 print i, exp(i)
mathsquare root
see sqrt for the Vector class.
mathreturns the integer part of its argument (truncates toward 0).
mathabsolute value
mathnormalized error function @eqn \[{\rm erf}(z) = \frac{2}{\sqrt{\pi}} \int_{0}^{z} e^{-t^2} dt\] @endeqn
math
erf(z)
but on sun machines computed by other methods
that avoid cancellation for large z.