From: Vadim V. Zhytnikov <vvzhy@ma...>  20021006 08:33:39

Hi! It seems that there is some floating point bug in recently released clisp 2.30. I've been trying to compile Maxima CVS with clisp 2.30 and suddenly I've got large number of WARNING: Floating point operation combines numbers of different precision. See ANSI CL 12.1.4.4 and the CLISP impnotes for details. The result's actual precision is controlled by *FLOATINGPOINTCONTAGIONANSI*. To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. warnings in several Maxima modules floating point evaluation of elliptic and Bessel functions. Of course I can suppress these warnings by setting *WARNONFLOATINGPOINTCONTAGION* to NIL but I'm perfectly sure that they are spurious and caused by some clisp error because 1. Although Maxima can be compiled it now gives wrong value for Bessel and elliptic functions for both values of *FLOATINGPOINTCONTAGIONANSI* (T or NIL). Result is not totally meaningless but in both cases we get right digits only for single precision while double is expected. 2. With clisp 2.29 everything is just fine. I tried to apply recent patch from CVS to lisparit.d but the problem still persist. Best wishes,  Vadim V. Zhytnikov <vvzhy@...> <vvzhy@...> <vvzhy@...> <vvzhy@...> 
From: Sam Steingold <sds@gn...>  20021006 13:32:36

> * In message <3DA00366.3010104@...> > * On the subject of "[clisplist] floating point problems with clisp 2.30" > * Sent on Sun, 06 Oct 2002 12:33:26 +0300 > * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > It seems that there is some floating point bug in recently released > clisp 2.30. I've been trying to compile Maxima CVS with clisp 2.30 > and suddenly I've got large number of > WARNING: > Floating point operation combines numbers of different precision. > See ANSI CL 12.1.4.4 and the CLISP impnotes for details. > The result's actual precision is controlled by > *FLOATINGPOINTCONTAGIONANSI*. > To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. if you are not "combining numbers of different precision", this is a bug. please isolate it to specific funcalls (by setting *BREAKONSIGNALS* to T and looking at the backtrace) and report it to <clisplist>. Please investigate every single case when you get the warning. Thanks.  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; There are two ways to write errorfree programs; only the third one works. 
From: Vadim V. Zhytnikov <vvzhy@ma...>  20021006 18:54:12

Sam Steingold ?????: >>* In message <3DA00366.3010104@...> >>* On the subject of "[clisplist] floating point problems with clisp 2.30" >>* Sent on Sun, 06 Oct 2002 12:33:26 +0300 >>* Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: >> >> > > > >>It seems that there is some floating point bug in recently released >>clisp 2.30. I've been trying to compile Maxima CVS with clisp 2.30 >>and suddenly I've got large number of >>WARNING: >>Floating point operation combines numbers of different precision. >>See ANSI CL 12.1.4.4 and the CLISP impnotes for details. >>The result's actual precision is controlled by >>*FLOATINGPOINTCONTAGIONANSI*. >>To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. >> >> > >if you are not "combining numbers of different precision", this is a bug. >please isolate it to specific funcalls (by setting *BREAKONSIGNALS* >to T and looking at the backtrace) and report it to <clisplist>. > >Please investigate every single case when you get the warning. > >Thanks. > > > Here is one piece of the problem which explains some excessive warnings [1]> (expt 5.0d0 0.3d0) WARNING: Floating point operation combines numbers of different precision. See ANSI CL 12.1.4.4 and the CLISP impnotes for details. The result's actual precision is controlled by *FLOATINGPOINTCONTAGIONANSI*. To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. 1.6206565966927624d0 [2]> Obviously warning is not required here. Unfortunately this doesn't explain wrong numeric values which I get for some special functions in Maxima with clisp 2.30 since the value above is correct. Best wishes,  Vadim V. Zhytnikov <vvzhy@...> <vvzhy@...> <vvzhy@...> <vvzhy@...> 
From: Sam Steingold <sds@gn...>  20021006 22:34:22

