From: SourceForge.net <no...@so...> - 2003-11-18 17:41:19
|
Bugs item #842863, was opened at 2003-11-15 21:10 Message generated for change (Comment added) made by wjenkner You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=842863&group_id=4933 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Barton Willis (willisbl) Assigned to: Nobody/Anonymous (nobody) Summary: qq.lisp is broken (numerical integration) Initial Comment: (C1) load("qq.lisp"); Load failed for C:/maxima/Maxima/share/maxima/5.9.0/share/numeric/qq .lisp -- an error. Quitting. To debug this try DEBUGMODE (TRUE);) (C2) build_info(); Maxima version: 5.9.0 Maxima build date: 19:10 2/9/2003 host type: i686-pc-mingw32 lisp-implementation-type: Kyoto Common Lisp lisp-implementation-version: GCL-2-5.0 Barton ---------------------------------------------------------------------- >Comment By: Wolfgang Jenkner (wjenkner) Date: 2003-11-18 18:41 Message: Logged In: YES user_id=581700 ad 1) Thanks :-) I have added a TRANSLATE property for $QUANC8 (see the URLs in the previous message below). So the last example in the demo (concerning the function p) really shows a speed difference between the interpreted and the translated version as intended, at least for CLISP and SBCL (I haven't tested it with GCL). For SBCL the difference seems quite impressive, actually. This also requires a small patch to numer.lisp (see below) ad 2) I still don't know why SBCL doesn't grok that type declaration. I'll recompile SBCL and see. It would also be a good thing to test the code with CMUCL. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Index: numer.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/src/numer.lisp,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 numer.lisp --- numer.lisp 8 May 2000 06:09:41 -0000 1.1.1.1 +++ numer.lisp 18 Nov 2003 17:06:15 -0000 @@ -155,6 +155,8 @@ (OR LPROPS MPROPS) (OR MPROPS LPROPS)) (GETL F '(OPERATORS))))) + ((functionp f) + (list 'expr f)) ((consp f) ;(EQ (TYPEP F) 'LIST) (LIST (IF (MEMQ (CAR F) '(FUNCTION LAMBDA NAMED-LAMBDA)) 'EXPR ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cut ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ---------------------------------------------------------------------- Comment By: Barton Willis (willisbl) Date: 2003-11-18 16:49 Message: Logged In: YES user_id=895922 1. Nice work. 2. The load(qq.lisp) bug was already reported (but not resolved) in bug 614631. I think we should commit the fix and close both bugs. Barton ---------------------------------------------------------------------- Comment By: Wolfgang Jenkner (wjenkner) Date: 2003-11-18 01:38 Message: Logged In: YES user_id=581700 However, the double integral example in the demo won't work. This shows why $QUANC8 can't be a DEFUN... I rewrote it as (defmspec $quanc8 (form) (setq form (cdr form)) (if (cdddr form) (apply #'call-quanc8 (meval `((lambda) ((mlist) ,(cadr form)) ,(car form))) (mapcar #'meval (cddr form))) (apply #'call-quanc8 (mapcar #'meval form)))) All examples in the demo seem to work as expected (after lower-casing them). My current versions of the relevant files are http://members.inode.at/wjenkner/maxima/qq.lisp http://members.inode.at/wjenkner/maxima/qq.dem This works in CLISP. SBCL has some problem with the type declarations in QUANC8 (without them it works fine). ---------------------------------------------------------------------- Comment By: Barton Willis (willisbl) Date: 2003-11-17 21:42 Message: Logged In: YES user_id=895922 The change ;(DEFUN ($QUANC8 TRANSLATED-MMACRO) (F A B &OPTIONAL (C NIL C-P)) ; (IF (NOT C-P) ; `((CALL-QUANC8) ,F ,A ,B) ; `((CALL-QUANC8) ((LAMBDA) ((MLIST) ,A) ,F) ,B ,C))) (defun $quanc8 (f a b &optional (c nil c-p)) (if (not c-p) (call-quanc8 f a b) (call-quanc8 `((lambda) ((mlist) ,a) ,f) b c))) allows qq.lisp to load correctly. Here are a few simple tests (C1) load("c:/maximacvs/maxima/share/numeric/qq.lisp"); (D1) c:/maximacvs/maxima/share/numeric/qq.lisp (C2) QUANC8_ABSERR : 1.0e-12; (D2) 1.0E-12 (C3) quanc8('(1/x),x,1,2); (D3) 0.69314718056001 (C4) %-log(2.0d0); (D4) 6.283862319378386E-14 (C5) f(x) := block([], mode_declare(x,float), 1/x)$ (C6) compile(f)$ Compiling gazonk0.lsp. End of Pass 1. End of Pass 2. OPTIMIZE levels: Safety=2, Space=2, Speed=2 Finished compiling gazonk0.lsp. (C7) quanc8(f,1,2); (D7) 0.69314718056001 Barton ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=842863&group_id=4933 |