```Date: Jul 24, 2013 7:38 AM
Author: Waldek Hebisch
Subject: Re: An independent integration test suite

Nasser M. Abbasi <nma@12000.org> wrote:> > I remember reading that some math people, 100 or 200 years ago,> decided that sqrt (of non-negative, non-complex values) was single valued> function and its value is the non-negative root (ie. principal> square root).Beware that mathematicians have Humpty Dumpty attitude:: When I use a word. it means just what I choose it to:  mean -- neither more nor less.Another mathematician may use the same word with differentmeaning (of course, in good math text meaning is explained).Before complex numbers were invented only nonnegativesquare root was in use.Currently there are three sligtly different conventions:- real one: sqrt can be only applied to non-negative numbers  and produces non-negative values.  This one is used in  schools before pupils learn about complex numbers,  sometimes in real analysis and in theory of real fields- algebraic: y = sqrt(x) is basically abbreviation for  equation y^2 = x.  Using functional notation is  justified by fact that in algebraic context it normally  does not matter which root you use.  In fact, given  a single root there is no algebraic way to distinguish  it from the other one.  Only dependent roots, like  sqrt(2)*sqrt(3) versus sqrt(6) allows you to see  difference.  In some context dependent roots are  just illegal input, in other context case reasoning  is needed.- complex analytic: sqrt is a multivalied function.  When  we need a single branch this branch is choosen so that  resulting function is analyticYou may ask: Is not the principial branch of squre rootthe "true" one?  My opinion is that using principial branchfor numerical computation is unavoidable imperfectionmorally not much different from using floating pointinstead of true reals.  Simply, for numeric computationswe choose alternative which can be implemented withreasonable effort and frequently gives correct results.But ultimately it is up to programmers to make surethat correct branch is choosen.  For example FriCASnumeric code for elliptic functions makes heavy useof square roots.  To ensure nice branch cuts forelliptic integrals I had to compute appropriatebranch of square root and this branch is differentthan principal branch.--                               Waldek Hebischhebisch@math.uni.wroc.pl
```