|
|
|
last edited 17 years ago by kratt6 |
| 1 2 | ||
|
Editor: kratt6
Time: 2007/12/28 13:28:48 GMT-8 |
||
| Note: | ||
added:
From kratt6 Fri Dec 28 13:28:48 -0800 2007
From: kratt6
Date: Fri, 28 Dec 2007 13:28:48 -0800
Subject:
Message-ID: <20071228132848-0800@axiom-wiki.newsynthesis.org>
Category: Axiom Compiler => Axiom Library
OVERVIEW of bugs #6357:
URL:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=6357>
Summary: sqrt(-1/abs(x))-1/sqrt(-abs(x))=>0
Project: Axiom Computer Algebra System
Submitted by: kratt5
Submitted on: Tue 11/04/2003 at 13:26
Category: algebra
Severity: 5 - Average
Item Group: code bug
Status: transferred
Privacy: Public
Assigned to: billpage1
Originator Name: kratt5
Originator Email:
Open/Closed: Open
Release: CVS 3.11.2003
Reproducibility: None
Fixed Release:
Error message:
Example of code trigerring the bug:
(1) -> sqrt(-1/abs(x))-1/sqrt(-abs(x))
![]() | (1) |
should be:
2*%i/sqrt(x)
| (2) |
-------------------------------------------------------
Date: Fri 06/11/2004 at 10:43 By: Martin Rubey
patched by patch #3089
-------------------------------------------------------
Date: Tue 11/04/2003 at 14:43 By: Martin Rubey
The error occurs, because:
sqrt(1/x::Expression Integer)=>1/sqrt(x)
--- /home/rubey/axiom/mnt/linux/src/algebra/algfunc.spad 2004-05-21 18:51:30.000000000 +0200
+++ algfunc.spad 2004-05-25 13:39:19.000000000 +0200
@@ -431,9 +431,20 @@
hackroot(x, n) ==
-- one? n or one? x => x
(n = 1) or (x = 1) => x
+
+-- the following is FALSE! if x can be negative. Example: x=-1/2 would pass the
+-- test and give 1/(-2)^(1/n) ~= (-1/2)^(1/n)
-- (x ^= -1) and (one?(num := numer x) or (num = -1)) =>
- (x ^= -1) and (((num := numer x) = 1) or (num = -1)) =>
- inv hackroot((num * denom x)::F, n)
+-- (x ^= -1) and (((num := numer x) = 1) or (num = -1)) =>
+-- inv hackroot((num * denom x)::F, n)
+
+-- permissible when denom x is a positive number
+
+ (((dx := denom x) ^= 1) and
+ ((rx := retractIfCan(dx)@Union(Integer,"failed")) case Integer) and
+ positive?(rx))
+ => hackroot((numer x)::F, n)/hackroot(rx::Integer::F, n)
+
(x = -1) and n = 4 =>
((-1::F) ** (1::Q / 2::Q) + 1) / ((2::F) ** (1::Q / 2::Q))
kernel(oproot, [x, n::F])
Category: Axiom Compiler => Axiom Library