Skip to content

"to_digits: nonpositive leading digit" message and incorrect solutions with double double and quad double precision #81

@bryangingechen

Description

@bryangingechen

Using macairM1_phcv24p.tar.gz from v2.4.88:

with the following input file,

5 5
- 4e+0*x4^2 + x0^2 + x3^2 + x2^2 + x1^2;
x0;
x1;
x2;
x3-1;

Running phc -b input output0 results in output0 which contains (among other things) the following:

THE SOLUTIONS :

2 5
===========================================================================
solution 1 :    start residual :  2.220E-16   #iterations : 1   success
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x4 : -5.00000000000000E-01   0.00000000000000E+00
 x0 :  0.00000000000000E+00   0.00000000000000E+00
 x3 :  1.00000000000000E+00   0.00000000000000E+00
 x2 :  0.00000000000000E+00   0.00000000000000E+00
 x1 :  0.00000000000000E+00   0.00000000000000E+00
== err :  2.699E-78 = rco :  3.623E-01 = res :  0.000E+00 = real regular ==
solution 2 :    start residual :  2.220E-16   #iterations : 1   success
t :  1.00000000000000E+00   0.00000000000000E+00
m : 1
the solution for t :
 x4 :  5.00000000000000E-01   0.00000000000000E+00
 x0 :  0.00000000000000E+00   0.00000000000000E+00
 x3 :  1.00000000000000E+00   0.00000000000000E+00
 x2 :  0.00000000000000E+00   0.00000000000000E+00
 x1 :  0.00000000000000E+00   0.00000000000000E+00
== err :  2.699E-78 = rco :  3.623E-01 = res :  0.000E+00 = real regular ==

(This is expected.)

However, when running phc -b2 input output2:

to_digits: nonpositive leading digit

Is printed to the console many times, and output2 contains the following:

THE SOLUTIONS :
2 5
===========================================================================
solution 1 :    start residual : 1.220E-35   #iterations : 0   success
t : 1.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
m : 1
the solution for t :
 x4 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x0 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x3 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x2 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x1 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
== err : 0.000E+00 = rco : 0.000E+00 = res : 0.000E+00 = real regular ==
solution 2 :    start residual : 1.220E-35   #iterations : 0   success
t : 1.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
m : 2
the solution for t :
 x4 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x0 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x3 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x2 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
 x1 : 0.00000000000000000000000000000000E+00  0.00000000000000000000000000000000E+00
== err : 0.000E+00 = rco : 0.000E+00 = res : 0.000E+00 = real regular ==

Clearly something went wrong here.

Running phc -b4 input outpu4 yields similar results as in the -b2 case.

The full files input, output0, output2 and output4 can be viewed here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions