azmul

View page source

Absolute Zero Multiplication

Syntax

z = azmul ( x , y )

Purpose

Evaluates multiplication with an absolute zero for any of the possible types listed below. The result is given by

\[\begin{split}z = \left\{ \begin{array}{ll} 0 & {\rm if} \; x = 0 \\ x \cdot y & {\rm otherwise} \end{array} \right.\end{split}\]

Note if x is zero and y is infinity, ieee multiplication would result in not a number whereas z would be zero.

Base

If Base satisfies the base type requirements and arguments x , y have prototypes

      const Base & x
      const Base & y

then the result z has prototype

Base z

AD<Base>

If the arguments x , y have prototype

      const AD < Base >& x
      const AD < Base >& y

then the result z has prototype

AD < Base > z

VecAD<Base>

If the arguments x , y have prototype

      const VecAD < Base >:: reference& x
      const VecAD < Base >:: reference& y

then the result z has prototype

AD < Base > z

Example

The file azmul.cpp is an examples and tests of this function.