Rectangular Complex Number Division

Validation and Benchmark Tool: ComplexRegtDivBV120.zip (2006 Update)

Table of results: CmplxRegtDivBenchmarks11.xls (Old, needs an update!)

Description

(The following description was written by Lars Gravengaard, April, 2006)

The objective is to build the fastest RegtDiv routines.

There are three overloaded functions differing in the input and output datatype.

function RegtDiv(const X, Y : TRegtangularComplexE) : TRegtangularComplexE; overload;
function RegtDiv(const X, Y : TRegtangularComplexE) : TRegtangularComplexE; overload;
function RegtDiv(const X, Y : TRegtangularComplexE) : TRegtangularComplexE; overload;

Type definition

TRegtangularComplexS = packed record
 RealPart, ImaginaryPart : Single;
end;

TRegtangularComplexD = packed record
 RealPart, ImaginaryPart : Double;
end;

TRegtangularComplexE = packed record
 RealPart : Extended;
 Pad1 : Cardinal; //4 byte
 Pad2 : SmallInt; //2 byte
 ImaginaryPart : Extended;
 Pad3 : Cardinal; //4 byte
 Pad4 : SmallInt; //2 byte
end;

TPolarComplexS = packed record
 Amplitude, Phase : Single;
end;

TPolarComplexD = packed record
 Amplitude, Phase : Double;
end;

TPolarComplexE = packed record
 Amplitude : Extended;
 Pad1 : Cardinal; //4 byte
 Pad2 : SmallInt; //2 byte
 Phase : Extended;
 Pad3 : Cardinal; //4 byte
 Pad4 : SmallInt; //2 byte
end;