hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

In Expert F#, is the logic correct in the code for error estimation?

Last post 03-25-2008, 5:42 by dsyme. 1 replies.
Sort Posts: Previous Next
  •  03-22-2008, 1:45 5453

    In Expert F#, is the logic correct in the code for error estimation?

    I am really enjoying Expert F#. In the section titled "Example: Using F# Quotations For Error Estimation" (on p. 251 of Chapter 9), I am wondering whether the derivation for the errors is correct for multiplication and division.

    According to my derivations, I have:

            instead of //(x*y,Err(xerr*abs(x)+yerr*abs(y)+xerr*yerr))
            (x*y,Err(abs(x)*yerr+abs(y)*xerr+xerr*yerr))
            for multiplication

            instead of //(x/y,Err(xerr*abs(x)+abs(1.0/y)/yerr+xerr/yerr))
            let xa,ya = abs(x), abs(y)
            (x/y,Err((xa*yerr+ya*xerr)/(ya*(ya-yerr))))
            for division

    Does anyone else agree that the book's derivations are wrong, or am I missing something?

    Thanks. ~n
  •  03-25-2008, 5:42 5508 in reply to 5453

    Re: In Expert F#, is the logic correct in the code for error estimation?

    Yes, this is a mistake - thank you!  We'll add that to the errata and get it fixed in future re-printings.

    Kind regards

    don

     

     

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems