From jvl@ocsystems.com Thu Jul 18 18:56:51 1996
Return-Path:
Received: from inmet.camb.inmet.com by dsd.camb.inmet.com (4.1/SMI-4.1)
id AA29882; Thu, 18 Jul 96 18:56:51 EDT
Received: from sw-eng.falls-church.va.us (ns1.sw-eng.falls-church.va.us) by inmet.camb.inmet.com (4.1/SMI-4.1)
id AA04809; Thu, 18 Jul 96 18:57:01 EDT
Received: from ocsystems.com by sw-eng.falls-church.va.us (8.7.1/)
id WAA01418; Thu, 18 Jul 1996 22:55:23 GMT
Received: by ocsystems.com (AIX 3.2/UCB 5.64/4.03)
id AA14392; Thu, 18 Jul 1996 18:45:37 -0400
From: jvl@ocsystems.com (Joel VanLaven)
Message-Id: <9607182245.AA14392@ocsystems.com>
Subject: Problem with complex exponentiation in polar form
To: ada-comment@sw-eng.falls-church.va.us
Date: Thu, 18 Jul 1996 18:45:37 -0400 (EDT)
Cc: jvl@ocsystems.com, oec@ocsystems.com
X-Mailer: ELM [version 2.4 PL22]
Content-Type: text
!topic Polar implementation of complex exponentiation for negative exponents incorrect.
!reference RM95-G.1.1(55)
!from Joel VanLaven 96-07-18
<>
!discussion
The RM95 gives the following method for doing complex exponentiation
in polar form in G.1.1(55) (removed from context for clarity):
"... exponentiating the modulus by the given exponent; multiplying
the argument by the given exponent, when the exponent is positive, or
dividing the argument by the absolute value of the given exponent, when the
exponent is negative; ..."
The special case for the determining the argument of the result when the
exponent is negative is incorrect. The method given for positive exponents
should be applied for all exponents, including interestingly enough, zero
exponents.
Here is a proof by example that the given method is incorrect:
assume that the RM95 method is correct.
let a complex number X=0+i
let an integer n=-1
X**n=1/i
X**n=(1/i)*(i/i)=(i/-1)=-i
argument(X)=pi/2
n is negative. So, according to the RM95,
argument(X**n)=(pi/2)/|-1|=pi/2
but, argument(X**n)=argument(-i)=-pi/2
pi/2 /= -pi/2 (even as an angle) i.e. a contradiction has been found
no zero-valued complex numbers were involved (they can mess things up).
The only dubious assumption made was that the RM95 method was correct.
So, it must not be.
A correct RM might read (minimal change):
"... exponentiating the modulus by the given exponent; multiplying
the argument by the given exponent; ..."