Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1037 factor involving sqrt(2) fails, but gfactor works (?!)

open
nobody
3
2006-12-04
2006-12-04
Stavros Macrakis
No

fex: sqrt(2)*n - n + sqrt(2) - 2 $

Neither one of:

factor(fex)
factor(fex),algebraic:true

factors fex.

but both of:

gfactor(fex)
factor(fex,q^3-7) // Any polynom will do

do factor correctly into

(sqrt(2)-1)*(n-sqrt(2))

This behavior difference is not documented, and is confusing.

Of course, the semantics are not entirely clear, and anyway the current code doesn't work for all cases you'd like, e.g.

gfactor(expand(
(x-sqrt(2)+sqrt(3))*(x+sqrt(2)*3+sqrt(3))
))

doesn't factor, though

factor(expand( // not even gfactor
(x + 7 sqrt(2)) (x - sqrt(3))
))

does.

-s

Discussion

    • labels: --> Lisp Core - Polynomials
    • priority: 5 --> 3