Opened 3 years ago

Closed 15 months ago

#28630 closed defect (fixed)

internal function of fricas appearing

Reported by: Thierry Monteil Owned by:
Priority: major Milestone: sage-9.4
Component: symbolics Keywords: FriCAS
Cc: RalfHemmecke, Wilfried Huss, Ralf Stephan, Frédéric Chapoton, Martin Rubey Merged in:
Authors: Martin Rubey Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 4f3e1b4 (Commits, GitHub, GitLab) Commit: 4f3e1b44d6d9bda955f782ba515221e5372db897
Dependencies: #32049 Stopgaps:

Status badges

Description

As reported on this ask question, we have:

sage: f = polylog(3, x)
sage: f.integral(x, algorithm='fricas')
-x*%iint(x, -log(-x + 1)/x) - (x - 1)*log(-x + 1) + x*polylog(3, x) + x

So, fricas produces something that is ill-interpreted as some %iint symbolic function.

Note that maxima produces the following answer:

sage: f.integral(x, algorithm='maxima')
-x*dilog(x) - (x - 1)*log(-x + 1) + x*polylog(3, x) + x

Change History (24)

comment:1 Changed 3 years ago by Thierry Monteil

Cc: RalfHemmecke Wilfried Huss Ralf Stephan Frédéric Chapoton added

comment:2 Changed 3 years ago by Frédéric Chapoton

Keywords: FriCAS added

comment:3 Changed 3 years ago by Frédéric Chapoton

Cc: Martin Rubey added

comment:4 Changed 3 years ago by Frédéric Chapoton

This seems to be some kind of bug in Fricas:

sage: f = fricas(polylog(3,x))
sage: f.integrate(x)
              log(- x + 1)
- x %iint(x,- ------------) + x polylog(3,x) + (- x + 1)log(- x + 1) + x
                    x

And the first term can be differentiated (inside Fricas) correctly.

comment:5 Changed 3 years ago by Martin Rubey

More a reminder to myself: SageMath's dilog(x) is FriCAS' dilog(1-x). This is properly reflected in sage.functions.log.py, in class Function_dilog.

So FriCAS should simplify %iint(x, -log(1-x)/x)) to FriCAS dilog(1-x).

comment:6 Changed 3 years ago by Martin Rubey

Report Upstream: N/AReported upstream. No feedback yet.

comment:7 Changed 3 years ago by Martin Rubey

Report Upstream: Reported upstream. No feedback yet.Reported upstream. Developers acknowledge bug.

comment:8 Changed 3 years ago by Erik Bray

Milestone: sage-9.0sage-9.1

Ticket retargeted after milestone closed

comment:9 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.1sage-9.2

Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.

comment:10 Changed 2 years ago by Matthias Köppe

Still the same in 9.2.beta10 after the update of FriCAS to 1.3.6 in #27309

comment:11 Changed 2 years ago by Matthias Köppe

Milestone: sage-9.2sage-9.3

comment:12 Changed 21 months ago by Dima Pasechnik

Fricas devs say that %iint should have never appeared, it's a Fricas bug. So that's something for them to fix.

comment:13 Changed 18 months ago by Matthias Köppe

Milestone: sage-9.3sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.

comment:14 Changed 16 months ago by Martin Rubey

Branch: u/mantepse/wrong_conversion_from_fricas

comment:15 Changed 16 months ago by Martin Rubey

Authors: Martin Rubey
Commit: 0bf981c8b8b7dd08151f85ef7eb3f83f0c40b90b
Report Upstream: Reported upstream. Developers acknowledge bug.Fixed upstream, but not in a stable release.
Status: newneeds_review
Summary: Wrong conversion from fricasinternal function of fricas appearing

New commits:

f18b821add doctest
0bf981cprovide doctest

comment:16 Changed 16 months ago by Frédéric Chapoton

First one does not work for me on 9.4.b0. We must wait for Fricas release containing the fix.

comment:17 Changed 16 months ago by Martin Rubey

