(a^b)^c currently simplifies to a^(b*c), which
is wrong for complex values.
Another related bug is '(%i^%e)^%i', which returns
'(%i^%i)^%e'.
These 2 bugs can be fixed by following patch.
I have not experienced any breakage from this
change.
diff --git a/src/algebra/combfunc.spad b/src/algebra/combfunc.spad
index 491a0b37..f254865f 100644
--- a/src/algebra/combfunc.spad
+++ b/src/algebra/combfunc.spad
@@ -160,21 +160,7 @@
else
ground?(x)
- x ^ y ==
--- -- Do some basic simplifications
--- is?(x, POWER) =>
--- args : List F := argument first kernels x
--- not(#args = 2) => error "Too many arguments to ^"
--- x1 := first args; x2 := second args -- x = x1^x2
--- number?(x1) and number?(y) =>
--- oppow [x1^y, x2]
--- oppow [x1, x2 * y]
--- -- Generic case
--- exp := isPower x
--- exp case Record(val : F, exponent : Z) =>
--- expr := exp::Record(val : F, exponent : Z)
--- oppow [expr.val, (expr.exponent)*y]
- oppow [x, y]
+ x ^ y == oppow [x, y]
belong? op == has?(op, COMB)
fourth l == third rest l
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.