From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 5C9D2800FC for ; Wed, 2 Aug 2017 09:42:58 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=thiemann@informatik.uni-freiburg.de; spf=None smtp.mailfrom=thiemann@informatik.uni-freiburg.de; spf=None smtp.helo=postmaster@mx1.informatik.uni-freiburg.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of thiemann@informatik.uni-freiburg.de) identity=pra; client-ip=132.230.150.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="thiemann@informatik.uni-freiburg.de"; x-sender="thiemann@informatik.uni-freiburg.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of thiemann@informatik.uni-freiburg.de) identity=mailfrom; client-ip=132.230.150.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="thiemann@informatik.uni-freiburg.de"; x-sender="thiemann@informatik.uni-freiburg.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mx1.informatik.uni-freiburg.de) identity=helo; client-ip=132.230.150.4; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="thiemann@informatik.uni-freiburg.de"; x-sender="postmaster@mx1.informatik.uni-freiburg.de"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ADyWPJR9cfi40PP9uRHKM819IXTAuvvDOBiVQ1KB2?= =?us-ascii?q?1e4cTK2v8tzYMVDF4r011RmSDNWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?=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ulHvR8LEWVe2fjjckZHWcQogU+VPDqiEGFUTNLe3m9Ra?= =?us-ascii?q?c85jUiBIKiDIfDXZytjaea3Ca7G51WfnpJBkqNEXfubYWEWu0DZDicIs97wXQ4?= =?us-ascii?q?Uu3rcIgs2g20sxe+g59mJerd9ylS/cbm1dN17uDX0wo1+DNoFcOF+2CLU2xw2G?= =?us-ascii?q?gPQmll8rp4pBlFx0uOy+BEg/1VENVV4bsdTgc7OJvVyepSCtb8XRjEd8uISxC7?= =?us-ascii?q?RNTjDys8T9gs2dBIb0srSIbqtQzKwyf/W+xdrLeMHpFht/uEh3U=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DHAAAhgoFZfQSW5oRdFgQBAQEBAgEBA?= =?us-ascii?q?QEIAQEBARUBAQEBAgEBAQEIAQEBAYQTbSePAY8PgW6INI1qggQshRsChCtDFAE?= =?us-ascii?q?BAQEBAQEBAQEBEgEBCxQIV4IzJAGCQAEBAQEBAQEjHQEBBzABBAcECxEEAQEBA?= =?us-ascii?q?gIYCwMCAiElCQgGE4oXAw0IBAyuQWuCJoMIAQEFhCUNhA8BAQEBAQEBAQEBAQE?= =?us-ascii?q?BAQEBAQEBAQEVCIELgh2BMVGDLyuCfIJXgWY2gxOCYZ9EPIEChlCHaJAkhxGMI?= =?us-ascii?q?oUFhFM2gStTJRRJEgGCcYIEDxyBaXQBiWwBAQE?= X-IPAS-Result: =?us-ascii?q?A0DHAAAhgoFZfQSW5oRdFgQBAQEBAgEBAQEIAQEBARUBAQE?= =?us-ascii?q?BAgEBAQEIAQEBAYQTbSePAY8PgW6INI1qggQshRsChCtDFAEBAQEBAQEBAQEBE?= =?us-ascii?q?gEBCxQIV4IzJAGCQAEBAQEBAQEjHQEBBzABBAcECxEEAQEBAgIYCwMCAiElCQg?= =?us-ascii?q?GE4oXAw0IBAyuQWuCJoMIAQEFhCUNhA8BAQEBAQEBAQEBAQEBAQEBAQEBAQEVC?= =?us-ascii?q?IELgh2BMVGDLyuCfIJXgWY2gxOCYZ9EPIEChlCHaJAkhxGMIoUFhFM2gStTJRR?= =?us-ascii?q?JEgGCcYIEDxyBaXQBiWwBAQE?= X-IronPort-AV: E=Sophos;i="5.41,310,1498514400"; d="scan'208";a="285805849" Received: from mx1.informatik.uni-freiburg.de ([132.230.150.4]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2017 09:42:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=informatik.uni-freiburg.de; s=mx1602; h=To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Sender:Reply-To: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=2z/Q9tqtxljI+mqqSJZh8JWh604skUKBEZImMtoeoXs=; b=Vs5l3wrMfeiwMNIrnUzMHNEaw YNPMsVqeP0vOOykZ0gXDHA7XhcrPyUO1k9SzmkoWMhTcqoQ2MbLzbH8LhSTFIZjc78hex1Y6noe/J /d3M39z0RSrDsXb2x9TILKlKRayy/h7P2M8TKFlCF6Al8g/i3gdShVmpWR/E1gGYuzauk=; Received: from hsi-kbw-46-223-1-91.hsi.kabel-badenwuerttemberg.de ([46.223.1.91] helo=polihale.fritz.box) by smtp1.informatik.uni-freiburg.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dcoHp-0002nd-Ko; Wed, 02 Aug 2017 09:42:54 +0200 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) From: Peter Thiemann In-Reply-To: <0F7D3B1B3C4B894D824F5B822E3E5A175B282ACD@IRSMSX102.ger.corp.intel.com> Date: Wed, 2 Aug 2017 09:41:36 +0200 Cc: Peter Thiemann , =?utf-8?Q?Daniel_B=C3=BCnzli?= , Viet Le , "caml-list@inria.fr" Content-Transfer-Encoding: quoted-printable Message-Id: References: <0F7D3B1B3C4B894D824F5B822E3E5A175B282955@IRSMSX102.ger.corp.intel.com> <797F4C7C-A647-424D-8F1B-120B93A723F5@informatik.uni-freiburg.de> <0F7D3B1B3C4B894D824F5B822E3E5A175B282ACD@IRSMSX102.ger.corp.intel.com> To: "Soegtrop, Michael" X-Mailer: Apple Mail (2.3273) Organization: Universitaet Freiburg, Institut f. Informatik Subject: Re: [Caml-list] Float precision in OCaml Hi Michael, > On 1. Aug 2017, at 19:12, Soegtrop, Michael = wrote: >=20 > Dear Peter, >=20 >> https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf >=20 > A very interesting paper, but it handles only the print direction, not th= e scan direction and not the problem of: >=20 > forall (x : double): scan(print(x)) =3D x That=E2=80=99s true. A bit further digging produces this report: https://arxiv.org/abs/1310.8121 Which claims such round-tripping with a fairly simple algorithm.=20 Disclaimer: I only skimmed this paper. -Peter >=20 > Best regards, >=20 > Michael >=20 >> -----Original Message----- >> From: Peter Thiemann [mailto:thiemann@informatik.uni-freiburg.de] >> Sent: Tuesday, August 1, 2017 5:49 PM >> To: Soegtrop, Michael >> Cc: Peter Thiemann ; Daniel B=C3=BC= nzli >> ; Viet Le ; caml- >> list@inria.fr >> Subject: Re: [Caml-list] Float precision in OCaml >>=20 >> BTW, there is some literature on this topic, the most recent of which is= the >> paper =E2=80=9CPrinting Floating Point Numbers - A faster, always correc= t method=E2=80=9D >> https://cseweb.ucsd.edu/~lerner/papers/fp-printing-popl16.pdf >>=20 >> It cites all the previous efforts starting with Knuth=E2=80=99s TACP Vol= II, seminumerical >> algorithms. >>=20 >> -Peter >>=20 >>> On 1. Aug 2017, at 15:57, Soegtrop, Michael >> wrote: >>>=20 >>> Said that, one can define a mapping from floating point numbers to usual >> decimal string representations and back such that each floating point nu= mber >> results in a unique string. It is just quite tricky to get it right with= out extended >> precision arithmetic, though. >>>=20 >>> As far as I know the Lisp standard requires that certain floating point= formats >> have this property (I need to check). One might be able to learn from th= em how >> to do this properly. >=20 > Intel Deutschland GmbH > Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de > Managing Directors: Christin Eisenschmid, Christian Lamprechter > Chairperson of the Supervisory Board: Nicole Lau > Registered Office: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928