Bill Allombert on Fri, 16 Feb 2024 17:09:30 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Numerical instability in extracting base B digits of the fractional part of real
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: Numerical instability in extracting base B digits of the fractional part of real
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Fri, 16 Feb 2024 17:09:01 +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=1708099742; c=relaxed/relaxed; bh=AaQ/4CIuN+pja5oo9kXBX1s8W2cgEcpTksHLlfF36dQ=; 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=k5q7N89Kh9ZEwZFoQCSYhi0lQXnR3F9vZajRjEC/+0CC6hmlfYSxZ4SbP1N5ZbGu+uAdux5TKmzFLs7IHL1eN3P+ibk9Q44ZkLhpDdyoOrnVSDkSBvVk+wTo8wZFXeY6SJmEjz9pW+gjv5X8d6YfaSDKzxfDsq0TQUWYzibUh649w9GSS1pFDz0qa78OlZpjou3+JzvH9qtUdEA6nRT+e1d7MX7Hih++fMpiD4Lb3GN0b+2gFtsvxYHr7pgvUI/YElT1ptvy6ozr+UGCyMcROeVHAlimtj4m8xX9+rV1kh3h6rcfcLwys7Q5HuPCL45IzUft1smlsKpzbXshHs+t1xwk9NV075LlTuYoC5L5knf6e2dyCLBrF0oBYGYF5hfFBT1h58qJrUx4nF3gU7+2EFZcZVJTpqJpb8yuKfGlcO8mFef+xsdmntVt+bOx1TE09foWiXz7teTOYx/rVtTOiAwFNgQ3WBmGtQDdVU/0UzOgF1p7pM20+CZWs7PO+hCP5q8DHvVbKNX0F0/hOjyoFUKrEPs9v4cg6J40kbif1GDF2KXlGAwVj7GbggCRa6kyQ5alCI0+3r6vkv9AxklC2j3r8PxjuVaCba+W6Rw9q/EhepXH88n87h55hvaj87ce/sm0Gd9AUrfmcCASSxEErgj75oQm0tnewU9x8ZykvFI=
- Arc-seal: i=1; a=rsa-sha256; d=math.u-bordeaux.fr; s=openarc; t=1708099742; cv=none; b=tSuok5KiRjVxQqj4oxMWys+MNv0vct+NmONRwaDW+OpeLEyRLhIOpRa292T6qP9gjrmg/RHbJ9l1aBSW+D6+D9wfQ/y2aydB4kxOvZLjNGOuZmTZcyngCgYxEAGwD0ne/jzrz3IcQyY0tl+1LSJkUTuWNET7ehbXNAMZquS+w6G4m9p12hSzCxDbMX3Rj8o4A9eKQxVu2D0fsnpXj0oleeV9lUoj9Eo9KG1MOXajizaztUxrIZgGEZIXvJFpgaGY2yJPRAf3WwNjtUl90xaZ8PJ9yIaEcODNmtzNSnPsOKVjTyR+vB6v0pz85tl8/BV9sV2WRD45vIOivqRverTlUbJmJb0UwLki3tTYoaE7oxfK4al5prrnooL4RfQ66QK1XZE9e6k99eUeskcRGMFu61EjY6rfzMI/nKo3Qqyj7W5ivgrfsMGYkge7MD4TSOpXCR1PP37Jb3hieu3AFLaB2CRNaMyU6DlZdRdRW2V0pbvOYgB6hfIp5CH/F5E/PQ9YdTk4dM4AgkypNAxHldMHzRVFquJm75ZZBMJbGJthIJEPGOqXPyoJA1Hs7rVwjep/SF3lLd4xvXRdfe7VwLt1B9OTZPrZQzGLcvFu2JEhl9VHf4/lwLjmCFK6MQth9VL3i8bbVkkplzvJ/Sw0OQ26vsfsz/6rd6kjvjhTCI65//I=
- Authentication-results: smail; dmarc=none header.from=math.u-bordeaux.fr
- Authentication-results: smail; arc=none
- Delivery-date: Fri, 16 Feb 2024 17:09:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1708099742; bh=AaQ/4CIuN+pja5oo9kXBX1s8W2cgEcpTksHLlfF36dQ=; h=Date:From:To:Subject:References:In-Reply-To:From; b=TgLpAu8ANnJTaulwz0SzY0cxnEdOsEsXTVuTF80J+zLiGgiY9pzkklXchcfQHbM97 EPlvlkluUBUclj6ChH6+H0JcAAaT17OwuegKlcJDDwlu0Swka2AunnvqSh/qQEAVef 1d0MD+q7DMuthxWKdsK82rkAjVTxZzRwFq+vdTp93GRH7cTUjQjRRrF8AN4dNctSoL IqFhZf2kKkfndITRpE383ltZHtefOtrxqQ47I94dZRMZU68xOc7ro+qDB1yaAv5GOx QaZp8aJhsYyhE7BTRahUKXh8krVs0St9M7Jdbzz9/IFLrOWIwB2HzOSUHiyDOsXetY 6VWyMB8p1+i62VKqTIQumXFX9z+vli4xcXZNh938kz3iJVMwhWhgJDq5QFgP/99K3S 1DAvh2uzdclcBjLSMtYkBWZt1hAiqfTv1DEw0QjRBhWoQZskqJQlROtvjtn9eqbTDj FcQ8eHt4ZAp1xdNQFR9Rm1vcv0Rp+3zQ4JZoN+j2es8Iru/ZaRzAemyuCxix5xIEgg 4VK0pj12DiK74xuitcvuu3iIYgesV9+gNfsYa90HZ8BtN50cYdGCg10MRO8/1IN/gQ iSZVGS+GD6ZyCwGujlVxwxjby1LPeOU5T3Gq6dW7HANjvO3Bf/OGeE06tbeine4Yl+ XEH/VOYftcSg79hz5kBW6YIU=
- In-reply-to: <CAGUWgD9R94BGzucES2RMAkakRr8z0yygJrAm-ontN-uWe0Pn+g@mail.gmail.com>
- Mail-followup-to: pari-dev@pari.math.u-bordeaux.fr
- References: <CAGUWgD9jh04yWKo8gnd=oT8sxt---hQiq65tGc0cM6Mxnk3wdw@mail.gmail.com> <Zc9EKwc0OJ8gF/b6@seventeen> <CAGUWgD9R94BGzucES2RMAkakRr8z0yygJrAm-ontN-uWe0Pn+g@mail.gmail.com>
On Fri, Feb 16, 2024 at 05:55:54PM +0200, Georgi Guninski wrote:
> On Fri, Feb 16, 2024 at 1:20 PM Bill Allombert
> <Bill.Allombert@math.u-bordeaux.fr> wrote:
> >
> > ? a=.33
> > %6 = 0.33000000000000000000000000000000000000
> > ? a*10-3
> > %7 = 0.30000000000000000000000000000000000000
> > ? b=a*10-3
> > %8 = 0.30000000000000000000000000000000000000
> > ? b*10-3
> > %9 = -2.350988701644575016E-38
> >
>
> Thanks. Why I don't see -2.350988701644575016E-38 in my session?
> It must be there, since you unrolled the first two iterations of
> the loop.
Because you continue with A=frac(A), and since A is negative, it is A+1,
so
? frac(b*10-3)
%5 = 0.99999999999999999999999999999999999998
Cheers,
Bill.