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

More doctests from the book "Calcul mathématique avec Sage" chapter "integration" #14318

Closed
sagetrac-lfousse mannequin opened this issue Mar 20, 2013 · 25 comments
Closed

Comments

@sagetrac-lfousse
Copy link
Mannequin

sagetrac-lfousse mannequin commented Mar 20, 2013

The attached file provides doctests for examples in the chapter on integration and differential equations. Tests pass with 5.11.

Apply only attachment: trac_14318_doctests_from_french_book.patch

Component: doctest coverage

Author: Laurent Fousse, Paul Zimmermann, Frédéric Chapoton

Branch/Commit: u/chapoton/14318 @ 91f4bcb

Reviewer: Frédéric Chapoton, Paul Zimmermann

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

@sagetrac-lfousse sagetrac-lfousse mannequin added this to the sage-5.11 milestone Mar 20, 2013
@sagetrac-lfousse
Copy link
Mannequin Author

sagetrac-lfousse mannequin commented Mar 20, 2013

Attachment: integration_doctest.sage.gz

@jdemeyer
Copy link

jdemeyer commented Apr 9, 2013

comment:2

What am I supposed to do with this file? Normally, additions to Sage are patches to the Sage library (in devel/sage). See http://sagemath.org/doc/developer/

@zimmermann6
Copy link

comment:5

I've made a proper patch. All tests pass with Sage 5.11. Ready for review.

Paul

@zimmermann6
Copy link

Author: Laurent Fousse, Paul Zimmermann

@zimmermann6

This comment has been minimized.

@fchapoton
Copy link
Contributor

comment:6

ok, looks good to me

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@fchapoton fchapoton changed the title More doctests from the book "Calcul mathématique avec Sage" More doctests from the book "Calcul mathématique avec Sage" chapter "integration" Aug 30, 2013
@jdemeyer

This comment has been minimized.

@zimmermann6
Copy link

comment:9

thank you Frédéric.

Paul

@jdemeyer
Copy link

jdemeyer commented Sep 2, 2013

comment:10

Some of these examples yield slightly different results on 32-bit systems:

sage -t --long devel/sage/sage/tests/french_book/integration_doctest.py
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 30, in sage.tests.french_book.integration_doctest
Failed example:
    N(integrate(exp(-x^2)*log(x), x, 17, 42))
Expected:
    2.5657285006962035e-127
Got:
    2.565728500696221e-127
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 42, in sage.tests.french_book.integration_doctest
Failed example:
    numerical_integral(exp(-x^2)*log(x), 17, 42)
Expected:
    (2.5657285006962035e-127, 3.3540254049238093e-128)
Got:
    (2.565728500696221e-127, 3.3540254049023843e-128)
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 49, in sage.tests.french_book.integration_doctest
Failed example:
    numerical_integral(exp(-x^100), 0, 1.1, algorithm='qng')
Expected:
    (0.994327538576531..., 0.016840666914688864)
Got:
    (0.9943275385765319, 0.016840666914705607)
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 59, in sage.tests.french_book.integration_doctest
Failed example:
    N(integrate(exp(-x^2)*log(x), x, 17, 42), 200)
Expected:
    2.5657285006962035e-127
Got:
    2.565728500696221e-127
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 80, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=17, 42, exp(-x^2)*log(x))')
Expected:
    2.5657285005610514829173563961304785900 E-127
Got:
    2.565728500561051482917356396 E-127
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 85, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=0, 1, sin(sin(x)))')
Expected:
    0.43060610312069060491237735524846578643
Got:
    0.4306061031206906049123773553
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 94, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=0, 1, x^(-1/2))')
Expected:
    1.999999999999999999999999999998...
Got:
    1.999999999999999999990291881
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 99, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=[0, -1/2], 1, x^(-1/2))')
Expected:
    2.00000000000000000000000000000...
Got:
    2.000000000000000000000000000
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 104, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=[0, -1/42], 1, x^(-1/2))')
Expected:
    1.9999999999999999999999999999996...
