From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 66A3E7FD28 for ; Tue, 10 Nov 2015 21:14:31 +0100 (CET) IronPort-PHdr: 9a23:foTOBRZSHDjyQftn1ylJxBb/LSx+4OfEezUN459isYplN5qZpci7bnLW6fgltlLVR4KTs6sC0LqL9fy9EjVav96oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDvvcGOKFwS2nKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGfayQ6NtRrVdCHEiMnspzMztrxjKCwWVtVUGVWBDqB1CDhLZpCr6U430uy2y4vA7wymXJ8j/S5gpQT+n5qZvDhns3nRUfwUl+X3a35QjxJlQpwis8kRy Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=r.sherman@upcmail.nl; spf=Pass smtp.mailfrom=r.sherman@upcmail.nl; spf=None smtp.helo=postmaster@fep21.mx.upcmail.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of r.sherman@upcmail.nl) identity=pra; client-ip=62.179.121.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="r.sherman@upcmail.nl"; x-sender="r.sherman@upcmail.nl"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of r.sherman@upcmail.nl designates 62.179.121.41 as permitted sender) identity=mailfrom; client-ip=62.179.121.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="r.sherman@upcmail.nl"; x-sender="r.sherman@upcmail.nl"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@fep21.mx.upcmail.net) identity=helo; client-ip=62.179.121.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="r.sherman@upcmail.nl"; x-sender="postmaster@fep21.mx.upcmail.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DAAwCjT0JWbyl5sz5exTqHXTwQAQEBAQEBAQEQAQoNCgYjLoItgjEVNAoCNgIFFgsCCwMCAQIBWAgBAYguAaMZj3CRCYEBhVOKJYJOgUQFlkiIDY42kyg4gXWCOoYgAQEB X-IPAS-Result: A0DAAwCjT0JWbyl5sz5exTqHXTwQAQEBAQEBAQEQAQoNCgYjLoItgjEVNAoCNgIFFgsCCwMCAQIBWAgBAYguAaMZj3CRCYEBhVOKJYJOgUQFlkiIDY42kyg4gXWCOoYgAQEB X-IronPort-AV: E=Sophos;i="5.20,271,1444687200"; d="scan'208";a="186994469" Received: from fep21.mx.upcmail.net ([62.179.121.41]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Nov 2015 21:13:51 +0100 Received: from edge02.upcmail.net ([192.168.13.237]) by viefep21-int.chello.at (InterMail vM.8.01.05.18 201-2260-151-151-20140610) with ESMTP id <20151110201350.NSXD29532.viefep21-int.chello.at@edge02.upcmail.net> for ; Tue, 10 Nov 2015 21:13:50 +0100 Received: from [95.96.99.169] ([95.96.99.169]) by edge02.upcmail.net with edge id fwDo1r01V3fGmAf01wDpsr; Tue, 10 Nov 2015 21:13:49 +0100 X-SourceIP: 95.96.99.169 From: Robert Sherman To: caml-list@inria.fr Message-ID: <56424FFD.9040807@upcmail.nl> Date: Tue, 10 Nov 2015 20:13:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Validation-by: r.sherman@upcmail.nl Subject: [Caml-list] a small correction in OCaml tutorial Jason Hickey about second derivatives Dear Reader, In the book of Jason Hickey: Introduction to Objective Caml Section 3.1.3: Higher order functions, page 19 and 20 something regrettable is found: The nice concept of Higher order function finds an anti-apothesis under the remark that results of the second derivative function are "way off!" Indeed, their values ought to be 6.0 and 60.0, but give both float 0. Of course this should not be mentioned in a book, for this is not good for OCaml. Jason Hickey gives an example like: let f' = deriv f .... with differential dx = 1.0e-11 But is simply repairable, see here under: While in Xavier Leroy et al.: An introduction to OCaml We find in Section 1.3 of page 15: let deriv f dx = ..... with differential dx = 1.0e-6 But they avoid the second derivative, what should not have worked much better. However the cure is simply to prevent: Just give dx a coarser value, even dx = 1.0e-5 comes with at least 4 significant good digits Using the definition of the second derivative should gain 1 or 2 digits. Hope you will test these facts and make Jason Hickey a bit happier. Robert Sherman Zaandam Pays Bas