[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
hypotenuse (was: Re: Adding a generic mathematical library)
From: |
Christopher Dimech |
Subject: |
hypotenuse (was: Re: Adding a generic mathematical library) |
Date: |
Sun, 21 Jul 2024 17:12:10 +0200 |
> Sent: Monday, July 22, 2024 at 3:00 AM
> From: "Eli Zaretskii" <eliz@gnu.org>
> To: incal@dataswamp.org
> Cc: emacs-devel@gnu.org
> Subject: Re: hypotenuse (was: Re: Adding a generic mathematical library)
>
> > Date: Sun, 21 Jul 2024 17:44:47 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: emacs-devel@gnu.org
> >
> > > (defun hypotenuse (c1 c2)
> > > (sqrt (+ (* c1 c1) (* c2 c2))) )
> >
> > This is not the best way of computing hypot: squaring a number could
> > overflow or underflow, and you get bad result. Try
> >
> > (hypotenuse 1.e-600 1.e-600)
> > or
> > (hypotenuse 1.e600 1.e600)
> >
> > and you will see it.
>
> Sorry, that should have been 1.e-300 and 1.e300 instead.
I have a solution to the problem in fortran, but not in elisp. I could
include it. Its implementation required serious concentration.
- Re: Adding a generic mathematical library, (continued)
- Adding a generic mathematical library, Christopher Dimech, 2024/07/21
- Re: Adding a generic mathematical library, Emanuel Berg, 2024/07/21
- Re: Adding a generic mathematical library, Emanuel Berg, 2024/07/21
- Re: Adding a generic mathematical library, Emanuel Berg, 2024/07/21
- Re: Adding a generic mathematical library, Emanuel Berg, 2024/07/21
- hypotenuse (was: Re: Adding a generic mathematical library), Emanuel Berg, 2024/07/21
- Re: hypotenuse (was: Re: Adding a generic mathematical library), Eli Zaretskii, 2024/07/21
- Re: hypotenuse (was: Re: Adding a generic mathematical library), Eli Zaretskii, 2024/07/21
- hypotenuse (was: Re: Adding a generic mathematical library),
Christopher Dimech <=
- Re: hypotenuse (was: Re: Adding a generic mathematical library), Eli Zaretskii, 2024/07/21
- hypotenuse (was: Re: Adding a generic mathematical library), Christopher Dimech, 2024/07/21
- Re: hypotenuse, Max Nikulin, 2024/07/21
- Re: hypotenuse, Eli Zaretskii, 2024/07/21
- hypotenuse, Christopher Dimech, 2024/07/21
- Re: hypotenuse (was: Re: Adding a generic mathematical library), Emanuel Berg, 2024/07/21
- Re: hypotenuse (was: Re: Adding a generic mathematical library), Emanuel Berg, 2024/07/21
- Re: hypotenuse (was: Re: Adding a generic mathematical library), tomas, 2024/07/21
- Re: Adding a generic mathematical library, Michael Heerdegen, 2024/07/17
- Re: Adding a generic mathematical library, Philip Kaludercic, 2024/07/17