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

Kasper Kristensen kkr at dfu.min.dk
Thu Jan 22 15:52:32 CET 2004


I have added the differentiation rules for asin, acos and atan to the file 
deriv.c.
Please let me know where to send it.

 Date: Thu, 22 Jan 2004 09:05:39 +0100
 From: Martin Maechler <maechler at stat.math.ethz.ch>
 Subject: Re: [R] derivative of atan(x) and similar functions
 To: Timur Elzhov <Timur.Elzhov at jinr.ru>
 Cc: R-help <R-help at stat.math.ethz.ch>
 Message-ID: <16399.33875.287060.214681 at gargle.gargle.HOWL>
 Content-Type: text/plain; charset=us-ascii
 
 >>>>> "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