Skip to content

Commit

Permalink
Fix range for half-precision cos/sin/tan
Browse files Browse the repository at this point in the history
Fix the precondition range for the half-precision `cos`, `sin`, and
`tan` functions.  This appears to be a long-standing transcription bug
when we first copied these function definitions from OpenCL.  Somehow
we dropped the superscript notation, changing "2^16" into "216".

Also clarify that the range is inclusive, matching the definition in
OpenCL 3.0.

Closes internal issue 659.
  • Loading branch information
gmlueck committed Jul 21, 2023
1 parent 4437aa9 commit 837dbd6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23644,7 +23644,7 @@ template<typename NonScalar> (2)

*Overload (1):*

_Preconditions:_ The value of [code]#x# must be in the range -216 to +216.
_Preconditions:_ The value of [code]#x# must be in the range [-2^16^, +2^16^].

_Returns:_ The cosine of [code]#x#.

Expand All @@ -23657,7 +23657,7 @@ _Constraints:_ Available only if all of the following conditions are met:
* The element type is [code]#float#.

_Preconditions:_ The value of each element of [code]#x# must be in the range
-216 to +216.
[-2^16^, +2^16^].

_Returns:_ For each element of [code]#x#, the cosine of [code]#x[i]#.

Expand Down Expand Up @@ -24003,7 +24003,7 @@ template<typename NonScalar> (2)

*Overload (1):*

_Preconditions:_ The value of [code]#x# must be in the range -216 to +216.
_Preconditions:_ The value of [code]#x# must be in the range [-2^16^, +2^16^].

_Returns:_ The sine of [code]#x#.

Expand All @@ -24016,7 +24016,7 @@ _Constraints:_ Available only if all of the following conditions are met:
* The element type is [code]#float#.

_Preconditions:_ The value of each element of [code]#x# must be in the range
-216 to +216.
[-2^16^, +2^16^].

_Returns:_ For each element of [code]#x#, the sine of [code]#x[i]#.

Expand Down Expand Up @@ -24070,7 +24070,7 @@ template<typename NonScalar> (2)

*Overload (1):*

_Preconditions:_ The value of [code]#x# must be in the range -216 to +216.
_Preconditions:_ The value of [code]#x# must be in the range [-2^16^, +2^16^].

_Returns:_ The tangent of [code]#x#.

Expand All @@ -24083,7 +24083,7 @@ _Constraints:_ Available only if all of the following conditions are met:
* The element type is [code]#float#.

_Preconditions:_ The value of each element of [code]#x# must be in the range
-216 to +216.
[-2^16^, +2^16^].

_Returns:_ For each element of [code]#x#, the tangent of [code]#x[i]#.

Expand Down

0 comments on commit 837dbd6

Please sign in to comment.