DERIV
DERIV x, maxtries, maxerr, BYREF result, BYREF errcode USE expr
Calculation of derivative.
x
: value of xmaxtries
: maximum number of retriesmaxerr
: toleranceerrcode
: 0 for success; otherwise calculation errorresult
: the resultexpr
: the function f(x)
Example 1
' What is the derivative of f(x) for a given x
def f(x) = 2*x^2+2
3
x = 0
result = 0
errcode =
deriv x, 10, 0.01, result, errcode USE f(x)
def d(x) = 4*x ' Exact derivative of f(x) for comparision
print "Result of DERIV at x = "; x; " : "; result
print "Exact derivative at x = "; x; " : "; d(x)
Example 2
' What is the derivative of f(x) for a given x
def f(x) = x^3 + 2 * exp(2*x)
3
x = 0
result = 0
errcode =
deriv x, 10, 0.000001, result, errcode USE f(x)
def d(x) = 3*x^2 + 4*exp(2*x) ' Exact derivative of f(x) for comparision
print "Result of DERIV at x = "; x; " : "; result
print "Exact derivative at x = "; x; " : "; d(x)
Code samples using DERIV
Math
ABS
ABSMAX
ABSMIN
ACOS
ACOSH
ACOT
ACOTH
ACSC
ACSCH
ASEC
ASECH
ASIN
ASINH
ATAN
ATAN2
ATANH
ATN
CEIL
COS
COSH
COT
COTH
CSC
CSCH
DEG
DERIV
DETERM
DIFFEQN
EXP
EXPRSEQ
FIX
FLOOR
FRAC
INT
INTERSECT
INVERSE
LINEQN
LOG
LOG10
M3APPLY
M3IDENT
M3ROTATE
M3SCALE
M3TRANS
MAX
MIN
POLYAREA
POLYCENT
POLYEXT
POW
PTDISTLN
PTDISTSEG
PTSIGN
RAD
RND
ROOT
ROUND
SEC
SECH
SEGCOS
SEGLEN
SEGSIN
SEQ
SGN
SIN
SINH
SQR
STATMEAN
STATMEANDEV
STATMEDIAN
STATSPREADP
STATSPREADS
STATSTD
SUM
SUMSQ
TAN
TANH
TRANSPOSE
If there is insufficient information on this page and you wish learn more about DERIV,
please send an email to smallbasic@gmail.com. You can help to improve information about
DERIV by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.