inconsistency Manip.spad and 'Float has PolynomialFactorizationExplicit'

5 views
Skip to first unread message

eric ten cate

unread,
Apr 27, 2026, 10:09:01 AM (4 days ago) Apr 27
to FriCAS - computer algebra system
Hello Fricas developers,

I am relative new to Fricas. I think there is a small inconsistency in manip.spad.
The 'if-then-else' around rootFactor in the 'Exports' is inconsistent with the if-then-else in 'Implementation', see below.

Can someone tell me why Float does not have PolynomialFactorizationExplicit?
'Float has PolynomialFactorizationExplicit' results in false. Is it not implemented or doesn't Float have the properties?

Thanks,
eric.

Exports ==> with
....
if R has UniqueFactorizationDomain and R has CharacteristicZero
        and R has PolynomialFactorizationExplicit then
            rootFactor : F -> F
              ++ rootFactor(f) transforms every radical of the form
              ++ \spad{(a1*...*am)^(1/n)} appearing in f into
              ++ \spad{a^(1/n)*...*am^(1/n)}.
              ++ This transformation is not in general valid for all
              ++ complex numbers \spad{a} and b.
....

Implementation ==> add
....
   if R has Join(Comparable, GcdDomain, RetractableTo Integer)
     and F has FunctionSpace(R) then
....
      if R has UniqueFactorizationDomain and R has CharacteristicZero
        and R has PolynomialFactorizationExplicit then
...
         rootFactor x == ...

Waldek Hebisch

unread,
Apr 27, 2026, 3:09:56 PM (4 days ago) Apr 27
to fricas...@googlegroups.com
On Mon, Apr 27, 2026 at 06:21:22AM -0700, eric ten cate wrote:
> Hello Fricas developers,
>
> I am relative new to Fricas. I think there is a small inconsistency in
> manip.spad.
> The 'if-then-else' around rootFactor in the 'Exports' is inconsistent with
> the if-then-else in 'Implementation', see below.

Yes, this is limitation of current implementation, not reflected
in 'Exports' part.

> Can someone tell me why Float does not have PolynomialFactorizationExplicit?
> 'Float has PolynomialFactorizationExplicit' results in false. Is it not
> implemented or doesn't Float have the properties?

It is a mixture of both. First, needed operations are not implemented
for Float. Second, while theoretically well defined the operations
are numerically quite unstable. One could try do define more
appropriate version but it is not clear if the results would be
good.

In general, a lot of algorithms that FriCAS use are "generic",
that is could be used over many domains. But due to approximative
nature of Float and numerical instability using them with Float-s
usualy does not lead to satisfactory result. So in FriCAS there
is tendency to disallow such operations in type rules.
Otherwise users would try them and complain of nonsense results.

--
Waldek Hebisch

eric ten cate

unread,
Apr 28, 2026, 2:25:54 PM (3 days ago) Apr 28
to fricas...@googlegroups.com

Thank you for the fast reply. Last question, is there a type real besides its representation Float?
I used Expression Float for representing a velocity (waterflow).
Thanks,
Eric 

Op ma 27 apr 2026, 21:09 schreef Waldek Hebisch <de...@fricas.org>:
On Mon, Apr 27, 2026 at 06:21:22AM -0700, eric ten cate wrote:
> Hello Fricas developers,
>
> I am relative new to Fricas. I think there is a small inconsistency in
> manip.spad.
> The 'if-then-else' around rootFactor r in the 'Exports' is inconsistent with
> the if-then-else in 'Implementation', see below.

Yes, this is limitation of current implementation, not reflected
in 'Exports' part.

> Can someone tell me why Float does not have PolynomialFactorizationExplicit?
> 'Float has PolynomialFactorizationExplicit' results in false. Is it not
> implemented or doesn't Float have the properties?

It is a mixture of both.  First, needed operations are not implemented
for Float.  Second, while theoretically well defined the operations
are numerically quite unstable.  One could try do define more
appropriate version but it is not clear if the results would be
good.

In general, a lot of algorithms that FriCAS use are "generic",
that is could be used over many domains.  But due to approximative
nature of Float and numerical instability using them with Float-s
usualy does not lead to satisfactory result.  So in FriCAS there
is tendency to disallow such operations in type rules.
Otherwise users would try them and complain of nonsense results.

--
                              Waldek Hebisch

--
You received this message because you are subscribed to a topic in the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fricas-devel/CiHvGg55M3w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fricas-devel...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/ae-0geG_LR3BP2Kc%40fricas.org.

Waldek Hebisch

unread,
Apr 28, 2026, 2:47:27 PM (3 days ago) Apr 28
to fricas...@googlegroups.com
On Tue, Apr 28, 2026 at 08:03:52PM +0200, eric ten cate wrote:
> Thank you for the fast reply. Last question, is there a type real besides
> its representation Float?
> I used Expression Float for representing a velocity (waterflow).
> Thanks,

It is not clear to me what you want to know. Float is arbitrary
precision and has purely software implementation. If you want
hardware floating point use DoubleFloat.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages