JuliaLang/julia — pull request #2898 by scidom (2013-04-20 12:59:50+00:00)
Title: Dual type for representing dual numbers and performing dual algebra

Dual numbers extend the real numbers, similar to complex numbers. They adjoin a new element du such that du*du=0, in a similar way that complex numbers adjoin the imaginary unit i with the property i*i=-1. Apart from their mathematical interest in algebraic and differential geometry, they also find applications in physics (the real part of a dual represents the bosonic direction, while the imaginary part represents the fermionic direction), in screw theory, in motor and spatial vector algebra, and in computer science due to its relation with the forward mode of automatic differentiation. Due to its links with theory and application, it may be useful for Julia to ship with the `Dual` type, as an addition to the `Complex` and `Rational` types.

The `base/dual.jl` file has been written in an attempt to conform with `base/complex.jl`.

This is the first time I make an attempt to contribute to the core of Julia (as opposed to writing a package), so forgive me for any omissions or mistakes in case I haven't followed the protocol entirely correctly.