--- ais/ai-00185.txt 2001/05/26 02:55:10 1.6 +++ ais/ai-00185.txt 2001/09/08 01:42:47 1.7 @@ -1,4 +1,4 @@ -!standard G.1.2 (15) 01-05-20 AI95-00185/03 +!standard G.1.2 (15) 01-09-07 AI95-00185/04 !class binding interpretation 97-03-19 !status ARG approved 5-0-3 01-05-20 !status work item 99-09-18 @@ -26,7 +26,7 @@ The computed results of the mathematically multivalued functions are rendered single-valued by the following conventions, which are meant to imply that the principal branch is an analytic continuation of the corresponding real-valued -function in Ada.Numerics.Generic_Elementary_Functions. (For Arctan and Arccot, +function in Ada.Numerics.Generic_Elementary_Functions. (For Arctan and Arccot, the single-argument function in question is that obtained from the two-argument version by fixing the second argument to be its default value.) @@ -46,10 +46,10 @@ !discussion -The RM description of these functions contains contradictions. Fortunately, +The RM description of these functions contains contradictions. Fortunately, these are easily resolved if we assume the (ideal) functions over the complex plane are meant to be analytic continuations of the (ideal) same-named -functions in Ada.Numerics.Generic_Elementary_Functions. (For Arctan and +functions in Ada.Numerics.Generic_Elementary_Functions. (For Arctan and Arccot, it is necessary to use the one-argument function derived by using the default argument of the two-argument function.) This is consistent with normal mathematical usage, and desirable in its own right. @@ -64,15 +64,15 @@ "The real component of the result of the Arccot function ranges from 0.0 to approximately Pi." -These two paragraphs contradict each other. Consider what happens when X is -real and close to 0.0. The multi-valued Arccot of 0.0 is any odd multiple of -Pi/2.0. Because G.1.2(17) requires a discontinuity at 0.0, Arccot (-0.0) and -Arccot (+0.0) must be two different odd multiples of Pi/2.0. But G.1.2(24) +These two paragraphs contradict each other. Consider what happens when X is +real and close to 0.0. The multi-valued Arccot of 0.0 is any odd multiple of +Pi/2.0. Because G.1.2(17) requires a discontinuity at 0.0, Arccot (-0.0) and +Arccot (+0.0) must be two different odd multiples of Pi/2.0. But G.1.2(24) constrains the range of Arccot so that the only acceptable multiple of Pi/2.0 is Pi/2.0. We follow G.1.2(24), because an analytic continuation of Arccot for real -arguments cannot have a branch cut crossing the real axis. What must be +arguments cannot have a branch cut crossing the real axis. What must be changed here is the location of the cut. Now consider the rules related to Arcsin: @@ -89,26 +89,26 @@ Remember that if Y is a result of the multi-valued Arcsin, Pi - Y and Y + 2.0 * Pi are also results. -Consider what happens when X crosses the real axis to the right of 1.0. Let X -= A + I * B a complex number where A > 0.0 and B is small compared to A (so -that we can use first order approximation). A first order approximation of +Consider what happens when X crosses the real axis to the right of 1.0. Let X += A + I * B be a complex number where A > 0.0 and B is small compared to A (so +that we can use first order approximation). A first order approximation of Arcsin (X) is: Y = Pi / 2.0 + B / Sqrt (A**2 - 1.0) - I * Log (A + Sqrt (A**2 - 1.0)) -When B > 0.0, the real part of Y is slightly above Pi / 2.0. In order to keep +When B > 0.0, the real part of Y is slightly above Pi / 2.0. In order to keep the real part of Arcsin (X) in the range -Pi / 2.0 .. Pi / 2.0, we have to use -Y when B < 0.0 and Pi - Y when B > 0.0. This cause the imaginary part to -become discontinuous. This illustrates that for this RM95 G.1.2(23) requires +Y when B < 0.0 and Pi - Y when B > 0.0. This cause the imaginary part to +become discontinuous. This illustrates that for this RM95 G.1.2(23) requires that the imaginary part, not the real part, be discontinuous when X crosses the real axis to the right of 1.0. A similar analysis could be performed for X to the left of -1.0 and for Arccos -and Arcsinh. For these cases, the description of the cuts is accurate, and +and Arcsinh. For these cases, the description of the cuts is accurate, and what must change is the description of the properties of the functions. The rules given in the !summary follow from the assumption that the functions -on the complex plane are meant to be an analytic continuations of the +on the complex plane are meant to be analytic continuations of the corresponding functions on the real line. !appendix @@ -133,12 +133,12 @@ "The real component of the result of the Arccot function ranges from 0.0 to approximately Pi." -These two paragraphs seem to contradict each other. Consider what happens -when X is real and close to 0.0. Mathematically, the Arccot of 0.0 is any odd -multiple of Pi/2.0. Because G.1.2(17) requires a discontinuity at 0.0, Arccot -(-0.0) and Arccot (+0.0) must be two different odd multiples of Pi/2.0. But +These two paragraphs seem to contradict each other. Consider what happens +when X is real and close to 0.0. Mathematically, the Arccot of 0.0 is any odd +multiple of Pi/2.0. Because G.1.2(17) requires a discontinuity at 0.0, Arccot +(-0.0) and Arccot (+0.0) must be two different odd multiples of Pi/2.0. But G.1.2(24) constrains the range of Arccot so that the only acceptable multiple -of Pi/2.0 is Pi/2.0. So Arccot cannot be discontinuous at 0.0 after all... +of Pi/2.0 is Pi/2.0. So Arccot cannot be discontinuous at 0.0 after all... Also, the paragraphs G.1.2(15) and G.1.2(16) define branch cuts as follows: @@ -152,7 +152,7 @@ These rules are puzzling, because the natural mathematical definition of Arcsin and Arccos is such that the real part is continuous; it is the -imaginary part which has branch cuts. Similarly, the natural mathematical +imaginary part which has branch cuts. Similarly, the natural mathematical definition of Arcsinh is such that the imaginary part is continuous; it is the real part which has branch cuts. @@ -164,41 +164,41 @@ Re: AI95-00185, "Branch cuts of inverse trigonometric and hyperbolic functions" -I agree with the stated conclusions, and with the suggested fix. I have a +I agree with the stated conclusions, and with the suggested fix. I have a mathematical quibble with one paragraph; this is given at the end, since it -affects no conclusions. In the following, mathematical terminology is as in +affects no conclusions. In the following, mathematical terminology is as in Ahlfors, _Complex Analysis_, 2nd edition. I had this significant difficulty: though I agree with the fixes, the RM -language as it stands doesn't imply that the fixes are the right ones. Nor -does the Ada 95 Rationale provide any help. There is, however, a simple +language as it stands doesn't imply that the fixes are the right ones. Nor +does the Ada 95 Rationale provide any help. There is, however, a simple principle that would make all cases unambiguous for all practical purposes: namely, that the (ideal) functions are always analytic continuations of the -(ideal) functions of the same name over the reals. (That is, the ones in +(ideal) functions of the same name over the reals. (That is, the ones in Ada.Numerics.Generic_Elementary_Functions.) It would be good to make this principle explicit somewhere, ideally somewhere preceding the statements in G.1.2(12) and G.1.2(20). By "for all practical purposes" I mean: the remaining ambiguity is removable by adding the subsidiary principle that branch cuts are always subsets of the real -or the imaginary axis. This is "intuitively obvious" in some sense but is +or the imaginary axis. This is "intuitively obvious" in some sense but is perhaps worth stating explicitly for the sake of complete clarity. The quibble I mentioned is with this paragraph: >These rules are puzzling, because the natural mathematical definition of >Arcsin and Arccos is such that the real part is continuous; it is the ->imaginary part which has branch cuts. Similarly, the natural mathematical +>imaginary part which has branch cuts. Similarly, the natural mathematical >definition of Arcsinh is such that the imaginary part is continuous; it is the >real part which has branch cuts. I'm pretty sure I know what is meant here by extending the notion of "branch -cut" to real-valued functions. I'm dubious about whether this is the right way -to do so. For example, the real part of arccos is continuous but not -differentiable across its cut: its behavior is like that of abs(x) at x=0. For +cut" to real-valued functions. I'm dubious about whether this is the right way +to do so. For example, the real part of arccos is continuous but not +differentiable across its cut: its behavior is like that of abs(x) at x=0. For any chosen function among those under discussion (call it 'f'), there is never an analytic function in any neighborhood straddling a branch cut of f whose -real part matches f's real part. So, I'd prefer to let "branch cut" apply only +real part matches f's real part. So, I'd prefer to let "branch cut" apply only to analytic functions. **************************************************************** @@ -211,13 +211,13 @@ > language as it stands doesn't imply that the fixes are the right ones. Nor > does the Ada 95 Rationale provide any help. -Agreed. I looked for guidance in these documents, and couldn't find any, so +Agreed. I looked for guidance in these documents, and couldn't find any, so I had to go back to the math textbooks. > There is, however, a simple > principle that would make all cases unambiguous for all practical purposes: > namely, that the (ideal) functions are always analytic continuations of the -> (ideal) functions of the same name over the reals. (That is, the ones in +> (ideal) functions of the same name over the reals. (That is, the ones in > Ada.Numerics.Generic_Elementary_Functions.) It would be good to make this > principle explicit somewhere, ideally somewhere preceding the statements in > G.1.2(12) and G.1.2(20). @@ -226,7 +226,7 @@ > By "for all practical purposes" I mean: the remaining ambiguity is removable > by adding the subsidiary principle that branch cuts are always subsets of the -> real or the imaginary axis. This is "intuitively obvious" in some sense but +> real or the imaginary axis. This is "intuitively obvious" in some sense but > is perhaps worth stating explicitly for the sake of complete clarity. If a complex function is (1) analytic and (2) an extension of the real @@ -239,32 +239,32 @@ Taylor/Laurent series expansion. For the functions at hand, this pretty much constrains the cuts to lie on -the axes. So it seems to me that your "subsidiary principle" is +the axes. So it seems to me that your "subsidiary principle" is unnecessary. > >These rules are puzzling, because the natural mathematical definition of > >Arcsin and Arccos is such that the real part is continuous; it is the -> >imaginary part which has branch cuts. Similarly, the natural mathematical +> >imaginary part which has branch cuts. Similarly, the natural mathematical > >definition of Arcsinh is such that the imaginary part is continuous; it is > > the real part which has branch cuts. > > I'm pretty sure I know what is meant here by extending the notion of "branch -> cut" to real-valued functions. I'm dubious about whether this is the right -> way to do so. For example, the real part of arccos is continuous but not +> cut" to real-valued functions. I'm dubious about whether this is the right +> way to do so. For example, the real part of arccos is continuous but not > differentiable across its cut: its behavior is like that of abs(x) at x=0. > For any chosen function among those under discussion (call it 'f'), there is > never an analytic function in any neighborhood straddling a branch cut of f -> whose real part matches f's real part. So, I'd prefer to let "branch cut" +> whose real part matches f's real part. So, I'd prefer to let "branch cut" > apply only to analytic functions. I understand the argument that we should not apply the words "branch cut" to a function which is not analytic, and surely the real/imaginary parts of -these function aren't. How about replacing "has branch cuts" by "is -discontinuous" in the above paragraph. I.e.: +these function aren't. How about replacing "has branch cuts" by "is +discontinuous" in the above paragraph. I.e.: "These rules are puzzling, because the natural mathematical definition of Arcsin and Arccos is such that the real part is continuous; it is the -imaginary part which is discontinuous. Similarly, the natural mathematical +imaginary part which is discontinuous. Similarly, the natural mathematical definition of Arcsinh is such that the imaginary part is continuous; it is the real part which is discontinuous." @@ -278,11 +278,11 @@ From: Pascal Leroy Sent: Thursday, December 14, 2000 4:35 AM -> Hi, Pascal. I thought I'd spare the others the gruesome mathematical +> Hi, Pascal. I thought I'd spare the others the gruesome mathematical > details, and just converse with you. -Good idea. I am copying John, who is as far as I can tell the only other -ARG member interested in "gruesome mathematical details". I am also copying +Good idea. I am copying John, who is as far as I can tell the only other +ARG member interested in "gruesome mathematical details". I am also copying Randy to make sure that the discussion is recorded in the AI. > >If a complex function is (1) analytic and (2) an extension of the real @@ -294,7 +294,7 @@ > >3 - The branch cuts begin and end at the points where the function has no > >Taylor/Laurent series expansion. > -> For #3 I agree. For #1 and #2 I don't see this, unless there are +> For #3 I agree. For #1 and #2 I don't see this, unless there are > *different* implicit assumptions being made, in which case it might be > worthwhile to explicitly state *those* assumptions. > @@ -306,29 +306,29 @@ "Each of our nine elementary complex function f(z) has a slit or slits that bound a region, called the principal domain, inside which f(z) has a principal value that is single valued and analytic (representable locally by -power series), though it must be discontinuous across the slit(s). That +power series), though it must be discontinuous across the slit(s). That principal value is an extension, with maximal principal domain, of a real elementary function f(x) analytic at every interior point of its domain, -which is a segment of the real x-axis. To conserve the power series' +which is a segment of the real x-axis. To conserve the power series' validity, points strictly inside that segment must also lie strictly inside the principal domain; therefore the slit(s) cannot intersect the segment's -interior. Let z* = x - iy denote the complex conjugate of z = x + iy; the +interior. Let z* = x - iy denote the complex conjugate of z = x + iy; the power series for f(x) satisfy the identity f(z*) = f(z)* within some complex neighbourhood of the segment's interior, so the identity should persevere -throughout the principal domain's interior too. Consequently complex -conjugation must map the slit(s) to itself/themselves. The slit(s) of an +throughout the principal domain's interior too. Consequently complex +conjugation must map the slit(s) to itself/themselves. The slit(s) of an odd function f(z) = -f(-z) must be invariant under reflection in the origin -z = 0. Finally, the slit(s) must begin and end at branch-points: these are +z = 0. Finally, the slit(s) must begin and end at branch-points: these are singularities around which some branch of the function cannot be represented -by a Taylor nor Laurent series expansion. A slit can end at branch point at +by a Taylor nor Laurent series expansion. A slit can end at branch point at infinity. Consequently the slit for Sqrt, Log, and z ** w turns out to be the negative -real axis. Then the slits for Arcsin, Arccos and Arctanh turn out to be +real axis. Then the slits for Arcsin, Arccos and Arctanh turn out to be those parts of the real axis not between -1 and +1; similarly those parts of the imaginary axis not between -i and +i serve as slits for Arctan and -Arcsinh. The slit for Arccosh, the only slit with a finite branch-point -(-1) inside it, must be drawn along the real axis where z <= +1. None of +Arcsinh. The slit for Arccosh, the only slit with a finite branch-point +(-1) inside it, must be drawn along the real axis where z <= +1. None of this is controversial, although a few other writers have at times drawn the slits elsewhere either for a special purpose or by mistake; other tastes can be accomodated by substitutions sometimes so simple as writing, say, Log @@ -344,13 +344,13 @@ > function z**(1/n) where n > 1 is an integer. First, note that the cut for z ** (1/n) falls "naturally" on the negative -real axis. This is quite important, because we don't want the cut to lie on +real axis. This is quite important, because we don't want the cut to lie on a part of the real axis where the equivalent real function is well-defined (x ** (1/n) is perfectly well-defined for x >= 0). -Now it is true that you can put the cuts where you want. For instance if +Now it is true that you can put the cuts where you want. For instance if you rewrite z ** (1/n) as ((a * z) ** (1/n)) * ((1/a) ** (1/n)), that causes -the cut to rotate around the origin (its direction is given by -a*). But +the cut to rotate around the origin (its direction is given by -a*). But then the resulting function is _not_ the sum of a power series, because we don't have f(z*) = f(z)* anymore. @@ -372,8 +372,8 @@ > Let z* = x - iy denote the complex conjugate of z = x + iy; the >power series for f(x) satisfy the identity f(z*) = f(z)* within some complex >neighbourhood of the segment's interior, so the identity should persevere ->throughout the principal domain's interior too. Consequently complex ->conjugation must map the slit(s) to itself/themselves. The slit(s) of an +>throughout the principal domain's interior too. Consequently complex +>conjugation must map the slit(s) to itself/themselves. The slit(s) of an >odd function f(z) = -f(-z) must be invariant under reflection in the origin >z = 0. @@ -382,13 +382,13 @@ should be odd as well. Many years ago I would have taken assumptions like this for granted with -impunity. I am more careful nowadays because I've found cases where two +impunity. I am more careful nowadays because I've found cases where two seemingly self-evident assumptions contradict, and also cases where obviously desirable axioms lead to potentially large implementation difficulties. Indeed, the following problem occurs with his oddness axiom for Arcsin and -Arctanh on machines without signed zeros. (Here the branch cuts are that +Arctanh on machines without signed zeros. (Here the branch cuts are that part of the real axis with absolute value greater than 1.) Is it preferable for the implementation function to be odd on the branch cuts themselves, or for the result to match that which would obtain on an @@ -410,13 +410,13 @@ mathematical topic. Analysis never was my first love - I was more for geometry (and curvacious girls). -I met Kahan once. In fact I gave him a lift from a conference we were +I met Kahan once. In fact I gave him a lift from a conference we were both at somewhere in Oregon to the airport. It was a strange conference arranged by Los Alamos and I was invited to tell them about -Ada. Must have been around 1982. +Ada. Must have been around 1982. -A bright man. He told me how he designed the algorithms built in to -the HP pocket calculator for intergration and equation solution. He +A bright man. He told me how he designed the algorithms built in to +the HP pocket calculator for intergration and equation solution. He was given so many bytes to fit it in. Anyway, without reading this discussion in too much detail, I think @@ -451,9 +451,9 @@ > this sounds like an AARM-only note. I doubt we would want > to clutter up the RM with this stuff. -Undoubtedly. Users of the RM don't want to know the details. However a +Undoubtedly. Users of the RM don't want to know the details. However a numerics expert would probably be interested in finding the assumptions -documented in the AARM. I wish the original authors of annex G had done +documented in the AARM. I wish the original authors of annex G had done that, because it would have been much easier to correct their mistake (and maybe they wouldn't even have made the mistake in the first place). @@ -466,11 +466,11 @@ > if the multivalued function is odd, our single-valued restriction of it > should be odd as well. -True. Making this assumption explicit in the AI (and the AARM) is fine with +True. Making this assumption explicit in the AI (and the AARM) is fine with me. > Indeed, the following problem occurs with his oddness axiom for Arcsin and -> Arctanh on machines without signed zeros. (Here the branch cuts are that +> Arctanh on machines without signed zeros. (Here the branch cuts are that > part of the real axis with absolute value greater than 1.) Is it > preferable for the implementation function to be odd on the branch cuts > themselves, or for the result to match that which would obtain on an @@ -489,7 +489,7 @@ identities become wrong on the cuts. (I must say btw that I cannot get too excited by non-IEEE machines these -days. And I would definitely say that, if the underlying hardware is IEEE, +days. And I would definitely say that, if the underlying hardware is IEEE, a decent Ada compiler must have 'Signed_Zeros = True.) ****************************************************************

Questions? Ask the ACAA Technical Agent