> * In message <3DA094CE.3060307@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on Sun, 06 Oct 2002 22:53:50 +0300 > * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > > Here is one piece of the problem which explains > some excessive warnings > > [1]> (expt 5.0d0 0.3d0) > > WARNING: > Floating point operation combines numbers of different precision. > See ANSI CL 12.1.4.4 and the CLISP impnotes for details. > The result's actual precision is controlled by > *FLOATINGPOINTCONTAGIONANSI*. > To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. > 1.6206565966927624d0 > [2]> thanks. this is fixed by the appended patch. > Unfortunately this doesn't explain wrong numeric values which I get > for some special functions in Maxima with clisp 2.30 since the value > above is correct. please send _all_ cases when you get the above warning.  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Yeah, yeah, I love cats too... wanna trade recipes?  realelem.d.~1.17.~ Thu Sep 12 04:14:11 2002 +++ realelem.d Sun Oct 6 18:16:53 2002 @@ 250,7 +250,7 @@ return F_to_SF(x), return F_to_FF(x), return F_to_DF(x),  return F_to_LF(x,I_to_UL(O(LF_digits))), + return F_to_LF(x,lfloat_length(TheLfloat(y))), pushSTACK(x), x = popSTACK()); } local object RA_R_float_F (object x, object y) @@ 259,7 +259,7 @@ return RA_to_SF(x), return RA_to_FF(x), return RA_to_DF(x),  return RA_to_LF(x,I_to_UL(O(LF_digits))), + return RA_to_LF(x,lfloat_length(TheLfloat(y))), pushSTACK(x), x = popSTACK()); } local object R_R_float_F (object x, object y) 
From: Sam Steingold <sds@gn...>  20021007 15:18:14

> * In message <3DA094CE.3060307@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on Sun, 06 Oct 2002 22:53:50 +0300 > * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > > Unfortunately this doesn't explain wrong numeric values which I get > for some special functions in Maxima with clisp 2.30 since the value > above is correct. note that BESSEL &co call explicit (FLOAT * 1.0) which can easily result in floating point contagion. again, _please_ supply me with an test example where a CLISP builtin function produces incorrect results (either WRT precision, of value or whatever). thanks.  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Murphy's Law was probably named after the wrong guy. 
From: Sam Steingold <sds@gn...>  20021010 14:45:02

> * In message <3DA094CE.3060307@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on Sun, 06 Oct 2002 22:53:50 +0300 > * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > > Unfortunately this doesn't explain wrong numeric values which I get > for some special functions in Maxima with clisp 2.30 since the value > above is correct. I fixed in the CVS all bugs you have reported so far. please get the CLISP CVS HEAD and check that everything is OK. Thanks.  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Trespassers will be shot. Survivors will be prosecuted. 
From: Vadim V. Zhytnikov <vvzhy@ma...>  20021012 18:10:44

Sam Steingold ?????: >>* In message <3DA094CE.3060307@...> >>* On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >>* Sent on Sun, 06 Oct 2002 22:53:50 +0300 >>* Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: >> >>Unfortunately this doesn't explain wrong numeric values which I get >>for some special functions in Maxima with clisp 2.30 since the value >>above is correct. > > > I fixed in the CVS all bugs you have reported so far. > please get the CLISP CVS HEAD and check that everything is OK. > Thanks. > Today's CLISP CVS works fine and passes all tests with Maxima CVS. Thank you!  Vadim V. Zhytnikov <vvzhy@...> <vvzhy@...> <vvzhy@...> <vvzhy@...> 
From: Sam Steingold <sds@gn...>  20021013 02:59:04

> * In message <3DA873A2.7070002@...> > * On the subject of "Re: floating point problems with clisp 2.30" > * Sent on Sat, 12 Oct 2002 22:10:26 +0300 > * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > > Sam Steingold ?????: > >>* In message <3DA094CE.3060307@...> > >>* On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > >>* Sent on Sun, 06 Oct 2002 22:53:50 +0300 > >>* Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > >> > >>Unfortunately this doesn't explain wrong numeric values which I get > >>for some special functions in Maxima with clisp 2.30 since the value > >>above is correct. > > I fixed in the CVS all bugs you have reported so far. > > please get the CLISP CVS HEAD and check that everything is OK. > > Today's CLISP CVS works fine and passes all > tests with Maxima CVS. what about the case when some function was given a DOUBLEFLOAT and returned a SINGLEFLOAT (or a SHORTFLOAT)? could you please recheck that this problem is gone too? thanks!  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Isn't "Microsoft Works" an advertisement lie? 
From: Vadim V. Zhytnikov <vvzhy@ma...>  20021014 19:57:41

