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

[with patch and spkg] basic arithmetic using FLINT is broken (very serious!) #6919

Closed
williamstein opened this issue Sep 10, 2009 · 13 comments
Closed

Comments

@williamstein
Copy link
Contributor

Mariah Lenox reported:

R.<x> = PolynomialRing(ZZ)
A = 2^(2^17+2^15)  # note the 2 rather than the "s"
a = A * x^31
b = (A * x) * x^30
a == b   # prints "False" ???

But

R.<x> = PolynomialRing(ZZ, implementation='NTL')
A = 2^(2^17+2^15)  # note the 2 rather than the "s"
a = A * (x^31)
b = A * x * (x^30)
a == b   

gives True. So this is definitely either a bug in FLINT (highly likely), or a bug in our wrapper (much less likely, since our wrapper is so generic:

cpdef RingElement _mul_(self, RingElement right):
    r"""
    Returns self multiplied by right.

    EXAMPLES::

        sage: R.<x> = PolynomialRing(ZZ)
        sage: (x - 2)*(x^2 - 8*x + 16)
        x^3 - 10*x^2 + 32*x - 32
    """
    cdef Polynomial_integer_dense_flint x = self._new()
    _sig_on
    fmpz_poly_mul(x.__poly, self.__poly,
            (<Polynomial_integer_dense_flint>right).__poly)
    _sig_off
    return x

}}}

CC: @wbhart @burcin

Component: basic arithmetic

Author: Mike Hansen, William Stein

Reviewer: John Palmieri, Minh Van Nguyen

Merged: Sage 4.1.2.alpha4

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

@burcin
Copy link

burcin commented Sep 16, 2009

comment:2
Bill Hart <[email protected]> wrote:
<snip>
> It was caused by a bug in the FLINT FFT (the first ever found). I
> tracked the bug down to a specific piece of code and David Harvey has
> supplied a fix. There will be a new version of FLINT to patch this
> bug.

@mwhansen
Copy link
Contributor

Attachment: trac_6919.patch.gz

@mwhansen
Copy link
Contributor

Author: Mike Hansen

@mwhansen
Copy link
Contributor

comment:3

I've attached a patch which makes sure that this bug is indeed fixed by FLINT 1.5.0. The spkg can be found at http://sage.math.washington.edu/home/mhansen/flint-1.5.0.p0.spkg . This spkg is based of 1.3.0.p3 that Ondrej did.

@mwhansen mwhansen changed the title basic arithmetic using FLINT is broken (very serious!) [with patch and spkg] basic arithmetic using FLINT is broken (very serious!) Sep 25, 2009
@williamstein
Copy link
Contributor Author

comment:4

I posted another spkg that adds one critical Cygwin fix, namely naming the library libflint.dll instead of libflint.so:

http://sage.math.washington.edu/home/wstein/patches/flint-1.5.0.p1.spkg

It's based exactly on mhansen's spkg.

@jhpalmieri
Copy link
Member

comment:5

OS X 10.5, both 32-bit and 64-bit: first I applied the patch. This produced the doctest failure described in the ticket for the file libs/flint/flint.pyx. Then I did 'sage -f flint...' to install the new spkg . Then this file passed doctests.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

comment:6

New FLINT package up at

http://sage.math.washington.edu/home/mvngu/release/spkg/standard/flint-1.5.0.p2.spkg

The only change from .p1 is:

  • Check in all changes in wstein's name.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

comment:7

See palmieri's and my reports at #6849.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

Merged: Sage 4.1.2.alpha3

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

Reviewer: John Palmieri, Minh Van Nguyen

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

Changed author from Mike Hansen to Mike Hansen, William Stein

@sagetrac-mvngu sagetrac-mvngu mannequin removed the s: needs review label Sep 27, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Sep 27, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin reopened this Sep 27, 2009
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

comment:9

There is no 4.1.2.alpha3. Sage 4.1.2.alpha3 was William Stein's release for working on making the notebook a standalone package.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Sep 27, 2009

Changed merged from Sage 4.1.2.alpha3 to Sage 4.1.2.alpha4

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