//
// This confidential and proprietary software may be used only as
// authorised by a licensing agreement from ARM Limited
// (C) COPYRIGHT 2020-2024 ARM Limited
// ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorised
// copies and copies may only be made to the extent permitted
// by a licensing agreement from ARM Limited.

=== Elementwise Unary Operators

==== ABS

Elementwise absolute value operation

include::{generated}/operators/ABS.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|+infinity|+infinity|+0|+0|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/ABS.tosac[lines=10..-1]
----

==== BITWISE_NOT

Elementwise bitwise NOT of input tensor.

include::{generated}/operators/BITWISE_NOT.adoc[]

[source,c++]
----
include::{pseudocode}/operators/BITWISE_NOT.tosac[lines=10..-1]
----

==== CEIL

Elementwise ceiling operation

include::{generated}/operators/CEIL.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|-infinity|+infinity|-0|+0|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/CEIL.tosac[lines=10..-1]
----

==== CLZ

Elementwise count leading zeros operation

include::{generated}/operators/CLZ.adoc[]

[source,c++]
----
include::{pseudocode}/operators/CLZ.tosac[lines=10..-1]
----

==== COS

Elementwise cosine operation for values given in radians.

include::{generated}/operators/COS.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|NaN|NaN|+1|+1|NaN
|===

[source, c++]
----
include::{pseudocode}/operators/COS.tosac[lines=10..-1]
----

==== EXP

Elementwise e to the x operation

include::{generated}/operators/EXP.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|+0|+infinity|1|1|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/EXP.tosac[lines=10..-1]
----

==== FLOOR

Elementwise floor operation

include::{generated}/operators/FLOOR.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|-infinity|+infinity|-0|+0|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/FLOOR.tosac[lines=10..-1]
----

==== LOG

Elementwise natural logarithm operation

include::{generated}/operators/LOG.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|NaN|+infinity|-infinity|-infinity|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/LOG.tosac[lines=10..-1]
----

==== LOGICAL_NOT

Elementwise logical NOT of input.

include::{generated}/operators/LOGICAL_NOT.adoc[]

[source,c++]
----
include::{pseudocode}/operators/LOGICAL_NOT.tosac[lines=10..-1]
----

==== NEGATE

Elementwise negation operation

include::{generated}/operators/NEGATE.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|+infinity|-infinity|+0|-0|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/NEGATE.tosac[lines=10..-1]
----

==== RECIPROCAL

Elementwise reciprocal operation. For integer operation, a TABLE should be used with the appropriate ranges.

include::{generated}/operators/RECIPROCAL.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|-0|+0|-infinity|+infinity|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/RECIPROCAL.tosac[lines=10..-1]
----

==== RSQRT

Elementwise reciprocal square root operation. For integer operation, a TABLE should be used with the appropriate ranges.

include::{generated}/operators/RSQRT.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|NaN|+0|-infinity|+infinity|NaN
|===

[source,c++]
----
include::{pseudocode}/operators/RSQRT.tosac[lines=10..-1]
----

==== SIN

Elementwise sine operation for values given in radians.

include::{generated}/operators/SIN.adoc[]

*Floating-point behavior:*
|===
|Input|-infinity|+infinity|-0|+0|NaN

|Output|NaN|NaN|-0|+0|NaN
|===

[source, c++]
----
include::{pseudocode}/operators/SIN.tosac[lines=10..-1]
----
