From: Robert Sherman <r.sherman@upcmail.nl>
To: caml-list@inria.fr
Subject: [Caml-list] a small correction in OCaml tutorial Jason Hickey about second derivatives
Date: Tue, 10 Nov 2015 20:13:49 +0000 [thread overview]
Message-ID: <56424FFD.9040807@upcmail.nl> (raw)
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
reply other threads:[~2015-11-10 20:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56424FFD.9040807@upcmail.nl \
--to=r.sherman@upcmail.nl \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox