From: Christopher Dimech <dimech@gmx.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: incal@dataswamp.org, emacs-devel@gnu.org
Subject: hypotenuse (was: Re: Adding a generic mathematical library)
Date: Sun, 21 Jul 2024 18:13:39 +0200 [thread overview]
Message-ID: <trinity-869538c9-04ef-49ef-a0fc-02020f65045e-1721578419731@3c-app-mailcom-bs10> (raw)
In-Reply-To: <86plr6bvl9.fsf@gnu.org>
> Sent: Monday, July 22, 2024 at 3:42 AM
> From: "Eli Zaretskii" <eliz@gnu.org>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: incal@dataswamp.org, emacs-devel@gnu.org
> Subject: Re: hypotenuse (was: Re: Adding a generic mathematical library)
>
> > From: Christopher Dimech <dimech@gmx.com>
> > Cc: incal@dataswamp.org, emacs-devel@gnu.org
> > Date: Sun, 21 Jul 2024 17:12:10 +0200
> > Sensitivity: Normal
> >
> > > 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.
>
> AFAIK, every libm already includes a similar implementation, so we
> should just expose it to Lisp (again, assuming this function is indeed
> required to be part of Emacs).
The people involved in calc do think it is required.
next prev parent reply other threads:[~2024-07-21 16:13 UTC|newest]
Thread overview: 92+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 16:47 Add elisa to GNU ELPA Sergey Kostyaev
2024-07-16 12:54 ` Philip Kaludercic
2024-07-16 13:57 ` Sergey Kostyaev
2024-07-16 16:04 ` Philip Kaludercic
2024-07-16 16:35 ` Sergey Kostyaev
2024-07-17 13:21 ` Andrew Hyatt
2024-07-16 16:41 ` Sergey Kostyaev
2024-07-16 17:02 ` Philip Kaludercic
2024-07-16 17:47 ` Adding a generic mathematical library Philip Kaludercic
2024-07-16 22:06 ` Emanuel Berg
2024-07-17 2:54 ` Christopher Dimech
2024-07-17 5:58 ` Emanuel Berg
2024-07-19 16:16 ` Richard Stallman
2024-07-19 17:38 ` Christopher Dimech
2024-07-21 5:20 ` Emanuel Berg
2024-07-20 12:45 ` Max Nikulin
2024-07-20 13:53 ` Christopher Dimech
2024-07-21 5:19 ` Emanuel Berg
2024-07-21 6:15 ` Emanuel Berg
2024-07-21 7:40 ` Emanuel Berg
2024-07-21 8:45 ` Emanuel Berg
2024-07-21 8:29 ` Emanuel Berg
2024-07-21 7:27 ` Christopher Dimech
2024-07-21 8:03 ` Emanuel Berg
2024-07-21 9:14 ` Christopher Dimech
2024-07-21 9:48 ` Emanuel Berg
2024-07-21 11:20 ` Emanuel Berg
2024-07-21 11:53 ` Christopher Dimech
2024-07-21 12:10 ` Emanuel Berg
2024-07-21 12:27 ` Emanuel Berg
2024-07-21 12:46 ` Emanuel Berg
2024-07-21 13:03 ` Christopher Dimech
2024-07-21 13:17 ` Emanuel Berg
2024-07-21 14:33 ` Eli Zaretskii
2024-07-21 14:41 ` Christopher Dimech
2024-07-21 14:49 ` Eli Zaretskii
2024-07-21 14:58 ` Christopher Dimech
2024-07-21 15:02 ` Eli Zaretskii
2024-07-21 15:18 ` Christopher Dimech
2024-07-21 13:18 ` Christopher Dimech
2024-07-21 13:26 ` Emanuel Berg
2024-07-21 14:35 ` Christopher Dimech
2024-07-21 19:28 ` Emanuel Berg
2024-07-21 19:33 ` Emanuel Berg
2024-07-21 19:51 ` Emanuel Berg
2024-07-21 20:01 ` Emanuel Berg
2024-07-21 20:17 ` Emanuel Berg
2024-07-21 12:41 ` Christopher Dimech
2024-07-21 13:13 ` Emanuel Berg
2024-07-21 13:41 ` Emanuel Berg
2024-07-21 12:20 ` Emanuel Berg
2024-07-21 12:04 ` Emanuel Berg
2024-07-21 14:30 ` hypotenuse (was: Re: Adding a generic mathematical library) Emanuel Berg
2024-07-21 14:44 ` Eli Zaretskii
2024-07-21 15:00 ` Eli Zaretskii
2024-07-21 15:12 ` Christopher Dimech
2024-07-21 15:42 ` Eli Zaretskii
2024-07-21 16:13 ` Christopher Dimech [this message]
2024-07-21 15:54 ` hypotenuse Max Nikulin
2024-07-21 16:12 ` hypotenuse Eli Zaretskii
2024-07-21 16:17 ` hypotenuse Christopher Dimech
2024-07-21 19:01 ` hypotenuse (was: Re: Adding a generic mathematical library) Emanuel Berg
2024-07-21 19:13 ` Emanuel Berg
2024-07-21 17:38 ` tomas
2024-11-23 13:33 ` hypotenuse Petteri Hintsanen
2024-11-24 9:16 ` hypotenuse tomas
2024-07-17 7:09 ` Adding a generic mathematical library Michael Heerdegen via Emacs development discussions.
2024-07-17 7:54 ` Philip Kaludercic
2024-07-17 7:56 ` Michael Heerdegen via Emacs development discussions.
2024-07-18 6:07 ` Emanuel Berg
2024-07-18 6:45 ` Christopher Dimech
2024-07-18 7:12 ` Emanuel Berg
2024-07-18 7:49 ` Christopher Dimech
2024-07-21 4:56 ` Emanuel Berg
2024-07-18 7:29 ` Eli Zaretskii
2024-07-18 7:57 ` Emanuel Berg
2024-07-18 9:03 ` Eli Zaretskii
2024-07-21 4:52 ` Emanuel Berg
2024-07-18 8:15 ` Emanuel Berg
2024-07-18 9:04 ` Eli Zaretskii
2024-07-18 9:13 ` Christopher Dimech
2024-07-21 4:59 ` Emanuel Berg
2024-07-19 13:22 ` Emanuel Berg
2024-07-19 16:12 ` Christopher Dimech
2024-07-19 16:15 ` Stefan Kangas
2024-07-19 16:29 ` Christopher Dimech
2024-07-19 16:16 ` Richard Stallman
2024-07-19 18:00 ` Christopher Dimech
2024-07-17 21:26 ` Add elisa to GNU ELPA Sergey Kostyaev
2024-07-17 22:12 ` Philip Kaludercic
2024-07-18 3:45 ` Sergey Kostyaev
2024-07-18 11:06 ` Sergey Kostyaev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=trinity-869538c9-04ef-49ef-a0fc-02020f65045e-1721578419731@3c-app-mailcom-bs10 \
--to=dimech@gmx.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=incal@dataswamp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.