possible bug in bigfloat::expt



>>>>> "Barton" == Barton Willis <willisb at unk.edu> writes:

    Barton> The bigfloat expt function errors on (0.75b0 + 1.5b0*%i)^(%i/4):
    Barton> ? $ ./maxima-local
    Barton> ? Maxima 5.30post http://maxima.sourceforge.net using Lisp Clozure Common Lisp Version
    Barton> 1.9-r15764???? (WindowsX8632)
    Barton> ?(%i1) x : 0.75b0 + %i * 1.5b0$
    Barton> ?(%i2) a : %i/4$
    Barton> ?(%i3) to_lisp();
    Barton> ?MAXIMA> (bigfloat::expt (bigfloat::to (meval '$x)) (bigfloat::to (meval '$a)))
    Barton> ?Maxima encountered a Lisp error:? DIVISION-BY-ZERO detected performing LOG on (0.0)
    Barton> Changing a to? bfloat(%i/4) eliminates the problem:
    Barton> ? MAXIMA> (bigfloat::expt (bigfloat::to (meval '$x)) (bigfloat::to (meval '$a)))
    Barton> ???? +7.518905433525544b-1+9.773370293667246b-2*%i

It's a real bug in bigfloat::expt.  Or rather in
bigfloat::max-exponent of a CL complex number.  This replacement fixes
the issue:

(defmethod max-exponent ((x cl:complex))
  ;; What is the "size" of a complex number?
  (cl:ceiling (cl:log (cl:abs x) 2)))

I'll check in this fix soon.

Ray