From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: Double-precision floating point arithmetics behaves differently in Guile and in C Date: Sun, 26 Sep 2021 13:55:20 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20892"; mail-complaints-to="usenet@ciao.gmane.io" To: Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 26 13:56:17 2021 Return-path: Envelope-to: guile-user@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 1mUSlU-0005F5-L9 for guile-user@m.gmane-mx.org; Sun, 26 Sep 2021 13:56:16 +0200 Original-Received: from localhost ([::1]:40890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUSlT-0002Xp-Jd for guile-user@m.gmane-mx.org; Sun, 26 Sep 2021 07:56:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUSkr-0002VO-Um for guile-user@gnu.org; Sun, 26 Sep 2021 07:55:38 -0400 Original-Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:46076) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUSko-000291-Ae for guile-user@gnu.org; Sun, 26 Sep 2021 07:55:37 -0400 Original-Received: by mail-io1-xd2d.google.com with SMTP id 134so18888980iou.12 for ; Sun, 26 Sep 2021 04:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=IHe5ihqeeHE6clRy3aBR3feRUjbWKCc1t5jQ0QRb7LM=; b=lY2GWEt1mMlgM3TvdO3sFLdLoAJqBOM19dw5bgDXJtr31mbc7IycDM4ACfOIz39q/9 lzl2Kq1gnx4b/TNW/sWXXnjz9emYJCn0B0UjgP0CB/AfB+trm6sgpzLdj00fRpvpRKi1 YOFKRjxbY+Pl9VfjHkO0PEAJsxQ9N05aeqaIvuO5FNtqIn8IewP2bSy0goH9lG4d+SHI lxvyVYLSxi1rRgJuFahT9QsyKTMsItg04X2UdMfKKNkQ6fKwuDBeLe6XoEu0ck6LOlTs Si07wWBYt6mlJ0weNj+TI0FyFpEg4nb/erSrFc9DjuqaHcMlL/R39nVkDi2dHNpS7LHf VG3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=IHe5ihqeeHE6clRy3aBR3feRUjbWKCc1t5jQ0QRb7LM=; b=PO3tXOGI9RSNGyIAAihcuz7w3scrrCcUwu7N2kxPr1VYV2oPuOViwZPWL/gNdil1b0 mXGYYKqFiLESv4bk1JJ/h4dSmwaAHhBw9TLChN0AA/DvC9PUCaYvpsx4exMZCm4heThN 3l3r3aHyW64Rm/p4BnAEr6l53UnXnCtOboVu7PWnxr0/vDWJOhdQHlnSZuUfhp07UlQT CSebJKEMkIPP2K1kJZnrumh2agv7OoMIjakGtHIyqRi4iRBr9foMJ6AhXNjdKuzg+d8a 2pw621hY1pKGDnqZYFdB75+v2qyJXtgmzjXpmSWCO3TuTYxpZXrwF7IhpmUrzVj4rB59 GlYg== X-Gm-Message-State: AOAM532LYN/+5e+4Bg90QihEjecIT7c9xD3fIqqkSB5Paz1IhtuA/iHK tRmUjo2KS013Jb2DwJ7afdMuTue7NPr/jMH1KUIyyI1+fY0GZQ== X-Google-Smtp-Source: ABdhPJzAsrO8veSDcE6LbI8VinT0nEz+gzW2PR7jE2dW+o58kkiVm9TJq79NffSgDRGs38iT72Y95I3M4svik244Cpk= X-Received: by 2002:a5e:9b18:: with SMTP id j24mr1918197iok.202.1632657332251; Sun, 26 Sep 2021 04:55:32 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d2d; envelope-from=godek.maciek@gmail.com; helo=mail-io1-xd2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17780 Archived-At: I forgot to mention that I run Guile in an Emacs session running in a WSL console on Windows 10. The tests of the C code that I've been performing so far were executed in an MSYS terminal, but I have just tried running them in WSL console, and the radii get ridiculous values. While the values used to generate the points are the following: center '[-65.12 -50.54 88.66]: radii: '[83.95 47.13 45.56] rotation: '[[9.633871e-001 1.363818e-001 -2.308359e-001] [-1.734094e-001 9.735887e-001 -1.485064e-001] [2.044857e-001 1.830983e-001 9.615927e-001]] and the values reconstructed in Guile are: (ellipsoid #:center (65.10194623013226 -88.58460232582514 -50.721825868168324) #:radii (83.94677717528019 45.56525864722978 47.12037877216948) #:rotation ((-0.9633227088329351 0.2307406879308479 0.13699669185777974) (0.173638969876562 0.14674930301995573 0.9738142277679884) (-0.20459439578586436 -0.961885324244193 0.18143251146545056))) (the signs and the order of radii differ, but it seems that the rotation matrix compensates for that) in the case of MSYS (MinGW 64-bit) I get the following values: approx_e.center = [90.13, -68.76, -42.46] approx_e.radius = [178.83, 97.08, 100.43] approx_e.rotation(3x3) = -9.634121049254586e-001 1.734020884333972e-001 -2.043742444879810e-001 -2.314281253565038e-001 -1.535574849495593e-001 9.606566096217422e-001 -1.351966674037161e-001 -9.728061546592428e-001 -1.880692600613582e-001 but in the case of the WSL console, I get approx_e.center = [90.13, -68.76, -42.46] approx_e.radius = [1347844355973136335704668472606720.00, 731678657375689861259088782950400.00, 756961648396782369967223865344000.00] approx_e.rotation(3x3) = -9.634121049254428e-01 1.734020884334219e-01 -2.043742444880351e-01 -2.314281253566119e-01 -1.535574849499134e-01 9.606566096216593e-01 -1.351966674036449e-01 -9.728061546591822e-01 -1.880692600617213e-01