Got:
    1.999999999999999999996899473
**********************************************************************

@jdemeyer
Copy link

jdemeyer commented Sep 3, 2013

comment:11

On Linux ia64:

sage -t --long devel/sage/sage/tests/french_book/integration_doctest.py
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 30, in sage.tests.french_book.integration_doctest
Failed example:
    N(integrate(exp(-x^2)*log(x), x, 17, 42))
Expected:
    2.5657285006962035e-127
Got:
    2.565728500696221e-127
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 42, in sage.tests.french_book.integration_doctest
Failed example:
    numerical_integral(exp(-x^2)*log(x), 17, 42)
Expected:
    (2.5657285006962035e-127, 3.3540254049238093e-128)
Got:
    (2.565728500696221e-127, 3.3540254049023813e-128)
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 59, in sage.tests.french_book.integration_doctest
Failed example:
    N(integrate(exp(-x^2)*log(x), x, 17, 42), 200)
Expected:
    2.5657285006962035e-127
Got:
    2.565728500696221e-127
**********************************************************************

@zimmermann6
Copy link

comment:12

the new attachment should fix the numerical noise issues on both 32-bit systems and ia64.
I'm not sure the notation 1.2345... works with the scientific notation, thus I've
used # rel tol in some places.

Paul

@jdemeyer
Copy link

jdemeyer commented Sep 6, 2013

comment:13

Replying to @zimmermann6:

the new attachment should fix the numerical noise issues on both 32-bit systems and ia64.
I'm not sure the notation 1.2345... works with the scientific notation, thus I've
used # rel tol in some places.

The ... notation in doctest results works purely with strings, it doesn't interpret the numbers. Tolerances like # rel tol do interpret the numbers, so that's probably the better choice indeed.

@fchapoton
Copy link
Contributor

comment:14

Hello,

I am not happy with the indentation: it should be 4 spaces instead of 2 !

Otherwise, this should be good to go.

@zimmermann6
Copy link

comment:15

Attachment: trac_14318_doctests_from_french_book.patch.gz

I am not happy with the indentation: it should be 4 spaces instead of 2 !

fixed in the new attachment.

Paul

@jdemeyer
Copy link

comment:16

There still remains

sage -t --long devel/sage/sage/tests/french_book/integration_doctest.py
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 94, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=0, 1, x^(-1/2))')
Expected:
    1.999999999999999999999...
Got:
    1.999999999999999999990291881
**********************************************************************
File "devel/sage/sage/tests/french_book/integration_doctest.py", line 104, in sage.tests.french_book.integration_doctest
Failed example:
    gp('intnum(x=[0, -1/42], 1, x^(-1/2))')
Expected:
    1.999999999999999999999...
Got:
    1.999999999999999999996899473
**********************************************************************

@fchapoton
Copy link
Contributor

Commit: 91f4bcb

@fchapoton
Copy link
Contributor

New commits:

91f4bcbtrac #14318 lower precision required
804f8f9#14318: More doctests from the book "Calcul mathématique avec Sage" chapter "integration"

@fchapoton
Copy link
Contributor

Branch: u/chapoton/14318

@fchapoton
Copy link
Contributor

comment:18

Paul or Laurent, if you agree with my changes, you can set this to positive review.

@zimmermann6
Copy link

comment:19

Paul or Laurent, if you agree with my changes, you can set this to positive review.

Frédéric, commit 91f4bcb is fine to me. I guess the other one (804f8f9) is just the original file?

Paul

@fchapoton
Copy link
Contributor

comment:20

Yes, the first commit is just the patch trac_14318_doctests_from_french_book.patch​ turned into a git commit

@zimmermann6
Copy link

Changed author from Laurent Fousse, Paul Zimmermann to Laurent Fousse, Paul Zimmermann, Frédéric Chapoton

@zimmermann6
Copy link

Changed reviewer from Frédéric Chapoton to Frédéric Chapoton, Paul Zimmermann

@zimmermann6
Copy link

comment:21

thanks, then I give a positive review.

Paul

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