Nasser M. Abbasi wrote:
> 
> On Saturday, January 27, 2018 at 10:29:22 PM UTC-6, oldk1331 wrote:
> >
> > On Sun, Jan 28, 2018 at 12:22 PM, 'Nasser M. Abbasi' via FriCAS - 
> > computer algebra system <[email protected] <javascript:>> wrote: 
> > > I could not find, or know what to search for, to turn on tracing in 
> > Fricas. 
> > > 
> > > For example, Fricas hangs on this 
> > > 
> > >        integrate((4*x^4+3)^(1/4)/x^2,x) 
> > > 
> > > And was just curious why that is. 
> >
> > First, if you use "setSimplifyDenomsFlag(true)", 
> > then this integral returns in 2 seconds. 
> >
> >
> The problem is that I do not know when to turn the above on or off.
> 
> If I do "setSimplifyDenomsFlag(true)" at start of the script, then now this 
> integral hangs
> 
>        integrate((A*x+B)/(5*x^2-18*x+17)/(10*x^2-22*x+13)^(1/2),x)
> 
> But  integrate((4*x^4+3)^(1/4)/x^2,x)  does not hang (it takes about 20 
> seconds
> to finish on my Linux, but I am running VBox).
> 
> And If I do "setSimplifyDenomsFlag(false)" then now 
> 
>    integrate((A*x+B)/(5*x^2-18*x+17)/(10*x^2-22*x+13)^(1/2),x) 
> 
> does not hang any more, but integrate((4*x^4+3)^(1/4)/x^2,x)  hangs.
> 
> How is a user supposed to know what to set it to? Given I have no idea
> what this flag does also. I have to decide at top of the script what to set 
> it to.

If it were easy FriCAS would do this automatically.

setSimplifyDenomsFlag(true)

tells FriCAS to remove irrationalities from denominators.  For example:

(1) -> (A*x+B)/(5*x^2-18*x+17)/(10*x^2-22*x+13)^(1/2)

                        A x + B
   (1)  --------------------------------------
                           +-----------------+
            2              |    2
        (5 x  - 18 x + 17)\|10 x  - 22 x + 13
                                                    Type: Expression(Integer)
(2) -> setSimplifyDenomsFlag(true)

   (2)  false
                                                                Type: Boolean
(3) -> (A*x+B)/(5*x^2-18*x+17)/(10*x^2-22*x+13)^(1/2)

                      +-----------------+
                      |    2
            (A x + B)\|10 x  - 22 x + 13
   (3)  -------------------------------------
            4        3        2
        50 x  - 290 x  + 631 x  - 608 x + 221
                                                    Type: Expression(Integer)

Removing irrationalities from denominators can make expressions
larger, but OTOH once irrationalities are only in numerator
FriCAS can cancel common factors which can make expressions
much smaller.  On average, integration seem to work better
with "setSimplifyDenomsFlag(true)", but since you get different
expressions integrator can take different path which changes
timing.  In some cases process of removing irrationalities from
denominators can take long time.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to