This is a Chicken Scheme egg which implements automatic differentiation by lifitng mathematical operations. This egg uses a hack to declare all lifted operations as both a macro and a procedure. The macro provides specialization for the two-argument case. This package originates in Jeff Siskind's QobiScheme.
- (derivative-R f)
- (derivative-F f)
- (gradient-R f)
- (gradient-F f)
+ - * / = > < >= <= add1 sub1 signum exp log sin cos atan expt sqrt abs max min positive? negative? odd? even? zero? real? exact? inexact? inexact->exact exact->inexact finite?
These operations are lifted.
tan acos asin quotient modulo remainder numerator denominator gcd lcm floor ceiling truncate round
These operations are not lifted.
- (lift-real->real f df/dx x)
- (lift-real*real->real f df/dx1 df/dx2 x1 x2)
((derivative-F (lambda (x) (* x x))) 2) => 4.0
((gradient-F (lambda (x) (+ (* (vector-ref x 0) (vector-ref x 0)) (/ (vector-ref x 1) (vector-ref x 1))))) '#(2 3)) => #(4.0 0.0)
Copyright 1993-1995 University of Toronto. All rights reserved. Copyright 1996 Technion. All rights reserved. Copyright 1996 and 1997 University of Vermont. All rights reserved. Copyright 1997-2001 NEC Research Institute, Inc. All rights reserved. Copyright 2002-2012 Purdue University. All rights reserved.
Contact Andrei Barbu, email@example.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses.