From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: hypotenuse (was: Re: Adding a generic mathematical library) Date: Sun, 21 Jul 2024 19:38:00 +0200 Message-ID: References: <8734o9sdig.fsf@posteo.net> <87wmllqq66.fsf@posteo.net> <87plrdqnhc.fsf@posteo.net> <87le21qldj.fsf_-_@posteo.net> <878qy1at52.fsf@dataswamp.org> <87plr6u8al.fsf_-_@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="t9pVC18psZ4tLzhC" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1916"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 21 19:38:42 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sVaWA-0000L1-9J for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Jul 2024 19:38:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVaVb-0002op-0p; Sun, 21 Jul 2024 13:38:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVaVZ-0002n2-35 for emacs-devel@gnu.org; Sun, 21 Jul 2024 13:38:05 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVaVX-0000HK-6s for emacs-devel@gnu.org; Sun, 21 Jul 2024 13:38:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=v9Eg56/70yEf++On+Q1j+lGyknjLXOpsfmqmHyg0bBg=; b=tdKt29RJHHxHfHyuu3VnNUvlau T6QEk0cLn6jKMZEmlCOIRrdPcVaHCa7xNiosSsWImkSD1ksesxXoGruJf/R+tdG05BUewc/25EkBY UhMZNkfQlT5F1NQnUMKZ8dmW9dTua3ZqtiGZXRAsecF5NrlZzWHbq7iJC0NxuXaHSSUorPrnDQPqG pOGm4dPMug+OU3WVIWAoFStcKjVG+pj4a6k9JawOiKRfJ35Ozfo/ySKqD0JXgE0sAOrBkOp9wx1WV 6jmYdca/7CtGf6Oz+po6vqzcVwN/w22O6mOS+bhw7NeQikttzWRDGPExCRw1wUUfuJJobrAghblzl GRkL4CAA==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1sVaVU-0004G6-7L for emacs-devel@gnu.org; Sun, 21 Jul 2024 19:38:00 +0200 Content-Disposition: inline In-Reply-To: <87plr6u8al.fsf_-_@dataswamp.org> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URI_DOTEDU=1 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321912 Archived-At: --t9pVC18psZ4tLzhC Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 21, 2024 at 04:30:26PM +0200, Emanuel Berg wrote: [..] > (defun hypotenuse (c1 c2) > (sqrt (+ (* c1 c1) (* c2 c2))) ) Conceptually, yes. Practically... just no. The shallow (handling /just/ overflow): https://www.johndcook.com/blog/2010/06/02/whats-so-hard-about-finding-a-h= ypotenuse/ The deeper (but with /very/ nice pics): https://www.cs.umd.edu/~ntoronto/papers/toronto-2014cise-floating-point.p= df (I guess Calc is already beyond your formula). Cheers --=20 t --t9pVC18psZ4tLzhC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZp1HbwAKCRAFyCz1etHa Rv/1AJ9S/Njlu3gzfEZLnntQMsYHlZ8WKQCfc5GJqJut8bTaEMG6+qx+coFgT+Q= =bnjf -----END PGP SIGNATURE----- --t9pVC18psZ4tLzhC--