fyi, new issue with FriCAS<->sagemath interface

33 views
Skip to first unread message

Nasser M. Abbasi

unread,
Jan 19, 2020, 2:36:02 PM1/19/20
to FriCAS - computer algebra system
fyi;

I noticed many more FriCAS integrals tests fail in sagemath 8.9 due to still some interface issue between Sagemath and FriCAS. This affects result of FriCAS integration test.

Entered new bug here  https://trac.sagemath.org/ticket/29043 

"NotImplementedError: the translation of the FriCAS object sage2 to sage is not yet implemented"

If someone here knows anything about this or also works in sagemath may be they can help fix it. This should make FriCAS result better in the future
as I use sagemath to run FriCAS integration tests. 

I do not know how to do the test directly using FriCAS only, as I do not know FriCAS programming well enough
to implement script for it.

--Nasser



Martin R

unread,
Jan 19, 2020, 4:44:06 PM1/19/20
to FriCAS - computer algebra system
Actually, this is a proper bug in FriCAS, because the translation of your integral is

integrate((%i*a*tan(d*x + c) + a)*sec(d*x + c)^10, x)

(note the "%i" instead of "I", which is FriCAS' complex unity, "I" is just any other variable for FriCAS)

The result of the above integral is

   >> System error:
   arithmetic error DIVISION-BY-ZERO signalled
Operation was /, operands (2199023255552 0).

which cannot be handled by the sage FriCAS interface at the moment.

I believe a similar problem was reported before, but maybe this one is easier to fix.

Martin

Nasser M. Abbasi

unread,
Jan 19, 2020, 5:27:38 PM1/19/20
to FriCAS - computer algebra system
You are right. This is a bug in FriCAS itself. I did not change "I" to "%i" when I tried it before.

Should I then close the bug report I opened in sagemath about this in this case? Or if you like to close it yourself, that is fine also.

Thanks
--Nasser

oldk1331

unread,
Jan 19, 2020, 9:26:55 PM1/19/20
to fricas...@googlegroups.com
On 1/20/20 5:44 AM, 'Martin R' via FriCAS - computer algebra system wrote:
> Actually, this is a proper bug in FriCAS, because the translation of
> your integral is
>
> integrate((%i*a*tan(d*x + c) + a)*sec(d*x + c)^10, x)
>
> (note the "%i" instead of "I", which is FriCAS' complex unity, "I" is
> just any other variable for FriCAS)

Seems fixed in SVN repo? Though I'm not sure which commit fixed it.

(1) -> integrate((%i*a*tan(d*x + c) + a)*sec(d*x + c)^10, x)

(1)
%i d x + %i c 10 %i d x + %i c 8
64512 %i a (%e ) + 53760 %i a (%e )
+
%i d x + %i c 6 %i d x + %i c 4
30720 %i a (%e ) + 11520 %i a (%e )
+
%i d x + %i c 2
2560 %i a (%e ) + 256 %i a
/
%i d x + %i c 20 %i d x + %i c 18
315 d (%e ) + 3150 d (%e )
+
%i d x + %i c 16 %i d x + %i c 14
14175 d (%e ) + 37800 d (%e )
+
%i d x + %i c 12 %i d x + %i c 10
66150 d (%e ) + 79380 d (%e )
+
%i d x + %i c 8 %i d x + %i c 6
66150 d (%e ) + 37800 d (%e )
+
%i d x + %i c 4 %i d x + %i c 2
14175 d (%e ) + 3150 d (%e ) + 315 d
Type:
Union(Expression(Complex(Integer)),...)

Waldek Hebisch

unread,
Jan 20, 2020, 10:05:52 AM1/20/20
to fricas...@googlegroups.com
On Mon, Jan 20, 2020 at 10:26:50AM +0800, oldk1331 wrote:
> On 1/20/20 5:44 AM, 'Martin R' via FriCAS - computer algebra system wrote:
> > Actually, this is a proper bug in FriCAS, because the translation of
> > your integral is
> >
> > integrate((%i*a*tan(d*x + c) + a)*sec(d*x + c)^10, x)
> >
> > (note the "%i" instead of "I", which is FriCAS' complex unity, "I" is
> > just any other variable for FriCAS)
>
> Seems fixed in SVN repo? Though I'm not sure which commit fixed it.

2019-07-18 Waldek Hebisch <heb...@math.uni.wroc.pl>

* src/algebra/efstruc.spad, src/algebra/gaussian.spad,
src/algebra/integrat.spad: Avoid unsound use of Complex
src/algebra/Makefile.in: Adjust

is intened to fix exactly this. More work in direction is needed,
in particular we should get rid of 'real' in 'integrate', but
worst problems are gone.

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