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

 
 

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

Submitted by:  Wim Lewis <wiml>
Submitted on:  Tue 12 Sep 2006 04:25:32 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: Aubrey Jaffer <jaffer>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 12 Oct 2009 04:28:20 AM UTCjafferAssigned toNone=>jaffer

    Back to the top


    Powered by Savane 3.1-cleanup