Dependencies: #32049

comment:18 Changed 15 months ago by git

Commit: 0bf981c8b8b7dd08151f85ef7eb3f83f0c40b90b322dfb7fb97ceda6a65e299394ffb4623213f3a0

Branch pushed to git repo; I updated commit sha1. New commits:

322dfb7Merge branch 'develop' into t/28630/wrong_conversion_from_fricas

comment:19 Changed 15 months ago by Dima Pasechnik

this gives me

File "src/sage/symbolic/integration/external.py", line 418, in sage.symbolic.integration.external.fricas_integrator
Failed example:
    integrate(f, x, algorithm="fricas")                               # optional - fricas
Expected:
    1/315*(64512*I*a*e^(10*I*d*x + 10*I*c) + 53760*I*a*e^(8*I*d*x + 8*I*c) + 30720*I*a*e^(6*I*d*x + 6*I*c) + 11520*I*a*e^(4*I*d*x + 4*I*c) + 2560*I*a*e^(2*I*d*x + 2*I*c) + 256*I*a)/(d*e^(20*I*d*x + 20*I*c) + 10*d*e^(18*I*d*x + 18*I*c) + 45*d*e^(16*I*d*x + 16*I*c) + 120*d*e^(14*I*d*x + 14*I*c) + 210*d*e^(12*I*d*x + 12*I*c) + 252*d*e^(10*I*d*x + 10*I*c) + 210*d*e^(8*I*d*x + 8*I*c) + 120*d*e^(6*I*d*x + 6*I*c) + 45*d*e^(4*I*d*x + 4*I*c) + 10*d*e^(2*I*d*x + 2*I*c) + d)
Got:
    -256/315*(-252*I*a*e^(10*I*d*x + 10*I*c) - 210*I*a*e^(8*I*d*x + 8*I*c) - 120*I*a*e^(6*I*d*x + 6*I*c) - 45*I*a*e^(4*I*d*x + 4*I*c) - 10*I*a*e^(2*I*d*x + 2*I*c) - I*a)/(d*e^(20*I*d*x + 20*I*c) + 10*d*e^(18*I*d*x + 18*I*c) + 45*d*e^(16*I*d*x + 16*I*c) + 120*d*e^(14*I*d*x + 14*I*c) + 210*d*e^(12*I*d*x + 12*I*c) + 252*d*e^(10*I*d*x + 10*I*c) + 210*d*e^(8*I*d*x + 8*I*c) + 120*d*e^(6*I*d*x + 6*I*c) + 45*d*e^(4*I*d*x + 4*I*c) + 10*d*e^(2*I*d*x + 2*I*c) + d)
  • a different formatting of the same expression.

comment:20 Changed 15 months ago by Dima Pasechnik

Status: needs_reviewneeds_work

how about making this doctest robust:

        sage: ii=integrate(f, x, algorithm="fricas")                    # optional - fricas
        sage: ii==1/315*(64512*I*a*e^(10*I*d*x + 10*I*c) +<the rest...> # optional - fricas
        True

comment:21 Changed 15 months ago by Dima Pasechnik

Branch: u/mantepse/wrong_conversion_from_fricasu/dimpase/packages/fricas/wrong_conversion_from_fricas
Commit: 322dfb7fb97ceda6a65e299394ffb4623213f3a04f3e1b44d6d9bda955f782ba515221e5372db897
Reviewers: Dima Pasechnik
Status: needs_workpositive_review

OK, like this


New commits:

4f3e1b4make the test robust

comment:22 Changed 15 months ago by Dima Pasechnik

Report Upstream: Fixed upstream, but not in a stable release.N/A

comment:23 Changed 15 months ago by Martin Rubey

The final commit subsumes #29043, which I therefore set to duplicate.

comment:24 Changed 15 months ago by Volker Braun

Branch: u/dimpase/packages/fricas/wrong_conversion_from_fricas4f3e1b44d6d9bda955f782ba515221e5372db897
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.