# `Beaver.MLIR.Dialect.Complex`

# `abs`

Return op name `complex.abs` as a bitstring.

# `abs`

`complex.abs` - computes absolute value of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyFloat`, floating-point
## Description
The `abs` op takes a single complex number and computes its absolute value.

Example:

```mlir
%a = complex.abs %b : complex<f32>
```

# `add`

Return op name `complex.add` as a bitstring.

# `add`

`complex.add` - complex addition

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `add` operation takes two complex numbers and returns their sum.

Example:

```mlir
%a = complex.add %b, %c : complex<f32>
```

# `angle`

Return op name `complex.angle` as a bitstring.

# `angle`

`complex.angle` - computes argument value of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyFloat`, floating-point
## Description
The `angle` op takes a single complex number and computes its argument value with a branch cut along the negative real axis.

Example:

```mlir
     %a = complex.angle %b : complex<f32>
```

# `atan2`

Return op name `complex.atan2` as a bitstring.

# `atan2`

`complex.atan2` - complex 2-argument arctangent

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
For complex numbers it is expressed using complex logarithm
atan2(y, x) = -i * log((x + i * y) / sqrt(x**2 + y**2))

Example:

```mlir
%a = complex.atan2 %b, %c : complex<f32>
```

# `bitcast`

Return op name `complex.bitcast` as a bitstring.

# `bitcast`

`complex.bitcast` - computes bitcast between complex and equal arith types

## Operands
- `operand` - Single, `AnyType`, any non-token type

## Results
- `result` - Single, `AnyType`, any non-token type
## Description
Example:

```mlir
     %a = complex.bitcast %b : complex<f32> -> i64
```

# `conj`

Return op name `complex.conj` as a bitstring.

# `conj`

`complex.conj` - Calculate the complex conjugate

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `conj` op takes a single complex number and computes the
complex conjugate.

Example:

```mlir
%a = complex.conj %b: complex<f32>
```

# `constant`

Return op name `complex.constant` as a bitstring.

# `constant`

`complex.constant` - complex number constant operation

## Attributes
- `value` - Single, `ArrayAttr`, array attribute

## Results
- `complex` - Single, `AnyComplex`, complex-type
## Description
The `complex.constant` operation creates a constant complex number from an
attribute containing the real and imaginary parts.

Example:

```mlir
%a = complex.constant [0.1, -1.0] : complex<f64>
```

# `cos`

Return op name `complex.cos` as a bitstring.

# `cos`

`complex.cos` - computes cosine of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `cos` op takes a single complex number and computes the cosine of
it, i.e. `cos(x)`, where `x` is the input value.

Example:

```mlir
%a = complex.cos %b : complex<f32>
```

# `create`

Return op name `complex.create` as a bitstring.

# `create`

`complex.create` - complex number creation operation

## Operands
- `real` - Single, `AnyFloat`, floating-point
- `imaginary` - Single, `AnyFloat`, floating-point

## Results
- `complex` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `complex.create` operation creates a complex number from two
floating-point operands, the real and the imaginary part.

Example:

```mlir
%a = complex.create %b, %c : complex<f32>
```

# `div`

Return op name `complex.div` as a bitstring.

# `div`

`complex.div` - complex division

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `div` operation takes two complex numbers and returns result of their
division:

```mlir
%a = complex.div %b, %c : complex<f32>
```

# `eq`

Return op name `complex.eq` as a bitstring.

# `eq`

`complex.eq` - computes whether two complex values are equal

This op has support for result type inference.

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `I1`, 1-bit signless integer
## Description
The `eq` op takes two complex numbers and returns whether they are equal.

Example:

```mlir
%a = complex.eq %b, %c : complex<f32>
```

# `exp`

Return op name `complex.exp` as a bitstring.

# `exp`

`complex.exp` - computes exponential of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `exp` op takes a single complex number and computes the exponential of
it, i.e. `exp(x)` or `e^(x)`, where `x` is the input value.
`e` denotes Euler's number and is approximately equal to 2.718281.

Example:

```mlir
%a = complex.exp %b : complex<f32>
```

# `expm1`

Return op name `complex.expm1` as a bitstring.

# `expm1`

`complex.expm1` - computes exponential of a complex number minus 1

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
complex.expm1(x) := complex.exp(x) - 1

Example:

```mlir
%a = complex.expm1 %b : complex<f32>
```

# `im`

Return op name `complex.im` as a bitstring.

# `im`

`complex.im` - extracts the imaginary part of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `imaginary` - Single, `AnyFloat`, floating-point
## Description
The `im` op takes a single complex number and extracts the imaginary part.

Example:

```mlir
%a = complex.im %b : complex<f32>
```

# `log1p`

Return op name `complex.log1p` as a bitstring.

# `log1p`

