|
Revision 26, 1.0 kB
(checked in by lhealy, 9 months ago)
|
|
Subversion version stamp.
|
-
Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 | ;; Elementary functions |
|---|
| 2 | ;; Liam Healy, Mon Mar 20 2006 - 21:43 |
|---|
| 3 | ;; Time-stamp: <2008-02-16 20:22:17EST elementary.lisp> |
|---|
| 4 | ;; $Id$ |
|---|
| 5 | |
|---|
| 6 | (in-package :gsl) |
|---|
| 7 | |
|---|
| 8 | (defmfun multiply (x y) |
|---|
| 9 | "gsl_sf_multiply_e" |
|---|
| 10 | ((x :double) (y :double) (ret sf-result)) |
|---|
| 11 | :documentation ; FDL |
|---|
| 12 | "Multiplies x and y returning the product and associated error.") |
|---|
| 13 | |
|---|
| 14 | (defmfun multiply-err (x dx y dy) |
|---|
| 15 | "gsl_sf_multiply_err_e" |
|---|
| 16 | ((x :double) (dx :double) (y :double) (dy :double) (ret sf-result)) |
|---|
| 17 | :documentation ; FDL |
|---|
| 18 | "Multiplies x and y with associated absolute |
|---|
| 19 | errors dx and dy. The product xy +/- xy \sqrt((dx/x)^2 +(dy/y)^2) |
|---|
| 20 | is returned.") |
|---|
| 21 | |
|---|
| 22 | #| |
|---|
| 23 | (make-tests elementary |
|---|
| 24 | (multiply 3.0d0 2.0d0) |
|---|
| 25 | (multiply-err 3.0d0 0.1d0 2.0d0 0.1d0)) |
|---|
| 26 | |# |
|---|
| 27 | |
|---|
| 28 | (LISP-UNIT:DEFINE-TEST ELEMENTARY |
|---|
| 29 | (LISP-UNIT::ASSERT-NUMERICAL-EQUAL |
|---|
| 30 | (LIST 6.0d0 2.6645352591003757d-15) |
|---|
| 31 | (MULTIPLE-VALUE-LIST (MULTIPLY 3.0d0 2.0d0))) |
|---|
| 32 | (LISP-UNIT::ASSERT-NUMERICAL-EQUAL |
|---|
| 33 | (LIST 6.0d0 0.5000000000000027d0) |
|---|
| 34 | (MULTIPLE-VALUE-LIST |
|---|
| 35 | (MULTIPLY-ERR 3.0d0 0.1d0 2.0d0 0.1d0)))) |
|---|