bugJACAL symbolic mathematics program - Bugs: bug #17709, Odd failure in computing expr^1/2

 
 

bug #17709: Odd failure in computing expr^1/2

Submitter:  Wim Lewis <wiml>
Submitted:  Tue 12 Sep 2006 04:25:32 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  jaffer
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 12 Sep 2006 04:25:32 PM UTC, original submission:  

Some expressions cause a Scheme error when raised to a power of 1/2. Here's an example (using the current CVS version of JACAL, but 1b6 behaves the same way). Oddly, if the denominator is not a square, then there's no problem (try changing the 64 to a 63 in the below example).

> (math)

type qed; to return to scheme, type help; for help.
e0 : ( 17 + 11 * 2^(1/2) ) / 64;

             1/2
    17 + 11 2
e0: ------------
         64

e1 : e0 ^ (1/2);

;ERROR: "poly.scm": cddr: Wrong type in arg1 -8
; in expression: (#@cddr #@v)
; in scope:
;   m
;   r
;   (u v)  procedure univ:pdiv
;   "poly.scm", line 294:
;STACK TRACE
1; (#@let* ((r (#@list->vector (#@cdr #@u))) (m (#@length (#@cddr ...
2; (#@let* ((var (#@car #@extpoly)) (poly (#@poly:promote #@var # ...
3; (#@do ((oldv "foo" (car v)) (v (#@poly:find-var-if? (#@rat:den ...
4; ((#@if (#@expl? #@p) (#@set! #@p (#@expl->impl #@p))) (#@expr: ...
5; (#@let* ((ans (#@normalize1 #@x)))  (#@cond ((#@and #@math:pha ...
6; ((#@cond ((#@symbol? #@label) (#@if (#@eq? #@label #@sexp) (un ...
7; (#@let* ((var #@newlabelsym) (val (#@define-label #@var #@obj  ...
8; (#@define ((cip (#@current-input-port)) (obj #f))  (#@set! #@m ...
9; (#@do ((math:prompt #f #@math:prompt) (var-news-saved #@var-ne ...
10; ((#@set-handlers!) (#@for-each (#@lambda (file) (batch (if (s ...
11; (#@math)

Wim Lewis <wiml>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jaffer (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-10-12 jaffer Assigned toNone jaffer

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code