`complex.log1p` - computes natural logarithm of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `log` op takes a single complex number and computes the natural
logarithm of one plus the given value, i.e. `log(1 + x)` or `log_e(1 + x)`,
where `x` is the input value. `e` denotes Euler's number and is
approximately equal to 2.718281.

Example:

```mlir
%a = complex.log1p %b : complex<f32>
```

# `log`

Return op name `complex.log` as a bitstring.

# `log`

`complex.log` - computes natural logarithm of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `log` op takes a single complex number and computes the natural
logarithm of it, i.e. `log(x)` or `log_e(x)`, where `x` is the input value.
`e` denotes Euler's number and is approximately equal to 2.718281.

Example:

```mlir
%a = complex.log %b : complex<f32>
```

# `mul`

Return op name `complex.mul` as a bitstring.

# `mul`

`complex.mul` - complex multiplication

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `mul` operation takes two complex numbers and returns their product:

```mlir
%a = complex.mul %b, %c : complex<f32>
```

# `neg`

Return op name `complex.neg` as a bitstring.

# `neg`

`complex.neg` - Negation operator

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `neg` op takes a single complex number `complex` and returns `-complex`.

Example:

```mlir
%a = complex.neg %b : complex<f32>
```

# `neq`

Return op name `complex.neq` as a bitstring.

# `neq`

`complex.neq` - computes whether two complex values are not equal

This op has support for result type inference.

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `I1`, 1-bit signless integer
## Description
The `neq` op takes two complex numbers and returns whether they are not
equal.

Example:

```mlir
%a = complex.neq %b, %c : complex<f32>
```

# `pow`

Return op name `complex.pow` as a bitstring.

# `pow`

`complex.pow` - complex power function

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `pow` operation takes a complex number raises it to the given complex
exponent.

Example:

```mlir
%a = complex.pow %b, %c : complex<f32>
```

# `powi`

Return op name `complex.powi` as a bitstring.

# `powi`

`complex.powi` - complex number raised to signed integer power

This op has support for result type inference.

## Attributes
- `fastmath` - Optional, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnySignlessInteger`, signless integer

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `powi` operation takes a `base` operand of complex type and a `power`
operand of signed integer type and returns one result of the same type
as `base`. The result is `base` raised to the power of `power`.

Example:

```mlir
%a = complex.powi %b, %c : complex<f32>, i32
```

# `re`

Return op name `complex.re` as a bitstring.

# `re`

`complex.re` - extracts the real part of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `real` - Single, `AnyFloat`, floating-point
## Description
The `re` op takes a single complex number and extracts the real part.

Example:

```mlir
%a = complex.re %b : complex<f32>
```

# `rsqrt`

Return op name `complex.rsqrt` as a bitstring.

# `rsqrt`

`complex.rsqrt` - complex reciprocal of square root

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `rsqrt` operation computes reciprocal of square root.

Example:

```mlir
%a = complex.rsqrt %b : complex<f32>
```

# `sign`

Return op name `complex.sign` as a bitstring.

# `sign`

`complex.sign` - computes sign of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `sign` op takes a single complex number and computes the sign of
it, i.e. `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`.

Example:

```mlir
%a = complex.sign %b : complex<f32>
```

# `sin`

Return op name `complex.sin` as a bitstring.

# `sin`

`complex.sin` - computes sine of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `sin` op takes a single complex number and computes the sine of
it, i.e. `sin(x)`, where `x` is the input value.

Example:

```mlir
%a = complex.sin %b : complex<f32>
```

# `sqrt`

Return op name `complex.sqrt` as a bitstring.

# `sqrt`

`complex.sqrt` - complex square root

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `sqrt` operation takes a complex number and returns its square root.

Example:

```mlir
%a = complex.sqrt %b : complex<f32>
```

# `sub`

Return op name `complex.sub` as a bitstring.

# `sub`

`complex.sub` - complex subtraction

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `lhs` - Single, `AnyComplex`, complex type with floating-point elements
- `rhs` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `sub` operation takes two complex numbers and returns their difference.

Example:

```mlir
%a = complex.sub %b, %c : complex<f32>
```

# `tan`

Return op name `complex.tan` as a bitstring.

# `tan`

`complex.tan` - computes tangent of a complex number

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `tan` op takes a single complex number and computes the tangent of
it, i.e. `tan(x)`, where `x` is the input value.

Example:

```mlir
%a = complex.tan %b : complex<f32>
```

# `tanh`

Return op name `complex.tanh` as a bitstring.

# `tanh`

`complex.tanh` - complex hyperbolic tangent

This op has support for result type inference.

## Attributes
- `fastmath` - Single, `Arith_FastMathAttr`, Floating point fast math flags

## Operands
- `complex` - Single, `AnyComplex`, complex type with floating-point elements

## Results
- `result` - Single, `AnyComplex`, complex type with floating-point elements
## Description
The `tanh` operation takes a complex number and returns its hyperbolic
tangent.

Example:

```mlir
%a = complex.tanh %b : complex<f32>
```

