login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for #253 factor returns wrong result revision 1 of 3

1 2 3
Editor: page
Time: 2009/10/18 23:47:58 GMT-7
Note:

changed:
-
I just ran across the following astonishing bug:

\begin{axiom}
s :=-x^3+1/6*(-2*sqrt(6)+2*sqrt(3)+3*sqrt(2))*x^2+1/6*((sqrt(3)+sqrt(2))*sqrt(6)-2*sqrt(2)*sqrt(3))*x-sqrt(2)*sqrt(3)*sqrt(6)/6
factor s
\end{axiom}

There are several things to notice, in fact:

- The factorisation is nonsense

- I think that AlgebraicNumber should be able to simplify $\sqrt{2}\sqrt{3}\sqrt{6}$ to $\sqrt{36}$

- shouldn't $sqrt{36}$ be simplified to $6$? Usually, 'sqrt' denotes the positive square root.

Martin

From kratt6 Wed Jan 25 04:50:05 -0600 2006
From: kratt6
Date: Wed, 25 Jan 2006 04:50:05 -0600
Subject: 
Message-ID: <20060125045005-0600@wiki.axiom-developer.org>

In fact, the problem shows already with

\begin{axiom}
s :=x^2-sqrt(2)*sqrt(3)*sqrt(6)
\end{axiom}

and it seems to occur in  'InnerAlgFactor'::

  !\begin{axiom}
  )tr InnerAlgFactor  )ma
  factor(s)
  \end{axiom}


Submitted by : (unknown) at: 2007-11-17T22:15:40-08:00 (17 years ago)
Name :
Axiom Version :
Category : Severity : Status :
Optional subject :  
Optional comment :

I just ran across the following astonishing bug:

fricas
s :=-x^3+1/6*(-2*sqrt(6)+2*sqrt(3)+3*sqrt(2))*x^2+1/6*((sqrt(3)+sqrt(2))*sqrt(6)-2*sqrt(2)*sqrt(3))*x-sqrt(2)*sqrt(3)*sqrt(6)/6

\label{eq1}\begin{array}{@{}l}
\displaystyle
-{{x}^{3}}+{{{-{2 \ {\sqrt{6}}}+{2 \ {\sqrt{3}}}+{3 \ {\sqrt{2}}}}\over 6}\ {{x}^{2}}}+ 
\
\
\displaystyle
{{{{{\left({\sqrt{3}}+{\sqrt{2}}\right)}\ {\sqrt{6}}}-{2 \ {\sqrt{2}}\ {\sqrt{3}}}}\over 6}\  x}-{{{\sqrt{2}}\ {\sqrt{3}}\ {\sqrt{6}}}\over 6}
(1)
Type: Polynomial(AlgebraicNumber?)
fricas
factor s

\label{eq2}- 1(2)
Type: Factored(Polynomial(AlgebraicNumber?))

There are several things to notice, in fact:

  • The factorisation is nonsense
  • I think that AlgebraicNumber? should be able to simplify \sqrt{2}\sqrt{3}\sqrt{6} to \sqrt{36}
  • shouldn't sqrt{36} be simplified to 6? Usually, sqrt denotes the positive square root.

Martin

In fact, the problem shows already with

fricas
s :=x^2-sqrt(2)*sqrt(3)*sqrt(6)

\label{eq3}{{x}^{2}}-{{\sqrt{2}}\ {\sqrt{3}}\ {\sqrt{6}}}(3)
Type: Polynomial(AlgebraicNumber?)

and it seems to occur in 'InnerAlgFactor?':

  \begin{axiom}
  )tr InnerAlgFactor  )ma
  factor(s)
  \end{axiom}