Karim Belabas on Wed, 14 Feb 2024 16:57:02 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: polcoef: domain error in polcoef: degree > 9999
|
- To: Max Alekseyev <maxale@gmail.com>
- Subject: Re: polcoef: domain error in polcoef: degree > 9999
- From: Karim Belabas <Karim.Belabas@math.u-bordeaux.fr>
- Date: Wed, 14 Feb 2024 16:56:14 +0100
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1707926175; c=relaxed/relaxed; bh=F6indELB6rGBdWoBFT4Hs0vlyFa+kBNPP1PXWocy0TM=; h=DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=c+ZlCH82xjthW8wb0sItg9N35eY84XbMEwr9QuF2dbkI5yCvBAiQFGLZeAR6NzlQQS3FArdLJ6baXKU379Q4n5vCd2xkxNOAT0Sr/FxPfv1gyR2br+Ouvlfx5cHlpxtnv20yq5rL7+wM4/a6RBRtTMVHCmSBDYsz6geGl9p2nS7g8eCVOi19wgYLHyTfzjACJQPpYeGkpmCFfXLJQniGudpv9hE63qvmrgqK0Rk9DWhZkfBt15wuF2g5TZX0oVsBD7c1PR0fWUm7GHAX+OjTdBxAuOQ8+Ofj6a6w2W8np4NbeVVHpSCbMbnDTPHoz93DoQ29csS8wQQ//ET+KDz66osl0CufSNmsfNf74sI8ReaVWxM7gya0Y7fmnI67VqO7JU7KEFQPsqab560SNkg95Wrw3Dlwzv62naW875Q51c9asQMUqde+HNktETTdGKK4/oTUxK2+J7dg8T6F3+x5MWnYs1GffOLxXun5B5tBs11LwLmZRx3VFiph7pgp1FiQ31cxVy4J2N2q8hAwfGVckmUrEsoYprbOaigDls11oZlh92H4WCqJs9WXNLKOy81srLXw/fGPtgjkQB8HzIEmsfKSGbCa28N+1DG9MCpG/TlLDhXoyjWt/ee1vuXahBC+oiJNk6oQv4CybL0x6WWtd4tcsU3U9b9XefsuicJHofk=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1707926175; cv=none; b=lS26IixB33KRAXjCovoovhO4lt343GqEinCzGXXoafx2IBNSm6Mi+8NHi4Yak9LT9holbmq9NFi7Z63qFzJs29SLf1V0GqEPrGb2IDrx0jlnq7slg26VpmwxEoipyKJZD4z+e2uCv/TOh29g7R3aGTkfL+LmBl8tPY+1Tyw0HpXsf8HM/qEoIitXyr1cJAaLLKPFG9N6eXWnm6Di+AWs4Ad6kuhhUC4fnPpTbrd7sa98KOGLW3UPrDcekd/tuXTGtf9zf6J5dntfm2MsyOdjdaBC+eg0QIOfEj/fpFh8pHPCuzvGB1Q8GsnBtghqPDtSKQ+/9U6hgM/NOfbE7BFLeloGRtEcOx1oJYOm3jGPkw6zOu73E+fWXQhQLJZwdLBcbmRWm5MrJqr6eSEYd7WsX9LbnKIRIgTg60O6X/3ut59ht29phta+VwcgtdI9cEaKxeBmPl2b/38OvjAzr4wfLE2mzbfsNTYXmDWSOaJagez5RcZCsS/6xu48NAsaQMEph08DeWsFN0n8hXZ/wfcitrrcJIiCydNrej6vjfZ5JkvVaQqyT3oOoxoDuY8XTHivtOFkebjkc1oqoyTfhC1WKyqsl+wzn/7ZFsxUhl9H/2n2j1fUSP2kfuY90rYY6srKUhT2+gbeiPcCKL/cu5lNsJ+KYkzrGbSVD3UiuI+x4vw=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Cc: pari-users@pari.math.u-bordeaux.fr
- Delivery-date: Wed, 14 Feb 2024 16:57:02 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1707926175; bh=F6indELB6rGBdWoBFT4Hs0vlyFa+kBNPP1PXWocy0TM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qeFmuunCVxwldRmzT0xWm+scfHSlqDWHHcrV9HII86fMUBmx8n3YY/fcRDLp0pUyn NRJUUHYveoXab2nlUFbxxtb1E7ox3wk7JkWTN60J3WCgSxz9eZZIZ7aFizR2aiSPc9 MBI0W7s8X76JHX7DxYOumsHlcdw/6y9X/c9riclOc0O0W43gFHg3GR9vl/WDJ2hZOM f/GpYTRC5rTDAYqPJdPDY30aE8kIp7t+/E2hzmJNJeyq4SaGrxoTNHWM0WxmXqPfTt yexN7iEe8B+uARaZ+y1+l6n4Q7Wy2eMlmpPK93bSDDTdbP/Gx4zHb0RtHUOA+OCSHr D6M6vz7M1jagxq/lRDVy9zxi8bDpEUU4ky8f/hfTitWZUEiV0yOElg0FamBmfv8/JU J4FisbJ/do8sDxJC6nZnvi+TFqMFUf2yPIgi1flz7VT/fv6VB+MdJHtkx0tSlDzW5p RHF14Lhs6jxmEjnWnAXsrMQxzvhuF7ZWjuUlvVlVzog0uEuRFntGqDkc2oa2X06yQ4 m0T8K6qbM278gYNsCYxvU7XIvrQTTxBCApluQrT4BB6sip2DIeSL6gJZ3RtEs2g3NA khNiGbPkYKCF6Yk+rwffpwd8KepSBsvH4pGBcrTMdRjrNl+kc7aR83uZvVAW3REFlR hGnxKc0fEvsrOL2YriuM/++I=
- In-reply-to: <CAJkPp5Ncmgobnws9KB4aYxf4PqN7iOAy-mq7-st3NXGnHAio4A@mail.gmail.com>
- Mail-followup-to: Max Alekseyev <maxale@gmail.com>, pari-users@pari.math.u-bordeaux.fr
- References: <CAJkPp5Oec4gFgCBh-yW9DbsnuM63wA9zZ3xQXoEoHk1EN2O8iA@mail.gmail.com> <CAJkPp5Ncmgobnws9KB4aYxf4PqN7iOAy-mq7-st3NXGnHAio4A@mail.gmail.com>
Hi Max,
it's not just an error message, it's a message generated by an
uncaught exception. In the current situation
(16:42) gp > polcoef(x+O(x^3),10)
*** at top-level: polcoef(x+O(x^3),10)
*** ^--------------------
*** polcoef: domain error in polcoef: degree > 2
The exception is structured: it has type 'domain error', and specifies
that the parameter 'degree' is out of bounds in function 'polcoef',
since the maximal allowed value was 2. It could be trapped (using iferr)
and analyzed by functions higher up in the call chain.
For instance, converting the exception to a vector type gives access
to its "components"
(16:42) gp > Vec( iferr(polcoef(x+O(x^3),10), E, E) )
%1 = ["e_DOMAIN", "polcoef", "degree", ">", 2, 10]
and one further learns that the problemative value was 10.
An error message "polcoef: degree exceeds the series order" would
actually be much less informative. (Flat character string: no easy way
to parse it programmatically.)
Cheers,
K.B.
* Max Alekseyev [2024-02-13 15:10]:
> Please ignore my question - I did not realize I'm extracting the
> coefficient of a series rather than polynomial, and it was beyond the
> series order.
> On a related note, it may be worth making this error message more
> informative - e.g., remove a particular number and say that degree exceeds
> the series order.
> Regards,
> Max
>
> On Tue, Feb 13, 2024 at 9:02 AM Max Alekseyev <maxale@gmail.com> wrote:
>
> > This error seems to be new and raises the question:
> > How to extract coefficients of degree > 9999 ?
> >
> > Thanks,
> > Max
> >
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/