Bugs item #2003386, was opened at 20080626 20:49
Message generated for change (Settings changed) made by crategus
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2003386&group_id=4933
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Lisp Core
Group: Includes proposed fix
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Raymond Toy (rtoy)
Assigned to: Nobody/Anonymous (nobody)
Summary: float(elliptic_kc(1)) causes Lisp error
Initial Comment:
float(elliptic_kc(1)) signals a Lisp error.
I think it should do something else. Perhaps return inf since elliptic_kc(x) > inf as x > 1, so elliptic_kc(1) might return inf instead of a noun form.

>Comment By: Dieter Kaiser (crategus)
Date: 20090521 21:31
Message:
A check for an argument 1 has been added to simp%elliptic_kc with revision
1.68 of ellipt.lisp.
elliptic_kc(1), elliptic_kc(1.0), and elliptic_kc(1.0b0) give a Maxima
error. The function is undefined. The suggested further simplifications for
some special values are not implemented.
Closing this bug report as fixed.
Dieter Kaiser

Comment By: Dieter Kaiser (crategus)
Date: 20090512 16:31
Message:
I think a check for an argument 1 for the function elliptic_kc should be
added before we call the numerical routines and a Maxima error should be
thrown. A more general result would be infinity. Because Maxima can not
handle infinities correctly, we do not return infinities in other cases
too.
In the following code the handling of infinities as an argument and the
handling of the number 1 for elliptic_ec has been added too.
Index: ellipt.lisp
===================================================================
RCS file: /cvsroot/maxima/maxima/src/ellipt.lisp,v
retrieving revision 1.67
diff u r1.67 ellipt.lisp
 ellipt.lisp 29 Mar 2009 06:24:51 0000 1.67
+++ ellipt.lisp 12 May 2009 14:22:49 0000
@@ 1947,13 +1947,23 @@
(declare (ignore yy))
(oneargcheck form)
(let ((m (simpcheck (cadr form) z)))
 (cond ((floatnumericalevalp m)
+ (cond ((onep1 m)
+ (merror
+ (intl:gettext "elliptic_kc: elliptic_kc(~:M) is undefined.")
+ m))
+ ((floatnumericalevalp m)
;; Numerically evaluate it
(elliptick (float m)))
((complexfloatnumericalevalp m)
(complexify (bigfloat::bfelliptick (complex ($realpart m)
($imagpart m)))))
((complexbigfloatnumericalevalp m)
(to (bigfloat::bfelliptick (bigfloat:to ($bfloat m)))))
+ ((or (member m '($inf $minf $infinity))
+ (member (mul 1 m) '($inf $minf))
+ (member (mul '$%i m) '($inf $minf))
+ (member (mul 1 '$%i m) '($inf $minf)))
+ ;; Handle infinities as an argument.
+ 0)
((zerop1 m)
'((mtimes) ((rat) 1 2) $%pi))
((alike1 m 1//2)
@@ 2002,6 +2012,11 @@
((zerop1 m)
'((mtimes) ((rat) 1 2) $%pi))
;; Some special cases we know about.
+ ((onep1 m) m)
+ ((or (eq m '$minf)
+ (eq (mul 1 m) '$inf))
+ '$inf)
+ ((eq m '$infinity) '$infinity)
(t
;; Nothing to do
(eqtest (list '(%elliptic_ec) m) form)))))
Success, CVS operation completed
Dieter Kaiser

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2003386&group_id=4933
