geovas01 / mathpiper

2 stars 1 forks source link

FWatom as result of Factor #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Factor sometimes produces a weird result with FWatom(). I think it would be
better to return the original input as a result without wrapping it in
FWatom(), e.g.

In> Factor( Sqrt(61/10-Sqrt(36/5)) )
Result: FWatom(Sqrt(61/10-Sqrt(36/5)))

should give
Result: Sqrt(61/10-Sqrt(36/5))

Original issue reported on code.google.com by mho...@gmail.com on 17 Dec 2009 at 11:49

GoogleCodeExporter commented 9 years ago

Original comment by ted.ko...@gmail.com on 19 Dec 2009 at 2:58

GoogleCodeExporter commented 9 years ago
Sherm,

This can be fixed in Factor.mrw with the following code:

10 # Factor(p_CanBeUni) <-- 
[
    Local(factorsResult, result);

    factorsResult := Factors(p);

    If(IsList(factorsResult), result := FW(Factors(p)), result := p);

    result;
];

%/mathpiper

Do you see any problems with this proposed solution?

Original comment by ted.ko...@gmail.com on 19 Dec 2009 at 8:33

GoogleCodeExporter commented 9 years ago
Ted:

I was thinking along similar lines yesterday.  We (you and I) have never been 
happy
with this "FW" notation, but have never been able to come up with a better 
name.  I
still couldn't find one yesterday.  But it seems clear to me that a Factor() 
output
should NEVER be allowed to return something with a "FW" or "FWatom" in it.  

Your proposed fix is on the right track.  I'll pursue it a little more, to see 
if it
can be made air-tight, so as NEVER to return one of these darn things.

Original comment by sherm...@gmail.com on 19 Dec 2009 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by ted.ko...@gmail.com on 28 Dec 2009 at 7:35

GoogleCodeExporter commented 9 years ago
   With respect to *numbers*, this problem is fixed in the new function xFactor()
introduced with version .77 of MathPiper.
   When the input is a *polynomial*, the problem sometimes still persists.  Work is
continuing to solve this problem completely.

Original comment by sherm...@gmail.com on 30 Dec 2009 at 6:21

GoogleCodeExporter commented 9 years ago

Original comment by sherm...@gmail.com on 31 Jan 2010 at 9:17