Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent handling of exact function arguments #22142

Closed
dkrenn opened this issue Jan 5, 2017 · 22 comments
Closed

Inconsistent handling of exact function arguments #22142

dkrenn opened this issue Jan 5, 2017 · 22 comments

Comments

@dkrenn
Copy link
Contributor

dkrenn commented Jan 5, 2017

At the moment we have

sage: polylog(QQbar(sqrt(2)),3)
polylog(1.414213562373095?, 3)

and

sage: log(QQbar(sqrt(2)))
0.346573590279973
sage: type(_)
<type 'sage.rings.real_mpfr.RealNumber'>

So the logarithm of an exact value loses the exactness.

I would expect a symbolic expression

sage: log(QQbar(sqrt(2)))
log(1.414213562373095?)

where the argument is the symbolic encapsulation of QQbar(sqrt(2)) (for the same reason why the logarithm of the integer 2 becomes the symbolic log(2).

This is fixed for all GinacFunctions in Pynac git master. The ticket should doctest them in the resp. files under sage/functions.

Depends on #22219

CC: @behackl @cheuberg

Component: algebra

Keywords: Pynac

Author: Daniel Krenn

Branch/Commit: c252b4d

Reviewer: Ralf Stephan

Issue created by migration from https://trac.sagemath.org/ticket/22142

@dkrenn dkrenn added this to the sage-7.5 milestone Jan 5, 2017
@rwst
Copy link

rwst commented Jan 7, 2017

comment:1

I have a Pynac patch that does this:

sage: log(QQbar(sqrt(2)))
log(1.414213562373095?)
sage: log(QQbar(sqrt(2))*1.)
0.346573590279973

However, the question is raised if you don't want this for all functions, and if you do, if we want to hold all functions with exact arguments (except where we have a simplified representation, i.e., a closed form that is simpler than the function expression).

EDIT: or if not all functions, then which?

@rwst
Copy link

rwst commented Jan 7, 2017

comment:2

BTW polylog does it already, so this is clearly an inconsistency within Pynac:

sage: polylog(QQbar(sqrt(2)),3)
polylog(1.414213562373095?, 3)

@rwst
Copy link

rwst commented Jan 7, 2017

Changed keywords from none to Pynac

@rwst

This comment has been minimized.

@rwst rwst changed the title log of algebraic number (QQbar element) gets inprecise Inconsistent handling of exact function arguments Jan 7, 2017
@rwst

This comment has been minimized.

@rwst
Copy link

rwst commented Jan 7, 2017

Dependencies: pynac-0.7.4

@dkrenn
Copy link
Contributor Author

dkrenn commented Jan 8, 2017

comment:4

Replying to @rwst:

I have a Pynac patch that does this:

sage: log(QQbar(sqrt(2)))
log(1.414213562373095?)
sage: log(QQbar(sqrt(2))*1.)
0.346573590279973

Good. Thanks :)

However, the question is raised if you don't want this for all functions, and if you do, if we want to hold all functions with exact arguments (except where we have a simplified representation, i.e., a closed form that is simpler than the function expression).

EDIT: or if not all functions, then which?

IMHO yes, we want this for all symbolic functions, as no exact value should get inexact. What would be the drawbacks?

@rwst
Copy link

rwst commented Jan 8, 2017

comment:5

Replying to @dkrenn:

IMHO yes, we want this for all symbolic functions, as no exact value should get inexact. What would be the drawbacks?

No drawbacks. I just needed confirmation.

@cheuberg
Copy link
Contributor

cheuberg commented Jan 9, 2017

comment:6

For completeness, I mention the sage-devel thread on gamma(QQbar(...))

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 4, 2017

Branch: u/dkrenn/t/22142

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 4, 2017

Author: Daniel Krenn

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 4, 2017

Commit: ce93586

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 4, 2017

Changed dependencies from pynac-0.7.4 to #22219 pynac-0.7.4

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 4, 2017

New commits:

11951c822219: pkg version/chksum
91973f122219: giac usage is GO
a178a7522219: doctest fixes
c7eb7ffMerge branch 'develop' into t/22219/upgrade_to_pynac_0_7_4
57c7bce22219: giac dependency
3a3bcf2Merge branch 'u/rws/upgrade_to_pynac_0_7_4' of git://trac.sagemath.org/sage into HEAD
ce93586doctests for #22142

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 4, 2017

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

c252b4ddoctests for #22142

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 4, 2017

Changed commit from ce93586 to c252b4d

@rwst
Copy link

rwst commented Feb 5, 2017

comment:10

Is fine modulo the dependency.

@rwst
Copy link

rwst commented Feb 5, 2017

Reviewer: Ralf Stephan

@vbraun
Copy link
Member

vbraun commented Feb 12, 2017

comment:11

The dependency needs to be a ticket number...

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 13, 2017

Changed dependencies from #22219 pynac-0.7.4 to #22219

@dkrenn
Copy link
Contributor Author

dkrenn commented Feb 13, 2017

comment:13

Replying to @vbraun:

The dependency needs to be a ticket number...

Ticket number was already there; just the "pynac..." has not been removed.

@vbraun
Copy link
Member

vbraun commented Feb 16, 2017

Changed branch from u/dkrenn/t/22142 to c252b4d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants