Beaver.MLIR.Dialect.Math (beaver v0.4.7)
Summary
Functions
math.absf - floating point absolute-value operation
math.absi - integer absolute-value operation
math.acos - arcus cosine of the specified value
math.acosh - Hyperbolic arcus cosine of the given value
math.asin - arcus sine of the given value
math.asinh - hyperbolic arcus sine of the given value
math.atan2 - 2-argument arcus tangent of the given values
math.atan - arcus tangent of the given value
math.atanh - hyperbolic arcus tangent of the given value
math.cbrt - cube root of the specified value
math.ceil - ceiling of the specified value
math.clampf - floating point clamping operation
math.copysign - A copysign operation
math.cos - cosine of the specified value
math.cosh - hyperbolic cosine of the specified value
math.ctlz - counts the leading zeros an integer value
math.ctpop - counts the number of set bits of an integer value
math.cttz - counts the trailing zeros an integer value
math.erf - error function of the specified value
math.erfc - complementary error function of the specified value
math.exp2 - base-2 exponential of the specified value
math.exp - base-e exponential of the specified value
math.expm1 - base-e exponential of the specified value minus 1
math.floor - floor of the specified value
math.fma - floating point fused multipy-add operation
math.fpowi - floating point raised to the signed integer power
math.ipowi - signed integer raised to the power of operation
math.isfinite - returns true if the operand classifies as finite
math.isinf - returns true if the operand classifies as infinite
math.isnan - returns true if the operand classifies as NaN
math.isnormal - returns true if the operand classifies as normal
math.log1p - Computes the natural logarithm of one plus the given value
math.log2 - base-2 logarithm of the specified value
math.log10 - base-10 logarithm of the specified value
math.log - base-e logarithm of the specified value
math.powf - floating point raised to the power of operation
math.round - round of the specified value
math.roundeven - round of the specified value with halfway cases to even
math.rsqrt - reciprocal of sqrt (1 / sqrt of the specified value)
math.sin - sine of the specified value
math.sincos - sine and cosine of the specified value
math.sinh - hyperbolic sine of the specified value
math.sqrt - sqrt of the specified value
math.tan - tangent of the specified value
math.tanh - hyperbolic tangent of the specified value
math.trunc - trunc of the specified value
Functions
math.absf - floating point absolute-value operation
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The absf operation computes the absolute value. It takes one operand of
floating point type (i.e., scalar, tensor or vector) and returns one result
of the same type.
Example:
// Scalar absolute value.
%a = math.absf %b : f64
math.absi - integer absolute-value operation
This op has support for result type inference.
Operands
operand- Single,SignlessIntegerOrIndexLike, signless-integer-like
Results
result- Single,SignlessIntegerOrIndexLike, signless-integer-like
Description
The absi operation computes the absolute value. It takes one operand of
integer type (i.e., scalar, tensor or vector) and returns one result of the
same type.
Example:
// Scalar absolute value.
%a = math.absi %b : i64
math.acos - arcus cosine of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The acos operation computes the arcus cosine of a given value. It takes one
operand of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar arcus cosine value.
%a = math.acos %b : f64
math.acosh - Hyperbolic arcus cosine of the given value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Syntax:
operation ::= ssa-id `=` `math.acosh` ssa-use `:` typeThe acosh operation computes the arcus cosine of a given value. It takes
one operand of floating point type (i.e., scalar, tensor or vector) and returns
one result of the same type. It has no standard attributes.
Example:
// Hyperbolic arcus cosine of scalar value.
%a = math.acosh %b : f64
math.asin - arcus sine of the given value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Syntax:
operation ::= ssa-id `=` `math.asin` ssa-use `:` typeThe asin operation computes the arcus sine of a given value. It takes
one operand of floating point type (i.e., scalar, tensor or vector) and returns
one result of the same type. It has no standard attributes.
Example:
// Arcus sine of scalar value.
%a = math.asin %b : f64
math.asinh - hyperbolic arcus sine of the given value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Syntax:
operation ::= ssa-id `=` `math.asinh` ssa-use `:` typeThe asinh operation computes the hyperbolic arcus sine of a given value. It takes
one operand of floating point type (i.e., scalar, tensor or vector) and returns
one result of the same type. It has no standard attributes.
Example:
// Hyperbolic arcus sine of scalar value.
%a = math.asinh %b : f64
math.atan2 - 2-argument arcus tangent of the given values
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
lhs- Single,FloatLike, floating-point-likerhs- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The atan2 operation takes two operands and returns one result, all of
which must be of the same type. The operands must be of floating point type
(i.e., scalar, tensor or vector).
The 2-argument arcus tangent atan2(y, x) returns the angle in the
Euclidian plane between the positive x-axis and the ray through the point
(x, y). It is a generalization of the 1-argument arcus tangent which
returns the angle on the basis of the ratio y/x.
See also https://en.wikipedia.org/wiki/Atan2
Example:
// Scalar variant.
%a = math.atan2 %b, %c : f32
math.atan - arcus tangent of the given value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The atan operation computes the arcus tangent of a given value. It takes
one operand of floating point type (i.e., scalar, tensor or vector) and returns
one result of the same type. It has no standard attributes.
Example:
// Arcus tangent of scalar value.
%a = math.atan %b : f64
math.atanh - hyperbolic arcus tangent of the given value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Syntax:
operation ::= ssa-id `=` `math.atanh` ssa-use `:` typeThe atanh operation computes the hyperbolic arcus tangent of a given value. It takes
one operand of floating point type (i.e., scalar, tensor or vector) and returns
one result of the same type. It has no standard attributes.
Example:
// Hyperbolic arcus tangent of scalar value.
%a = math.atanh %b : f64
math.cbrt - cube root of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The cbrt operation computes the cube root. It takes one operand of
floating point type (i.e., scalar, tensor or vector) and returns one result
of the same type. It has no standard attributes.
Example:
// Scalar cube root value.
%a = math.cbrt %b : f64Note: This op is not equivalent to powf(..., 1/3.0).
math.ceil - ceiling of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The ceil operation computes the ceiling of a given value. It takes one
operand of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar ceiling value.
%a = math.ceil %b : f64
math.clampf - floating point clamping operation
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
value- Single,FloatLike, floating-point-likemin- Single,FloatLike, floating-point-likemax- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The clampf operation takes three operands and returns one result, each of
these is required to be the same type. Operands must be of floating point type
(i.e., scalar, tensor or vector).
The semantics of the operation are described by:
clampf(value, min, max) = maxf(minf(value, min), max)Example:
%d = math.clampf %value to [%min, %max] : f64
math.copysign - A copysign operation
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
lhs- Single,FloatLike, floating-point-likerhs- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The copysign returns a value with the magnitude of the first operand and
the sign of the second operand. It takes two operands and returns one result of
the same type. The operands must be of floating point type (i.e., scalar,
tensor or vector). It has no standard attributes.
Example:
// Scalar copysign value.
%a = math.copysign %b, %c : f64
math.cos - cosine of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The cos operation computes the cosine of a given value. It takes one
operand of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar cosine value.
%a = math.cos %b : f64
math.cosh - hyperbolic cosine of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The cosh operation computes the hyperbolic cosine. It takes one operand
of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar hyperbolic cosine value.
%a = math.cosh %b : f64
math.ctlz - counts the leading zeros an integer value
This op has support for result type inference.
Operands
operand- Single,SignlessIntegerOrIndexLike, signless-integer-like
Results
result- Single,SignlessIntegerOrIndexLike, signless-integer-like
Description
The ctlz operation computes the number of leading zeros of an integer value.
It operates on scalar, tensor or vector.
Example:
// Scalar ctlz function value.
%a = math.ctlz %b : i32
math.ctpop - counts the number of set bits of an integer value
This op has support for result type inference.
Operands
operand- Single,SignlessIntegerOrIndexLike, signless-integer-like
Results
result- Single,SignlessIntegerOrIndexLike, signless-integer-like
Description
The ctpop operation computes the number of set bits of an integer value.
It operates on scalar, tensor or vector.
Example:
// Scalar ctpop function value.
%a = math.ctpop %b : i32
math.cttz - counts the trailing zeros an integer value
This op has support for result type inference.
Operands
operand- Single,SignlessIntegerOrIndexLike, signless-integer-like
Results
result- Single,SignlessIntegerOrIndexLike, signless-integer-like
Description
The cttz operation computes the number of trailing zeros of an integer value.
It operates on scalar, tensor or vector.
Example:
// Scalar cttz function value.
%a = math.cttz %b : i32
math.erf - error function of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The erf operation computes the error function. It takes one operand of
floating point type (i.e., scalar, tensor or vector) and returns one result of
the same type. It has no standard attributes.
Example:
// Scalar error function value.
%a = math.erf %b : f64
math.erfc - complementary error function of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The erfc operation computes the complementary error function, defined as
1-erf(x). This function is part of libm and is needed for accuracy, since
simply calculating 1-erf(x) when x is close to 1 will give inaccurate results.
It takes one operand of floating point type (i.e., scalar,
tensor or vector) and returns one result of the same type. It has no
standard attributes.
Example:
// Scalar error function value.
%a = math.erfc %b : f64
math.exp2 - base-2 exponential of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The exp operation takes one operand of floating point type (i.e., scalar,
tensor or vector) and returns one result of the same type. It has no standard
attributes.
Example:
// Scalar natural exponential.
%a = math.exp2 %b : f64
math.exp - base-e exponential of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The exp operation takes one operand of floating point type (i.e., scalar,
tensor or vector) and returns one result of the same type. It has no standard
attributes.
Example:
// Scalar natural exponential.
%a = math.exp %b : f64
math.expm1 - base-e exponential of the specified value minus 1
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
expm1(x) := exp(x) - 1
The expm1 operation takes one operand of floating point type (i.e.,
scalar, tensor or vector) and returns one result of the same type. It has no
standard attributes.
Example:
// Scalar natural exponential minus 1.
%a = math.expm1 %b : f64
math.floor - floor of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The floor operation computes the floor of a given value. It takes one
operand of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar floor value.
%a = math.floor %b : f64
math.fma - floating point fused multipy-add operation
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
a- Single,FloatLike, floating-point-likeb- Single,FloatLike, floating-point-likec- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The fma operation takes three operands and returns one result, each of
these is required to be the same type. Operands must be of floating point type
(i.e., scalar, tensor or vector).
Example:
// Scalar fused multiply-add: d = a*b + c
%d = math.fma %a, %b, %c : f64The semantics of the operation correspond to those of the llvm.fma
intrinsic. In the
particular case of lowering to LLVM, this is guaranteed to lower
to the llvm.fma.* intrinsic.
math.fpowi - floating point raised to the signed integer power
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
lhs- Single,FloatLike, floating-point-likerhs- Single,SignlessIntegerOrIndexLike, signless-integer-like
Results
result- Single,FloatLike, floating-point-like
Description
The fpowi operation takes a base operand of floating point type
(i.e. scalar, tensor or vector) and a power operand of integer type
(also scalar, tensor or vector) and returns one result of the same type
as base. The result is base raised to the power of power.
The operation is elementwise for non-scalars, e.g.:
%v = math.fpowi %base, %power : vector<2xf32>, vector<2xi32The result is a vector of:
[<math.fpowi %base[0], %power[0]>, <math.fpowi %base[1], %power[1]>]Example:
// Scalar exponentiation.
%a = math.fpowi %base, %power : f64, i32
math.ipowi - signed integer raised to the power of operation
This op has support for result type inference.
Operands
lhs- Single,SignlessIntegerOrIndexLike, signless-integer-likerhs- Single,SignlessIntegerOrIndexLike, signless-integer-like
Results
result- Single,SignlessIntegerOrIndexLike, signless-integer-like
Description
The ipowi operation takes two operands of integer type (i.e., scalar,
tensor or vector) and returns one result of the same type. Operands
must have the same type.
Example:
// Scalar signed integer exponentiation.
%a = math.ipowi %b, %c : i32
math.isfinite - returns true if the operand classifies as finite
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,BoolLike, bool-like
Description
Determines if the given floating-point number has finite value i.e. it is normal, subnormal or zero, but not infinite or NaN.
Example:
%f = math.isfinite %a : f32
math.isinf - returns true if the operand classifies as infinite
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,BoolLike, bool-like
Description
Determines if the given floating-point number is positive or negative infinity.
Example:
%f = math.isinf %a : f32
math.isnan - returns true if the operand classifies as NaN
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,BoolLike, bool-like
Description
Determines if the given floating-point number is a not-a-number (NaN) value.
Example:
%f = math.isnan %a : f32
math.isnormal - returns true if the operand classifies as normal
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,BoolLike, bool-like
Description
Determines if the given floating-point number is normal, i.e. is neither zero, subnormal, infinite, nor NaN.
Example:
%f = math.isnormal %a : f32
math.log1p - Computes the natural logarithm of one plus the given value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Computes the base-e logarithm of one plus the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.
log1p(x) := log(1 + x)
Example:
// Scalar log1p operation.
%y = math.log1p %x : f64
math.log2 - base-2 logarithm of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Computes the base-2 logarithm of the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.
Example:
// Scalar log2 operation.
%y = math.log2 %x : f64
math.log10 - base-10 logarithm of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Computes the base-10 logarithm of the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.
Example:
// Scalar log10 operation.
%y = math.log10 %x : f64
math.log - base-e logarithm of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
Computes the base-e logarithm of the given value. It takes one operand of floating point type (i.e., scalar, tensor or vector) and returns one result of the same type.
Example:
// Scalar log operation.
%y = math.log %x : f64
math.powf - floating point raised to the power of operation
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
lhs- Single,FloatLike, floating-point-likerhs- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The powf operation takes two operands of floating point type (i.e.,
scalar, tensor or vector) and returns one result of the same type. Operands
must have the same type.
Example:
// Scalar exponentiation.
%a = math.powf %b, %c : f64
math.round - round of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The round operation returns the operand rounded to the nearest integer
value in floating-point format. It takes one operand of floating point type
(i.e., scalar, tensor or vector) and produces one result of the same type. The
operation rounds the argument to the nearest integer value in floating-point
format, rounding halfway cases away from zero, regardless of the current
rounding direction.
Example:
// Scalar round operation.
%a = math.round %b : f64
math.roundeven - round of the specified value with halfway cases to even
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The roundeven operation returns the operand rounded to the nearest integer
value in floating-point format. It takes one operand of floating point type
(i.e., scalar, tensor or vector) and produces one result of the same type. The
operation rounds the argument to the nearest integer value in floating-point
format, rounding halfway cases to even, regardless of the current
rounding direction.
Example:
// Scalar round operation.
%a = math.roundeven %b : f64
math.rsqrt - reciprocal of sqrt (1 / sqrt of the specified value)
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The rsqrt operation computes the reciprocal of the square root. It takes
one operand of floating point type (i.e., scalar, tensor or vector) and returns
one result of the same type. It has no standard attributes.
Example:
// Scalar reciprocal square root value.
%a = math.rsqrt %b : f64
math.sin - sine of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The sin operation computes the sine of a given value. It takes one
operand of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar sine value.
%a = math.sin %b : f64
math.sincos - sine and cosine of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
sin- Single,FloatLike, floating-point-likecos- Single,FloatLike, floating-point-like
Description
The sincos operation computes both the sine and cosine of a given value
simultaneously. It takes one operand of floating point type (i.e., scalar,
tensor or vector) and returns two results of the same type. This operation
can be more efficient than computing sine and cosine separately when both
values are needed.
Example:
// Scalar sine and cosine values.
%sin, %cos = math.sincos %input : f64
math.sinh - hyperbolic sine of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The sinh operation computes the hyperbolic sine. It takes one operand
of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar hyperbolic sine value.
%a = math.sinh %b : f64
math.sqrt - sqrt of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The sqrt operation computes the square root. It takes one operand of
floating point type (i.e., scalar, tensor or vector) and returns one result of
the same type. It has no standard attributes.
Example:
// Scalar square root value.
%a = math.sqrt %b : f64
math.tan - tangent of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The tan operation computes the tangent. It takes one operand
of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar tangent value.
%a = math.tan %b : f64
math.tanh - hyperbolic tangent of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The tanh operation computes the hyperbolic tangent. It takes one operand
of floating point type (i.e., scalar, tensor or vector) and returns one
result of the same type. It has no standard attributes.
Example:
// Scalar hyperbolic tangent value.
%a = math.tanh %b : f64
math.trunc - trunc of the specified value
This op has support for result type inference.
Attributes
fastmath- Single,Arith_FastMathAttr, Floating point fast math flags
Operands
operand- Single,FloatLike, floating-point-like
Results
result- Single,FloatLike, floating-point-like
Description
The trunc operation returns the operand rounded to the nearest integer
value in floating-point format. It takes one operand of floating point type
(i.e., scalar, tensor or vector) and produces one result of the same type.
The operation always rounds to the nearest integer not larger in magnitude
than the operand, regardless of the current rounding direction.
Example:
// Scalar trunc operation.
%a = math.trunc %b : f64