Efficient and elegant complex numbers are one of the preconditions for the
use of Java in scientific computing. This paper introduces a preprocessor a
nd its translation rules that map a new basic type complex and its operatio
ns to pure Java, For the mapping it is insufficient to just replace one com
plex-variable with two double-variables. Compared to code that uses Complex
objects and method invocations to express arithmetic operations, the new b
asic type increases readability and it is also executed faster. On average,
the versions of our benchmark programs that use the basic type outperform
the class-based versions by a factor of 2 up to 21 (depending on the JVM us
ed). Copyright (C) 2000 John Wiley & Sons, Ltd.