Sam Steingold ?????: >>* In message <3DA873A2.7070002@...> >>* On the subject of "Re: floating point problems with clisp 2.30" >>* Sent on Sat, 12 Oct 2002 22:10:26 +0300 >>* Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: >> >>Sam Steingold ?????: >> >>>>* In message <3DA094CE.3060307@...> >>>>* On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >>>>* Sent on Sun, 06 Oct 2002 22:53:50 +0300 >>>>* Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: >>>> >>>>Unfortunately this doesn't explain wrong numeric values which I get >>>>for some special functions in Maxima with clisp 2.30 since the value >>>>above is correct. >>> >>>I fixed in the CVS all bugs you have reported so far. >>>please get the CLISP CVS HEAD and check that everything is OK. >> >>Today's CLISP CVS works fine and passes all >>tests with Maxima CVS. > > > what about the case when some function was given a DOUBLEFLOAT and > returned a SINGLEFLOAT (or a SHORTFLOAT)? > > could you please recheck that this problem is gone too? > > thanks! > Yes this problem is fixed as well. In any case with CLISP CVS 12.10.2002 I can't reproduce any problem I observed earlier with clisp 2.30. Everything seems to be fine. But I want to stress that I was not able to reduce these problems to some simple test outside Maxima (except wrong warning in expt) and now they all gone.  Vadim V. Zhytnikov <vvzhy@...> <vvzhy@...> <vvzhy@...> <vvzhy@...> 
From: Raymond Toy <toy@rt...>  20021007 16:20:40

>>>>> "Sam" == Sam Steingold <sds@...> writes: >> * In message <3DA094CE.3060307@...> >> * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >> * Sent on Sun, 06 Oct 2002 22:53:50 +0300 >> * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: >> >> Unfortunately this doesn't explain wrong numeric values which I get >> for some special functions in Maxima with clisp 2.30 since the value >> above is correct. Sam> note that BESSEL &co call explicit (FLOAT * 1.0) which can easily Sam> result in floating point contagion. Can you point out where that is? I can't find any such things in the current sources. Also, be aware that maxima defines (float x) to be (lisp::float x 1d0) somwhere. Very confusing until I realized that. Ray 
From: Sam Steingold <sds@gn...>  20021007 16:37:41

