[R] derivative of atan(x) and similar functions

Martin Maechler maechler at stat.math.ethz.ch
Thu Jan 22 09:05:39 CET 2004

>>>>> "Timur" == Timur Elzhov <Timur.Elzhov at jinr.ru>
>>>>>     on Wed, 21 Jan 2004 14:54:58 +0300 writes:

    Timur> Dear R experts.  'D()' function recognizes some of
    Timur> the analitical functions, such as sin, cos, etc. But
    Timur> I'd like to take analytical derivatives from asin,
    Timur> atan etc. functions. Are there any R packages
    Timur> providing that features?
Not that I know of.

We know that it is one deficiency of D() {and deriv() ...} that
it's not user-extendable.
For the asin/acos/atan , I think we would gladly incorporate
them into the current list --- IF someone volunteers to send us
the patch.  Since sqrt() and basic arithmetic is already
supported, this is only a matter of diligency..
It's the file  <Rsource>/src/main/deriv.c  {and mainly (but not
only) the  D(SEXP expr, SEXP var) function starting at line 268
that needs to be extended.  If know some Lisp, it might be
easier to get started... ;-)

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

More information about the R-help mailing list