#31679 closed defect (fixed)

Actually fix: "Do not use pynac's poly_mul_expand function until it has been debugged"

Reported by: mkoeppe Owned by:
Priority: blocker Milestone: sage-9.3
Component: symbolics Keywords:
Cc: gh-DaveWitteMorris Merged in:
Authors: Dave Morris Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 2b88eb5 (Commits, GitHub, GitLab) Commit: 2b88eb58753e1daeacd38de84ab5e03c2a9d9ca0
Dependencies: Stopgaps:

Status badges

Description

#31479 with this title was merged in 9.3.rc3 but its branch contained something else.

Change History (9)

comment:1 Changed 16 months ago by mkoeppe

  • Authors set to Dave Morris
  • Reviewers set to Matthias Koeppe

comment:2 Changed 16 months ago by mkoeppe

  • Status changed from new to needs_review

comment:3 Changed 16 months ago by mkoeppe

  • Status changed from needs_review to positive_review

comment:4 Changed 16 months ago by vbraun

  • Status changed from positive_review to needs_work

On 32-bit:

**********************************************************************
File "src/sage/symbolic/expression.pyx", line 4882, in sage.symbolic.expression.Expression.expand
Failed example:
    ((a + b + c)^30 * (3*b + d - 5/d)^3).expand().subs(a=0,b=2,c=-1)
Expected:
    d^3 + 18*d^2 + 93*d - 465/d + 450/d^2 - 125/d^3 + 36  
Got:
    d^3 + 18*d^2 + 1739461754973*d - 8697308774865/d + 450/d^2 - 125/d^3 + 36
**********************************************************************
1 item had failures:
   1 of  43 in sage.symbolic.expression.Expression.expand
    [2941 tests, 1 failure, 44.35 s]
----------------------------------------------------------------------
sage -t --long --random-seed=0 src/sage/symbolic/expression.pyx  # 1 doctest failed
----------------------------------------------------------------------

comment:5 Changed 16 months ago by gh-DaveWitteMorris

I don't have time to push a branch until tomorrow, but I think that (for 9.3) we can solve the problem by weakening the doctest so that it works for both 64-bit and 32-bit. Maybe:

sage: a,b,c,d = var("a b c d")
sage: f = ((a + b + c)^30 * (3*b + d - 5/d)^3).expand().subs(a=0,b=2,c=-1)
sage: sum(sign(s) * (abs(ZZ(s)) % ZZ(2^20)) * d^i for s,i in f.coefficients())
d^3 + 18*d^2 + 93*d - 465/d + 450/d^2 - 125/d^3 + 36

comment:6 Changed 16 months ago by git

  • Commit changed from 296d4c76c67df66e7d8d1deb45a9dcda1ef5c327 to 2b88eb58753e1daeacd38de84ab5e03c2a9d9ca0

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

ef84adfMerge branch 'public/31554' of git://trac.sagemath.org/sage into #31679polymulexpand
2b88eb5fix doctest for 32-bit

comment:7 Changed 16 months ago by gh-DaveWitteMorris

  • Status changed from needs_work to needs_review

comment:8 Changed 16 months ago by mkoeppe

  • Status changed from needs_review to positive_review

This doctest looks a bit strange, but overall this is good enough as a hotfix for 9.3 for this severe bug.

comment:9 Changed 16 months ago by vbraun

  • Branch changed from public/31554 to 2b88eb58753e1daeacd38de84ab5e03c2a9d9ca0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.