Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Baffling behavior of Factor[] in versions 5 and 6 -- a bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82375] Baffling behavior of Factor[] in versions 5 and 6 -- a bug?
  • From: sbonano at inp.demokritos.gr
  • Date: Thu, 18 Oct 2007 05:05:23 -0400 (EDT)

Hello,

I have encountered the following strange behavior in applying Factor to
expressions that are already factored:

expr[n_]:=(1 + CC(t^2 - x^2 - y^2))^n(1 - CC(u^2 + v^2 + w^2))^n

timeTest[n_]:= Transpose[{Factor[expr[n]]// Timing,
Factor[expr[-n]]//Timing}][[1]]


timeTest[3]
{0. Second, 1.15 Second}

timeTest[4]
{0.01 Second, 14.64 Second}

Factor takes an unacceptably long time when n is negative (try
timeTest[5]!). This behavior did not exist in versions <5. I consider it a
bug.

The following modification of Factor behaves as one would expect

myFactor[x_]:=If[Head[x] === Times, Times@@Factor[List@@x], Factor[x]]

Shouldn't such a line be part of the definition of Factor, when no
Extensions have been specified?

S. Bonanos
http://www.inp.demokritos.gr/~sbonano/

PS The factors in expr are the conformal factors of two constant-curvature
3-dimensional spaces (coordinates {t,x,y} and {u,v,w} respectively). I
discovered this bug when my RGTC program
(http://www.inp.demokritos.gr/~sbonano/RGTC/) was unable to calculate the
inverse of the 6-dimensional metric which is the direct sum of these two
3-d metrics -- it got stuck factoring expr[-6]!
















-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



  • Prev by Date: Re: Mathematica 6.01 and openSUSE 10.3
  • Next by Date: Re: Mathematica 6.01 and openSUSE 10.3
  • Previous by thread: Debugging with v6
  • Next by thread: Re: Baffling behavior of Factor[] in versions 5 and 6 --