> * In message <4nd6qmb4q7.fsf@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on 07 Oct 2002 12:20:32 0400 > * Honorable Raymond Toy <toy@...> writes: > > >>>>> "Sam" == Sam Steingold <sds@...> writes: > > Sam> note that BESSEL &co call explicit (FLOAT * 1.0) which can easily > Sam> result in floating point contagion. > > Can you point out where that is? I can't find any such things in the > current sources. I meant (FLOAT N) and (FLOAT (F* 2 N)) in (DEFUN BESSEL) in bessel.lisp > Also, be aware that maxima defines (float x) to be (lisp::float x 1d0) > somwhere. Very confusing until I realized that. yuk. this goes together with (re)defining TYPEERROR, LOOPFINISH, IF &c. someone's gotta do a cleanup. at any rate, I would greatly appreciate some test cases (based on today's CVS).  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; main(a){printf(a,34,a="main(a){printf(a,34,a=%c%s%c,34);}",34);} 
From: Raymond Toy <toy@rt...>  20021007 16:46:44

>>>>> "Sam" == Sam Steingold <sds@...> writes: >> * In message <4nd6qmb4q7.fsf@...> >> * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >> * Sent on 07 Oct 2002 12:20:32 0400 >> * Honorable Raymond Toy <toy@...> writes: >> >> >>>>> "Sam" == Sam Steingold <sds@...> writes: >> Sam> note that BESSEL &co call explicit (FLOAT * 1.0) which can easily Sam> result in floating point contagion. >> >> Can you point out where that is? I can't find any such things in the >> current sources. Sam> I meant (FLOAT N) and (FLOAT (F* 2 N)) in (DEFUN BESSEL) in bessel.lisp I think these are ok because maxima redefines float. (Well, not really. This float is defined in the maxima package, not the lisp package.) >> Also, be aware that maxima defines (float x) to be (lisp::float x 1d0) >> somwhere. Very confusing until I realized that. Sam> yuk. Sam> this goes together with (re)defining TYPEERROR, LOOPFINISH, IF &c. Sam> someone's gotta do a cleanup. I think that's slated for a later release. There are lots of silly issues like this such as macros redefined as functions and vice versa, wrong number of args in various places (maybe), and so on. Ray 
From: Sam Steingold <sds@gn...>  20021007 16:57:42

> * In message <4n7kgub3in.fsf@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on 07 Oct 2002 12:46:40 0400 > * Honorable Raymond Toy <toy@...> writes: > > >>>>> "Sam" == Sam Steingold <sds@...> writes: > > Sam> yuk. > Sam> this goes together with (re)defining TYPEERROR, LOOPFINISH, IF &c. > Sam> someone's gotta do a cleanup. > > I think that's slated for a later release. There are lots of silly > issues like this such as macros redefined as functions and vice versa, > wrong number of args in various places (maybe), and so on. you will go a long way if you look at the CLISP warnings and eliminate them. Or give me CVS write access and I will do that.  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Never succeed from the first try  if you do, nobody will think it was hard. 
From: Raymond Toy <toy@rt...>  20021007 16:48:55

>>>>> "Sam" == Sam Steingold <sds@...> writes: >> * In message <4nd6qmb4q7.fsf@...> >> * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >> * Sent on 07 Oct 2002 12:20:32 0400 >> * Honorable Raymond Toy <toy@...> writes: >> >> >>>>> "Sam" == Sam Steingold <sds@...> writes: >> Sam> note that BESSEL &co call explicit (FLOAT * 1.0) which can easily Sam> result in floating point contagion. >> >> Can you point out where that is? I can't find any such things in the >> current sources. Sam> I meant (FLOAT N) and (FLOAT (F* 2 N)) in (DEFUN BESSEL) in bessel.lisp Oh, what version are you looking at? I can't find (defun bessel ...) in bessel.lisp in my copy of the CVS sources. Ray 
From: Sam Steingold <sds@gn...>  20021007 16:56:18

> * In message <4n3crib3f4.fsf@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on 07 Oct 2002 12:48:47 0400 > * Honorable Raymond Toy <toy@...> writes: > > >>>>> "Sam" == Sam Steingold <sds@...> writes: > > Sam> I meant (FLOAT N) and (FLOAT (F* 2 N)) in (DEFUN BESSEL) in bessel.lisp > > Oh, what version are you looking at? I can't find (defun bessel ...) > in bessel.lisp in my copy of the CVS sources. RCS file: /home/cvs/maxima/maxima/src/bessel.lisp,v Working file: bessel.lisp head: 1.2 line 477 Root: :pserver:anonymous@...:/home/cvs/maxima  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Your mouse has moved  WinNT has to be restarted for this to take effect. 
From: Raymond Toy <toy@rt...>  20021007 17:08:57

>>>>> "Sam" == Sam Steingold <sds@...> writes: >> * In message <4n3crib3f4.fsf@...> >> * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >> * Sent on 07 Oct 2002 12:48:47 0400 >> * Honorable Raymond Toy <toy@...> writes: >> >> >>>>> "Sam" == Sam Steingold <sds@...> writes: >> Sam> I meant (FLOAT N) and (FLOAT (F* 2 N)) in (DEFUN BESSEL) in bessel.lisp >> >> Oh, what version are you looking at? I can't find (defun bessel ...) >> in bessel.lisp in my copy of the CVS sources. Sam> RCS file: /home/cvs/maxima/maxima/src/bessel.lisp,v Sam> Working file: bessel.lisp Sam> head: 1.2 Sam> line 477 Sam> Root: :pserver:anonymous@...:/home/cvs/maxima Ok, that explains it. The maxima code has moved to maxima.sourceforge.net. A lot of the issues you've mentioned, however, still exist there. I think the fixes you're interested in are meant for something after the imminent 5.9.0 release. 5.9.0 is just an "update" to 5.6 so that clisp, gcl, and cmucl can build maxima. Ray 
From: Vadim V. Zhytnikov <vvzhy@ya...>  20021007 20:16:36

Sam Steingold write: >>* In message <3DA094CE.3060307@...> >>* On the subject of "Re: [clisplist] floating point problems with clisp 2.30" >>* Sent on Sun, 06 Oct 2002 22:53:50 +0300 >>* Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: >> >>Unfortunately this doesn't explain wrong numeric values which I get >>for some special functions in Maxima with clisp 2.30 since the value >>above is correct. >> >> > >note that BESSEL &co call explicit (FLOAT * 1.0) which can easily >result in floating point contagion. > >again, _please_ supply me with an test example where a CLISP builtin >function produces incorrect results (either WRT precision, of value or >whatever). > > > Unfortunately I can't provide any simple example yet but below are results which make me think that something is wrong with clisp 2.30 or at least something is wrong in combination Maxima + clisp 2.30. All results are obtained on different lisps with Maxima CVS (SourceForge):  CMUCL 18d (C1) gamma(1.1); (D1) .9513507698668733  GCL 2.5.0 CVS (C1) gamma(1.1); (D1) 0.95135076986687  CLISP 2.29 (C1) gamma(1.1); (D1) .9513507698668733  CLISP 2.30 (C1) gamma(1.1); WARNING: Floating point operation combines numbers of different precision. See ANSI CL 12.1.4.4 and the CLISP impnotes for details. The result's actual precision is controlled by *FLOATINGPOINTCONTAGIONANSI*. To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. <snip> (D1) 0.9513507 (C2) :lisp (setq custom::*floatingpointcontagionansi* t) T (C2) gamma(1.1); WARNING: Floating point operation combines numbers of different precision. See ANSI CL 12.1.4.4 and the CLISP impnotes for details. The result's actual precision is controlled by *FLOATINGPOINTCONTAGIONANSI*. To shut off this warning, set *WARNONFLOATINGPOINTCONTAGION* to NIL. <snip> (D2) .9513507355077885  Notice that all lisps including clisp 2.29 (and 2.28, and 2.27) give exactly the same answer and only clisp 2.30 result differs. Actual computation is performed by gammafloat and gammalanczos functions in csimp2.lisp. I'm glad that Raymond pointed out that Maxima redefines float. It solves some mystery to me. Originally I extracted gammalanczos into separate file to play with and obtained quite strange results which differ from ones obtained from Maxima. Now I understand why.  Vadim V. Zhytnikov <vvzhy@...> <vvzhy@...> <vvzhy@...> <vvzhy@...> 
From: Sam Steingold <sds@gn...>  20021007 21:54:32

> * In message <3DA1F966.7090101@...> > * On the subject of "Re: [clisplist] floating point problems with clisp 2.30" > * Sent on Tue, 08 Oct 2002 00:15:18 +0300 > * Honorable "Vadim V. Zhytnikov" <vvzhy@...> writes: > > Sam Steingold write: > > >again, _please_ supply me with an test example where a CLISP builtin > >function produces incorrect results (either WRT precision, of value > >or whatever). > Unfortunately I can't provide any simple example yet try (setq *breakonwarnings* t) please do try to make a standalone (nonmaxima) case! I just fixed some (but not all) problems.  Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux <http://www.camera.org>; <http://www.iris.org.il>; <http://www.memri.org/>; <http://www.mideasttruth.com/>; <http://www.palestinecentral.com/links.html>; Live Lisp and prosper. Index: src/comptran.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/comptran.d,v retrieving revision 1.13 retrieving revision 1.16 diff u w b r1.13 r1.16  src/comptran.d 11 Sep 2002 23:15:23 0000 1.13 +++ src/comptran.d 7 Oct 2002 21:47:37 0000 1.16 @@ 31,16 +31,27 @@ return R_exp_R(x,start_p,end_p); } else { /* x=a+bi */ pushSTACK(TheComplex(x)>c_real); /* save a */  R_cos_sin_R_R(TheComplex(x)>c_imag,start_p,NULL); /* (cos b), (sin b) */  /* stack layout: a, cos(b), sin(b). */ + pushSTACK(TheComplex(x)>c_imag); /* save b */ + pushSTACK(R_R_contagion_R(STACK_0,STACK_1)); + /* since x is complex, the result is a float anyway */ + if (R_rationalp(STACK_1)) /* b */ + STACK_1 = RA_R_float_F(STACK_1,STACK_0); + if (R_rationalp(STACK_2)) /* a */ + STACK_2 = RA_R_float_F(STACK_2,STACK_0); + if (start_p) { + STACK_1 = F_extend2_F(STACK_1); /* b */ + STACK_2 = F_extend2_F(STACK_2); /* a */ + } + R_cos_sin_R_R(STACK_1,false,NULL); /* (cos b), (sin b) */ + /* stack layout: a, b, contagion, cos(b), sin(b). */ /* b != Fixnum_0 ==> sin(b) ~= Fixnum_0. */  STACK_2 = R_exp_R(STACK_2,start_p,NULL); /* (exp a) */  /* stack layout: exp(a), cos(b), sin(b). */ + STACK_2 = R_exp_R(STACK_4,false,NULL); /* (exp a) */ + /* stack layout: a, exp(a), cos(b), sin(b). */ STACK_0 = R_R_mal_R(STACK_2,STACK_0); /* (* (exp a) (sin b)) != Fixnum_0 */ STACK_1 = R_R_mal_R(STACK_2,STACK_1); /* (* (exp a) (cos b)) */ x = R_R_complex_C(F_R_float_F(STACK_1,*end_p), F_R_float_F(STACK_0,*end_p)); /* (complex ... ...) */  skipSTACK(3); return x; + skipSTACK(5); return x; } } @@ 166,7 +177,7 @@ pushSTACK(a); pushSTACK(b); STACK_1 = N_log_N(STACK_1,true,&STACK_1); /* (log a) */ STACK_0 = N_log_N(STACK_0,true,&STACK_0); /* (log b) */  a = N_N_durch_N(a,b); /* divide */ + a = N_N_durch_N(STACK_1,STACK_0); /* divide */ skipSTACK(2); return a; } } @@ 502,10 +513,11 @@ STACK_3 = R_R_contagion_R(STACK_3,STACK_2); STACK_2 = x = R_exp_R(R_minus_R(STACK_2),false,NULL); /* (exp ( b)) */ /* stack layout: exp(b), cos(a), sin(a). */  STACK_0 = R_R_mal_R(x,STACK_0); /* (* (exp ( b)) (sin a)) */ + STACK_0 = R_R_mal_R(x,STACK_0); /* (* (exp ( b)) (sin a)), maybe 0 */ x = R_R_mal_R(STACK_2,STACK_1); /* (* (exp ( b)) (cos a)) */ x = R_R_complex_N(F_R_float_F(x,STACK_3), /* (complex ... ...) */  F_R_float_F(STACK_0,STACK_3)); + eq(Fixnum_0,STACK_0) ? Fixnum_0 + : F_R_float_F(STACK_0,STACK_3)); skipSTACK(4); return x; } } Index: src/lisparit.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lisparit.d,v retrieving revision 1.41 retrieving revision 1.43 diff u w b r1.41 r1.43  src/lisparit.d 24 Sep 2002 17:55:51 0000 1.41 +++ src/lisparit.d 7 Oct 2002 21:13:29 0000 1.43 @@ 980,8 +980,12 @@ # (EXP number), CLTL S. 203 LISPFUNN(exp,1) { check_number(STACK_0);  VALUES1(N_exp_N(STACK_0,true,&STACK_0));  skipSTACK(1); + if (complexp(STACK_0)) + pushSTACK(R_R_contagion_R(TheComplex(STACK_0)>c_real, + TheComplex(STACK_0)>c_imag)); + else pushSTACK(STACK_0); + VALUES1(N_exp_N(STACK_1,true,&STACK_0)); + skipSTACK(2); } LISPFUNN(expt,2) 