From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.devel Subject: hypotenuse (was: Re: Adding a generic mathematical library) Date: Sun, 21 Jul 2024 17:12:10 +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> <86wmleby8w.fsf@gnu.org> <86sew2bxii.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10001"; mail-complaints-to="usenet@ciao.gmane.io" Cc: incal@dataswamp.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 21 17:12:49 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 1sVYEz-0002S4-9a for ged-emacs-devel@m.gmane-mx.org; Sun, 21 Jul 2024 17:12:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVYEU-0007ra-8B; Sun, 21 Jul 2024 11:12:18 -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 1sVYER-0007rL-5u for emacs-devel@gnu.org; Sun, 21 Jul 2024 11:12:15 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVYEP-000507-35; Sun, 21 Jul 2024 11:12:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com; s=s31663417; t=1721574730; x=1722179530; i=dimech@gmx.com; bh=xa8MTsfhd+wzgjZsLMDzRvBFczuPNhNmqYlk9UC3gCw=; h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Cc:Subject: Content-Type:Date:In-Reply-To:References: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=UnDUlnsofdoMsCdcDblCDIRyo04xOTM6eywkY7yMYsivhW7wwhOPSTPOLcI+vGPM Mfu8YWPGh9zndL1uEyWKHyoLvaLjqUFO9vWXYAy+dL0qV+z6bDDBrRZd9Ux4AI3HL 6ujuk3jGwS+K1T2VnO88y6f4k/NiNYExZUHNbRqAyGiKpMdZFAhlGJG9MpC15c0rs 8aFYZY/CD2zpdlO+cs9+KG0pZw9yPtlO89IaWt6vnbpBuz5vodE6UCGpe/Zw7jJ4V nr+ry8tkxdF6QL4rWnd4rPj5UxTBDoiBSiiebxlZ1p/kSWYtkL5HqlYjHL4zXxdit vHShYVJjwqpV+3afrw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [92.251.79.197] ([92.251.79.197]) by web-mail.gmx.net (3c-app-mailcom-bs10.server.lan [172.19.170.178]) (via HTTP); Sun, 21 Jul 2024 17:12:10 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <86sew2bxii.fsf@gnu.org> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:5ey1OlGHUSx4eGlVhfBHuRoise8xVVfs0jd/bFgnZYRTsNWsWrV3gAzhXVRWCmi3ATokh QSHNGqqI+A+CqsF+3v7ADanRyS4G2KxmMhXD9qrfRMtpdGKzClffriEvNoUaUNJBZpyhmfre8ZUK 9vh35VfInALT7REKk77XQmxL00WwDuyV9E/w4I97mrZ3jCl6hBYpbcYFFTATp1Ban2GBvtDfBld8 semmgtYWOQose2yYCO5n3HjMSx6nlA0uMbjrY7azkP7O9YEnGRCIQ6rCNGpZpB/kyPZPQDpaXpPd 9E= UI-OutboundReport: notjunk:1;M01:P0:Spjs5d13Y2s=;sO1N+zQUh2UPz1HkPlzVxPxFgvG FZhUcaqM5hbJeW0jOulU+UdY6ZxpDN3LsSj2xJdiyFeBFGkr+Iee4kMWTfmR+tEHLQGp90qmk G4bjJ3/ssqPYu8Wmw2VL1DVwcNnT9kDvAM3A7i0E3xX2abBPQXeDsFLU6I51Q4uO9yStwGDSw 3+HyxJfVTiinkuShjF3KG/CAopp5O5SCDhXqklx+OVX4Dpz6g5AvqKqg+Ity0G0mHrw/HRUN9 mjZfRJgT9TRPVnEsygk/leVHnG+4l8CCU8CMk/JEcd9qcwgQOpZk6rQqxf6u/vRoLeaFUaq1f HE8C72Dpu/W4jrD3RdiSkKGm/oLmifXURTBdoO8TFWZiL9AmTio7TDX3ZDa7V6dhx0JSqDGLS nb6ecsOsNF4Pb+e7MLkQOFkNs3EV8jCkdzueFPO0OXbfL5acvvCdgoUVMYyXhXghVuOeC9MN5 SObhDLBX6k46Qbyjx1Gm8rzz9OPhiBEo2cbfsfwO0vuae5pfafVADTUZSuGs5Sb27RQjNPKo4 jtJckhKYQCd6fP38JIaGFEBYT22DMXzx62QhdJJ6XA3yMUMj1ZobwjNu6dfadFqvz/l5A44e3 NinKLFQiT6iBiNCMewmz5jydMXTGszk9uTh6FwhRaeXWmbh3u/s5FsSY1dbZ/rSVf4XvbwZqx YE3BVLE2iFdhNBdiHg2KRzCvrStSa21tvlc7pSrOmg== Received-SPF: pass client-ip=212.227.15.15; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:321894 Archived-At: > Sent: Monday, July 22, 2024 at 3:00 AM > From: "Eli Zaretskii" > 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 > > 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.