when to use setSimplifyDenomsFlag(true)?

45 views
Skip to first unread message

Nasser M. Abbasi

unread,
Oct 31, 2019, 8:05:00 PM10/31/19
to FriCAS - computer algebra system
In running CAS integration tests https://www.12000.org/my_notes/CAS_integration_tests/index.htm, I noticed some Fricas tests fail because the build sets the flag setSimplifyDenomsFlag(true) at the start for all integrals.

But now I noticed some fail (due to time out of 3 minutes) when this flag is set. When I do not set this flag, FriCAS can integrate it. So it should be pass.

But I do not know now if I should this flag to true or not.  Here is an example

setSimplifyDenomsFlag(true)
integrate((b*tan(d*x + c)^3)^(3/2),x)

  hangs.

But

setSimplifyDenomsFlag(false)
integrate((b*tan(d*x + c)^3)^(3/2),x) 

Returns right away with answer.

Since there are 10's of thousands of integrals, how to decide which to option to use? 
Should I use false all the time?  Will using false make some that pass now when using true fail?

Any suggestions what to do? 

Thanks
--Nasser

Nasser M. Abbasi

unread,
Oct 31, 2019, 9:02:51 PM10/31/19
to FriCAS - computer algebra system
fyi, I just run one test file with the  setSimplifyDenomsFlag(true) and then with setSimplifyDenomsFlag(false)

When the flag is true Fricas solved 136 integrals in that file. When flag is false, Fricas solved 176 integrals.
The reason is it timed out on those it did not solve when the flag is true.

I did not check if there is any that passed when flag is true has now failed when flag is false.

But from this quick test, it should net effect is positive. (even though some result is now larger).

Should I then re-run all CAS integrations tests for Fricas with this flag false based on the above? This will improve the pass/fail result for Fricas at the cost of some results being larger than before.

--Nasser

Waldek Hebisch

unread,
Nov 3, 2019, 2:07:28 PM11/3/19
to fricas...@googlegroups.com
Can you say which file?
>
> I did not check if there is any that passed when flag is true has now
> failed when flag is false.
>
> But from this quick test, it should net effect is positive. (even though
> some result is now larger).
>
> Should I then re-run all CAS integrations tests for Fricas with this flag
> false based on the above? This will improve the pass/fail result for Fricas
> at the cost of some results being larger than before.

IME Fricas could do more integrals when this flag is true. But Ruby
testsuite is quite biased, so result may be different. Or maybe
you just chose file which prefers false (again, Rubi orgarnizes
tests into familes, so there is string correlation inside typical
files).

BTW: To minimize effects of timeout you can try tests that
Rubi can do in 1 step, they are smaller and for FriCAS should
give allmost the same coverage. AFAICS the other mostly add
"capacity" testing.

--
Waldek Hebisch

Nasser M. Abbasi

unread,
Nov 3, 2019, 3:33:57 PM11/3/19
to FriCAS - computer algebra system

Integrals numbers 31,32,33... and more, all time out when using true flag, but give result right away when using false flag.

(b*tan(c+d*x)^3)^(3/2)

(b*tan(c+d*x)^3)^(1/2)

1/(b*tan(c+d*x)^3)^(1/2)

etc...

I am rerunning about 50,000 integrals now which were completed before using flag true, rerunning them with flag=FALSE to see which value gives better pass result. 

It has been running for 4 days now and almost done. Will update here with what I find.

If Fricas gives higher pass score with false flag, will keep that as I am not sure now which flag gives better result and I do not know how to decide in the code which one to use.

I could always do this: If Fricas times out with TRUE flag, re-run the integral again with the flag FALSE.  But this will complicate things, so it is much simpler to stick with one value. 

I also have to run all files for all CAS'es. I can't really pick which file to run for each CAS since the build script just runs over the 213 files one by one for each CAS system and same number of files and integrals have to match for each CAS.

Thanks
--Nasser

Nasser M. Abbasi

unread,
Nov 4, 2019, 1:03:50 AM11/4/19
to FriCAS - computer algebra system
This is the result running 46,886 integrals with Fricas 1.3.5 with setSimplifyDenomsFlag(true) and with setSimplifyDenomsFlag(false) (default)

flag TRUE:  passed 67.32%
flag FALSE: passed 67.61%

This translates to 134 more integrals which passed when using FALSE vs. TRUE.

Since this difference is very small, I think will keep the flag set to TRUE since this is what last build used and since TRUE seems to give smaller output.

But I think FriCAS should not really hang on some integrals when using the TRUE flag. May be someone could look into this and see why this happens.

--Nasser

Waldek Hebisch

unread,
Nov 7, 2019, 10:08:08 AM11/7/19
to fricas...@googlegroups.com
Nasser M. Abbasi wrote:
>
> On Sunday, November 3, 2019 at 2:33:57 PM UTC-6, Nasser M. Abbasi wrote:
> >
> > On Sunday, November 3, 2019 at 1:07:28 PM UTC-6, Waldek Hebisch wrote:
> >>
> >> Can you say which file?
> >> >
> >
> > The file is 4.3.0-a_trg-^m-b_tan-^n.txt
> > <https://www.12000.org/tmp/11032019/4.3.0-a_trg-%5em-b_tan-%5en.txt>
> >
> > Integrals numbers 31,32,33... and more, all time out when using true flag,
> > but give result right away when using false flag.
> >
> > (b*tan(c+d*x)^3)^(3/2)
> >

That one takes about 630 seconds on a fast machine.

> > (b*tan(c+d*x)^3)^(1/2)
> >
> > 1/(b*tan(c+d*x)^3)^(1/2)
> >
> > etc...
<snip>
> But I think FriCAS should not really hang on some integrals when using the
> TRUE flag. May be someone could look into this and see why this happens.

I am not aware of any cases when FriCAS just hangs. Some cases
need a lot of time, some run out of memory after long time.
It is possible that some long running cases are due to bugs,
however there are legitimate cases that need very long time.

In fact, setSimplifyDenomsFlag was introduced because it gives
_dramatic_ speedup in some cases, at cost of limited slowdown
of other cases. For example, setSimplifyDenomsFlag(true)
may reduce time from months to few seconds.

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