axiom-developer
[Top][All Lists]

## [Axiom-developer] [#69 sqrt(-1/abs(x))-1/sqrt(-abs(x))]

 From: kratt6 Subject: [Axiom-developer] [#69 sqrt(-1/abs(x))-1/sqrt(-abs(x))] Date: Tue, 18 Oct 2005 06:09:11 -0500

```Changes http://wiki.axiom-developer.org/69Sqrt1AbsX1SqrtAbsX/diff
--
Just for the archive, here is the patch::

18:51:30.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])
--