* [Caml-list] a small correction in OCaml tutorial Jason Hickey about second derivatives
@ 2015-11-10 20:13 Robert Sherman
0 siblings, 0 replies; only message in thread
From: Robert Sherman @ 2015-11-10 20:13 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-10 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-10 20:13 [Caml-list] a small correction in OCaml tutorial Jason Hickey about second derivatives Robert Sherman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox