Project

General

Profile

Bug #1321

RealRoots fails on -x^2

Added by John Abbott over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
bug
Target version:
Start date:
25 Sep 2019
Due date:
% Done:

100%

Estimated time:
0.67 h
Spent time:

Description

Small failing example:

>>> RealRoots(-x^2);
--> ERROR: The arg(s) given are unsuitable
--> [CoCoALib] FloorLogBase: cannot compute log(0)
--> WHERE: at line 104 (column 13) of RealRoots.cpkg5
-->   B := 2^(1+FloorLog2(RootBound(F)));
-->             ^^^^^^^^^^^^^^^^^^^^^^^
CONTEXT: function RealRoots2 at line 104 of RealRoots.cpkg5
 CALLED BY: function RealRoots at line 85 of RealRoots.cpkg5
  called at top-level

History

#1 Updated by John Abbott over 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I thought I had already fixed this bug. Indeed the code is there inside RealRoots2; the code assumed that the arg to RealRoots2 is square-free, but this appears not to be the case. Why? :-/

#2 Updated by John Abbott over 4 years ago

  • Status changed from In Progress to Feedback
  • Assignee set to John Abbott
  • % Done changed from 10 to 90

Indeed I had "fixed" it, but there was a slight mistake: I forgot to guarantee that the LC of the poly handed to the internal function RealRoots2 is positive. Now RealRoots handles this correctly.

I hope Anna can check that the corrected package RealRoots.ckg5 works for her too. Then we can close (and tell the finder that the bug has been fixed). Perhaps the corrected package should be sent to him?

#3 Updated by John Abbott over 4 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time set to 0.67 h

I have added RealRoots(-x^2) to the exbugs test suite.
Closing.

Also available in: Atom PDF