Karim Belabas on Wed, 04 Jun 2025 07:31:12 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: inconsistent results from hyperellratpoints


> On Tue, Jun 03, 2025 at 12:49:32AM +0200, Bill Allombert wrote:
>> On Mon, Jun 02, 2025 at 02:59:29PM -0700, American Citizen wrote:
>>> Can anyone explain this one?
>>> 
>>>> ? P= -x^4 + 1396354*x^2 - 282104388225
>>>> ? hyperellratpoints(P,975)
>>>> %19 = [[-975, 376320], [-975, -376320], [-495, 0], [495, 0], [975,
>>>> 376320], [975, -376320]]
>>>> ? hyperellratpoints(P,1073)
>>>> %20 = [[-1073, 0], [-495, 0], [495, 0], [1073, 0]]
>>>> ? hyperellratpoints(P,1074)
>>>> %21 = [[-1073, 0], [-975, 376320], [-975, -376320], [-495, 0], [495, 0],
>>>> [975, 376320], [975, -376320], [1073, 0]]
>>> what happened at x=1073? where did the rational pts at x= -975 and +975 go
>>> to?
>> 
>> This seems like a bug.
>> 
>> The first "bad" commit is
>> 
>> commit ac281cdddcf2dfbf530d180ce0b3c816715aa9e6
>> Author: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
>> Date:   Wed Oct 16 19:55:04 2019 +0200
>> 
>>     change ZX_Uspensky so that it finds all rational roots first
>> 
>>     - negligible cost
>>     - this is a often a big speed improvement
>>     - guarantees that all rational roots are found
> 
> So the difference is that 
> install(ZX_Uspensky,GGLb)
> ZX_Uspensky(-x^4+1396354*x^2-282104388225,[-1073,1073],1)
> 
> now return
> [-1073.0000000000000000000000000000000000,-495.00000000000000000000000000000000000,495.00000000000000000000000000000000000,1073.0000000000000000000000000000000000]~
> 
> instead of
> [-1073, -495.00000000000000000000000000000000000, 495.00000000000000000000000000000000000, 1073]~

which is correct, ZX_Uspensky was a red herring. The problem was in
ZX_positive_region(P, h) which returns the sub-intervals of [-h,h] where P is
positive: it could fail when P(-h) = 0, which was the case here at h = 1073.

The problem is fixed in the 'master' branch.

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/