Bill Allombert on Mon, 12 Jun 2023 20:48:19 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Re: Problème avec intnum
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Mon, 12 Jun 2023 20:43:12 +0200
- Arc-authentication-results: i=1; smail; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1686595382; c=relaxed/relaxed; bh=oiapYTRPGsjYqm8jDgBopkgQY2UhRtt61EL2QmuR8/g=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:Mail-Followup-To: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; b=DbORe2S37GoliK1m9NE2/4dG4h4Z1+mPTIO4YJ3qZU9mYcV3j9HjJYFL4zxNfv1szjwTiwbaTv7139KUC8bWGS0y4eMeP4IvzkCSgzG3Qd3onn8V0Ot3nXnhAUhrGWUO9WJ03teR8VimmORn4Tr1hvxo31JpEGISJYIpIv3ab9eVlQXzmOIzxYNQwLvF/PtAtEiFOE58airwhF+cbQiEa22B29WFUIF/IHMo2oK5FZiBB0bkdamP9VUx5WV6UccYTSUhO6vxfFQ5EVpKKdJHkfwkaaW8GY5rTX8T3x1wMLZBuDjHQwBgpOlEGxn/Jg6GgZ+4DvqXwZ9b1O6wf9tpDbRFXnDgokDP8P/CPH+JJrYUPlQ9/ILJnc43kqlZUJutpXvf/+2Auq2DnQqzSGbnOcqc6g2Nh9m4WXr9MPf/q6Hm5La/TzMc6xgsB7tW6//OhUUhg6qRV+OFDkq5DHg5qh82NO807ZOWDcgepGTGrdWXQj9+ZMRsy1nfdIjM8TM1GhLU7fzLrI7qagqPxCQfHQ3ztmaUhW1Y7tTnJ3jliOawyUy9CVoTGETVlJRMLsjQ81swYpO7f0CNOr3sENhEdEQy/zNxuYxvM8KuBd2OKv3j4aUJS8/jdBJ0Z1EuMN4mvtRZNs/ZMdYVLsdxb347KJkhg/vfdiq2QLkACJMQSM8=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1686595382; cv=none; b=23ZGF/dZpUk6O//aONMiuMturEegPvEIGmBsiXIHk8bakuWVETXit562vgUepxLotxFiIgQlbwV3vC4G9ghDBvJW8N5a1FGiF3v4z48SLFIQzJPDarklefsmWThh4oCwsr9zYZ2CxHJA1a/52f9zxlDPbsVrMDigw3ILESJdcuM83HaIZuInzjZx1od6JKcyUGXXPKDVhAk3Q+J90W1cH3QD4a2IUbnww6dA6fMp5e1RaECV6YkObisNf9M6MI5d18FdzYPr2CrN8Q0iPclMd9BkS1gL5XtXnY2HtmAzFhfdh6OUXxX7z9/si1eTKMsl/UAUwZi285UWFbtENx0a5OKPLfSGJ8uZfuo6tOXifJ3W7CcM/Fxg4KTg8Ow7DMJHW9l1YXcc7p+KLYjV8+GWKpv++PDQlVlRCDaX9YkG3Dl2XiXJy+kxjVyWgyqx0H/BiuP0C7eoh9fvYmADPRdKO8Y76jxYCSQEpTNOmsWa1zQjhX9rc7xcqc/cgAdemC9adS+SfcMfFxK4SszjyeCayYKtB+N4abk7PbyHcQ7Y4JAyzNy7RZDGA7Kot53ENkQR8rFNOp5wd/XMyV6nJDQJSEvcdxVb3roICavA1p/A4ShoMWCsmqJ8EkZIJL56f38LOdYYy0m67F/9WvTipTR/VeaK4oEK1GZ5KVWAcizI+7o=
- Authentication-results: smail; arc=none
- Delivery-date: Mon, 12 Jun 2023 20:48:19 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1686595382; bh=oiapYTRPGsjYqm8jDgBopkgQY2UhRtt61EL2QmuR8/g=; h=Date:From:To:Subject:References:In-Reply-To:From; b=UgvK4eDp2zWa6s56gWgj00oG7UkNOCFwvrkYaXz9p7vLp5l0/gnlB7miXxWaK+KP/ h8+jUbFZabyKIVnFnDM8928wOdgc+6Ur6o4O8oS4b8sdqaBipNM9PXJteF5/0YH9xG PBrtjGn9JrAcJngf+M9y9O9+72tH4LkzGC5EYN7nP9tTBWNYl+6P1gHNtCXiO9Ws+n mHPQ9SRG8AIAkldbMEdqU0nOd+qcYp72hbU856SCVKPyvH4pEYSLQSax20VArbmyEg B0iBZXTVcwVdtwaWy1Pumk7ilr62IjUX2UBxKn8YSx7VSFxBpNPOtL845bb0uicDbT OsVwTmdhbuEy6tTvJIgfK6KfLHFGIe/Q/8HF+Uu0uQnH2MCc6I7kw7wgrj2L+kqpbo GY31t672qmTEfUHvhPYfQ4u63pLag5Qh+9B6la/S0kcZ+rBQYe6B1Fp6VTl9vbHg+D OtktdVSGFQQ5Juq6cs7x/t09PLm6ynG4xkMUCbJX/EpaitqZr6kUn3MB6L+xIVrQ6x zxEVUsJWDOMDG1RU8EGB8Kc5DJb7sNqUe64lGmUyuRTjuiX1V+h8YYjnEz+Op+d7lp P2DlTfPal/SFgLKgLf+kwD+GOUBgEQwzoELEMiACi/IBuy3FDNW2+J1BKrLn11lKch yI2tyq/NBoonAGZaaGzKfRgw=
- In-reply-to: <13BB6D2E-B72A-4D01-A49F-6C205ECF7918@maths.ox.ac.uk>
- Mail-followup-to: pari-users@pari.math.u-bordeaux.fr
- References: <13BB6D2E-B72A-4D01-A49F-6C205ECF7918@maths.ox.ac.uk>
On Mon, Jun 12, 2023 at 06:39:37PM +0100, Damian Rössler wrote:
> Bonjour,
>
> ce message pour vous signaler une problème que j’ai découvert dans Pari/GP lorsque j’ai essayé de faire un calcul avec intnum.
> Voici : lorsque j’évalue
[[Hello Damian, Sorry to reply in English for the benefit of the list]]
> intnum(x=-1000,1000,log(x+I)/(x^2+1))
>
> sur mon ordinateur, j’obtiens
>
> 0.22992031686600422539427385649876229873 + 99.246582527150702120676228264996637697*I
This is a known issue, there is a asymptotic singularity at x=I, so it is better to
cut the integral at 0
intnum(x=-1000,0,log(x+I)/(x^2+1)) + intnum(x=0,1000,log(x+I)/(x^2+1))
%1 = 2.1617705842398946206845289156864102853+4.9316606089380497070728417671647276968*I
Also, to get the result at the full precision you need to do
? intnum(x=-1000,0,log(x+I)/(x^2+1),2) + intnum(x=0,1000,log(x+I)/(x^2+1),2)
%3 = 2.1617705842396943881732021681813425165+4.9316606089382864390572986833518100961*I
(basically, try ,0) ,1) ,2) until it stabilizes)
> En revanche, la commande
>
> NIntegrate[Log[x+I]/(x^2+1),{x,-1000,1000}]
>
> sur Mathematica donne
>
> 2.16177 + 4.93166 I
>
> qui est effectivement proche de
>
> \pi\log(2)+i\pi^2/2 =(approx.) 2.1775860903036021305006888982376139473 + 4.9348022005446793094172454999380755677*i
>
> (que l’on obtiendrait en intégrant de -\infty à \infty).
Indeed! By splitting the integral again:
? intnum(x=-oo,0,log(x+I)/(x^2+1)) + intnum(x=0,oo,log(x+I)/(x^2+1))
%8 = 2.1775860903036021305006888982376139473+4.9348022005446793094172454999380755677*I
? Pi*log(2)+I*Pi^2/2
%9 = 2.1775860903036021305006888982376139473+4.9348022005446793094172454999380755677*I
> Une autre bizarrerie est que Pari/GP en ligne ( https://pari.math.u-bordeaux.fr/gp.html <https://pari.math.u-bordeaux.fr/gp.html> ) donne en revanche
>
> 0.1951079189482813284692074920 + 120.3479637305210234105619723*I
>
> lorsqu’on effectue la même commande que plus haut, ce qui ne coïncide pas avec ce que la version de Pari/GP installée sur mon ordinateur calcule.
Yes, the online version is 32bit due to limitation of javascript, which currently implies
that the default precision is 28 digits instead of 38 digits.
> J’ai aussi essayé de calculer l’intégrale avec des bornes plus élevées et on obtient des résultats encore plus éloignés de la vraie valeur.
> Par ex., sur mon ordinateur, la commande
>
> intnum(x=-100000,100000,log(x+I)/(x^2+1))
>
> donne
>
> 0.0046079812092805937682847726807162324991 + 9916.7863769592496702503585536475594909*I
>
> Je sais bien que les intégrales oscillantes sont difficiles à approcher numériquement mais l’intégrant n’est pas oscillant ici
> (mais il converge assez lentement vers 0).
PARI uses the double exponential method that does a change of variable. Unfortunately this causes the singularity
at I to get closer and closer to the integration path when N goes to infinity.
Thanks for using PARI/GP!
Bill