blob: 459db2c5d3a1ab9de198ada0e0642875c8e101ca [file] [log] [blame]
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07001#
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002# Copyright (C) 2014 The Android Open Source Project
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17header:
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070018summary: Mathematical Constants and Functions
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -070019description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070020 The mathematical functions below can be applied to scalars and vectors. When applied
21 to vectors, the returned value is a vector of the function applied to each entry of the input.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070022
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070023 For example:<code><br/>
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070024 float3 a, b;<br/>
25 // The following call sets<br/>
26 // a.x to sin(b.x),<br/>
27 // a.y to sin(b.y), and<br/>
28 // a.z to sin(b.z).<br/>
29 a = sin(b);<br/>
30 </code>
31
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070032 See <a href='rs_vector_math.html'>Vector Math Functions</a> for functions like @distance() and @length() that interpret
33 instead the input as a single vector in n-dimensional space.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070034
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070035 The precision of the mathematical operations on 32 bit floats is affected by the pragmas
36 rs_fp_relaxed and rs_fp_full. Under rs_fp_relaxed, subnormal values may be flushed to zero and
37 rounding may be done towards zero. In comparison, rs_fp_full requires correct handling of
38 subnormal values, i.e. smaller than 1.17549435e-38f. rs_fp_rull also requires round to nearest
39 with ties to even.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070040
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -070041 Different precision/speed tradeoffs can be achieved by using variants of the common math
42 functions. Functions with a name starting with<ul>
43 <li>native_: May have custom hardware implementations with weaker precision. Additionally,
44 subnormal values may be flushed to zero, rounding towards zero may be used, and NaN and
45 infinity input may not be handled correctly.</li>
46 <li>half_: May perform internal computations using 16 bit floats. Additionally, subnormal
47 values may be flushed to zero, and rounding towards zero may be used.</li>
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070048 </ul>
49end:
50
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -080051# TODO Add f16 versions of these constants.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070052constant: M_1_PI
53value: 0.318309886183790671537767526745028724f
54summary: 1 / pi, as a 32 bit float
55description:
56 The inverse of pi, as a 32 bit float.
57end:
58
59constant: M_2_PI
60value: 0.636619772367581343075535053490057448f
61summary: 2 / pi, as a 32 bit float
62description:
63 2 divided by pi, as a 32 bit float.
64end:
65
66constant: M_2_PIl
67value: 0.636619772367581343075535053490057448f
68hidden:
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -070069deprecated: 22, Use M_2_PI instead.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070070summary: 2 / pi, as a 32 bit float
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070071description:
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -070072 2 divided by pi, as a 32 bit float.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -070073end:
74
75constant: M_2_SQRTPI
76value: 1.128379167095512573896158903121545172f
77summary: 2 / sqrt(pi), as a 32 bit float
78description:
79 2 divided by the square root of pi, as a 32 bit float.
80end:
81
82constant: M_E
83value: 2.718281828459045235360287471352662498f
84summary: e, as a 32 bit float
85description:
86 The number e, the base of the natural logarithm, as a 32 bit float.
87end:
88
89constant: M_LN10
90value: 2.302585092994045684017991454684364208f
91summary: log_e(10), as a 32 bit float
92description:
93 The natural logarithm of 10, as a 32 bit float.
94end:
95
96constant: M_LN2
97value: 0.693147180559945309417232121458176568f
98summary: log_e(2), as a 32 bit float
99description:
100 The natural logarithm of 2, as a 32 bit float.
101end:
102
103constant: M_LOG10E
104value: 0.434294481903251827651128918916605082f
105summary: log_10(e), as a 32 bit float
106description:
107 The logarithm base 10 of e, as a 32 bit float.
108end:
109
110constant: M_LOG2E
111value: 1.442695040888963407359924681001892137f
112summary: log_2(e), as a 32 bit float
113description:
114 The logarithm base 2 of e, as a 32 bit float.
115end:
116
117constant: M_PI
118value: 3.141592653589793238462643383279502884f
119summary: pi, as a 32 bit float
120description:
121 The constant pi, as a 32 bit float.
122end:
123
124constant: M_PI_2
125value: 1.570796326794896619231321691639751442f
126summary: pi / 2, as a 32 bit float
127description:
128 Pi divided by 2, as a 32 bit float.
129end:
130
131constant: M_PI_4
132value: 0.785398163397448309615660845819875721f
133summary: pi / 4, as a 32 bit float
134description:
135 Pi divided by 4, as a 32 bit float.
136end:
137
138constant: M_SQRT1_2
139value: 0.707106781186547524400844362104849039f
140summary: 1 / sqrt(2), as a 32 bit float
141description:
142 The inverse of the square root of 2, as a 32 bit float.
143end:
144
145constant: M_SQRT2
146value: 1.414213562373095048801688724209698079f
147summary: sqrt(2), as a 32 bit float
148description:
149 The square root of 2, as a 32 bit float.
150end:
151
152function: abs
153version: 9
154attrib: const
155w: 1, 2, 3, 4
156t: i8, i16, i32
157ret: u#2#1
158arg: #2#1 v
159summary: Absolute value of an integer
160description:
161 Returns the absolute value of an integer.
162
163 For floats, use @fabs().
164end:
165
166function: acos
167version: 9
168attrib: const
169w: 1, 2, 3, 4
170t: f32
171ret: #2#1
172arg: #2#1 v, range(-1,1)
173summary: Inverse cosine
174description:
175 Returns the inverse cosine, in radians.
176
177 See also @native_acos().
178end:
179
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800180function: acos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800181version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800182attrib: const
183w: 1, 2, 3, 4
184t: f16
185ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700186arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800187end:
188
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700189function: acosh
190version: 9
191attrib: const
192w: 1, 2, 3, 4
193t: f32
194ret: #2#1
195arg: #2#1 v
196summary: Inverse hyperbolic cosine
197description:
198 Returns the inverse hyperbolic cosine, in radians.
199
200 See also @native_acosh().
201end:
202
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800203function: acosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800204version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800205attrib: const
206w: 1, 2, 3, 4
207t: f16
208ret: #2#1
209arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800210end:
211
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700212function: acospi
213version: 9
214attrib: const
215w: 1, 2, 3, 4
216t: f32
217ret: #2#1
218arg: #2#1 v, range(-1,1)
219summary: Inverse cosine divided by pi
220description:
221 Returns the inverse cosine in radians, divided by pi.
222
223 To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
224
225 See also @native_acospi().
226end:
227
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800228function: acospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800229version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800230attrib: const
231w: 1, 2, 3, 4
232t: f16
233ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700234arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800235end:
236
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700237function: asin
238version: 9
239attrib: const
240w: 1, 2, 3, 4
241t: f32
242ret: #2#1
243arg: #2#1 v, range(-1,1)
244summary: Inverse sine
245description:
246 Returns the inverse sine, in radians.
247
248 See also @native_asin().
249end:
250
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800251function: asin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800252version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800253attrib: const
254w: 1, 2, 3, 4
255t: f16
256ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700257arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800258end:
259
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700260function: asinh
261version: 9
262attrib: const
263w: 1, 2, 3, 4
264t: f32
265ret: #2#1
266arg: #2#1 v
267summary: Inverse hyperbolic sine
268description:
269 Returns the inverse hyperbolic sine, in radians.
270
271 See also @native_asinh().
272end:
273
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800274function: asinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800275version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800276attrib: const
277w: 1, 2, 3, 4
278t: f16
279ret: #2#1
280arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800281end:
282
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700283function: asinpi
284version: 9
285attrib: const
286w: 1, 2, 3, 4
287t: f32
288ret: #2#1
289arg: #2#1 v, range(-1,1)
290summary: Inverse sine divided by pi
291description:
292 Returns the inverse sine in radians, divided by pi.
293
294 To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
295
296 See also @native_asinpi().
297end:
298
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800299function: asinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800300version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800301attrib: const
302w: 1, 2, 3, 4
303t: f16
304ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700305arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800306end:
307
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700308function: atan
309version: 9
310attrib: const
311w: 1, 2, 3, 4
312t: f32
313ret: #2#1
314arg: #2#1 v, range(-1,1)
315summary: Inverse tangent
316description:
317 Returns the inverse tangent, in radians.
318
319 See also @native_atan().
320end:
321
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800322function: atan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800323version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800324attrib: const
325w: 1, 2, 3, 4
326t: f16
327ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700328arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800329end:
330
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700331function: atan2
332version: 9
333attrib: const
334w: 1, 2, 3, 4
335t: f32
336ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700337arg: #2#1 numerator, "Numerator."
338arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700339summary: Inverse tangent of a ratio
340description:
341 Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians.
342
343 See also @native_atan2().
344end:
345
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800346function: atan2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800347version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800348attrib: const
349w: 1, 2, 3, 4
350t: f16
351ret: #2#1
352arg: #2#1 numerator
353arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800354end:
355
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700356function: atan2pi
357version: 9
358attrib: const
359w: 1, 2, 3, 4
360t: f32
361ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700362arg: #2#1 numerator, "Numerator."
363arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700364summary: Inverse tangent of a ratio, divided by pi
365description:
366 Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians, divided by pi.
367
368 To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
369
370 See also @native_atan2pi().
371end:
372
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800373function: atan2pi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800374version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800375attrib: const
376w: 1, 2, 3, 4
377t: f16
378ret: #2#1
379arg: #2#1 numerator
380arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800381end:
382
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700383function: atanh
384version: 9
385attrib: const
386w: 1, 2, 3, 4
387t: f32
388ret: #2#1
389arg: #2#1 v, range(-1,1)
390summary: Inverse hyperbolic tangent
391description:
392 Returns the inverse hyperbolic tangent, in radians.
393
394 See also @native_atanh().
395end:
396
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800397function: atanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800398version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800399attrib: const
400w: 1, 2, 3, 4
401t: f16
402ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700403arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800404end:
405
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700406function: atanpi
407version: 9
408attrib: const
409w: 1, 2, 3, 4
410t: f32
411ret: #2#1
412arg: #2#1 v, range(-1,1)
413summary: Inverse tangent divided by pi
414description:
415 Returns the inverse tangent in radians, divided by pi.
416
417 To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
418
419 See also @native_atanpi().
420end:
421
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800422function: atanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800423version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800424attrib: const
425w: 1, 2, 3, 4
426t: f16
427ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -0700428arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800429end:
430
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700431function: cbrt
432version: 9
433attrib: const
434w: 1, 2, 3, 4
435t: f32
436ret: #2#1
437arg: #2#1 v
438summary: Cube root
439description:
440 Returns the cube root.
441
442 See also @native_cbrt().
443end:
444
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800445function: cbrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800446version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800447attrib: const
448w: 1, 2, 3, 4
449t: f16
450ret: #2#1
451arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800452end:
453
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700454function: ceil
455version: 9
456attrib: const
457w: 1, 2, 3, 4
458t: f32
459ret: #2#1
460arg: #2#1 v
461summary: Smallest integer not less than a value
462description:
463 Returns the smallest integer not less than a value.
464
465 For example, <code>ceil(1.2f)</code> returns 2.f, and <code>ceil(-1.2f)</code> returns -1.f.
466
467 See also @floor().
468end:
469
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800470function: ceil
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800471version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800472attrib: const
473w: 1, 2, 3, 4
474t: f16
475ret: #2#1
476arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800477end:
478
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700479function: clamp
480version: 9
481attrib: const
482w: 1, 2, 3, 4
483t: f32
484ret: #2#1
485arg: #2#1 value, "Value to be clamped."
486arg: #2#1 min_value, "Lower bound, a scalar or matching vector."
487arg: #2#1 max_value, above(min_value), "High bound, must match the type of low."
488summary: Restrain a value to a range
489description:
490 Clamps a value to a specified high and low bound. clamp() returns min_value
491 if value &lt; min_value, max_value if value &gt; max_value, otherwise value.
492
493 There are two variants of clamp: one where the min and max are scalars applied
494 to all entries of the value, the other where the min and max are also vectors.
495
496 If min_value is greater than max_value, the results are undefined.
497end:
498
499function: clamp
500version: 9
501attrib: const
502w: 2, 3, 4
503t: f32
504ret: #2#1
505arg: #2#1 value
506arg: #2 min_value
507arg: #2 max_value, above(min_value)
508end:
509
510function: clamp
511version: 19
512attrib: const
513w: 1, 2, 3, 4
514t: u8, u16, u32, u64, i8, i16, i32, i64
515ret: #2#1
516arg: #2#1 value
517arg: #2#1 min_value
518arg: #2#1 max_value, above(min_value)
519end:
520
521function: clamp
522version: 19
523attrib: const
524w: 2, 3, 4
525t: u8, u16, u32, u64, i8, i16, i32, i64
526ret: #2#1
527arg: #2#1 value
528arg: #2 min_value
529arg: #2 max_value, above(min_value)
530end:
531
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800532function: clamp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800533version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800534attrib: const
535w: 1, 2, 3, 4
536t: f16
537ret: #2#1
538arg: #2#1 value
539arg: #2#1 min_value
540arg: #2#1 max_value, above(min_value)
541test: none
542end:
543
544function: clamp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800545version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800546attrib: const
547w: 2, 3, 4
548t: f16
549ret: #2#1
550arg: #2#1 value
551arg: #2 min_value
552arg: #2 max_value, above(min_value)
553test: none
554end:
555
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700556function: clz
557version: 9
558attrib: const
559w: 1, 2, 3, 4
560t: u8, u16, u32, i8, i16, i32
561ret: #2#1
562arg: #2#1 value
563summary: Number of leading 0 bits
564description:
565 Returns the number of leading 0-bits in a value.
566
567 For example, <code>clz((char)0x03)</code> returns 6.
568end:
569
570function: copysign
571version: 9
572attrib: const
573w: 1, 2, 3, 4
574t: f32
575ret: #2#1
576arg: #2#1 magnitude_value
577arg: #2#1 sign_value
578summary: Copies the sign of a number to another
579description:
580 Copies the sign from sign_value to magnitude_value.
581
582 The value returned is either magnitude_value or -magnitude_value.
583
584 For example, <code>copysign(4.0f, -2.7f)</code> returns -4.0f and <code>copysign(-4.0f, 2.7f)</code> returns 4.0f.
585end:
586
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -0800587function: copysign
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800588version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -0800589attrib: const
590w: 1, 2, 3, 4
591t: f16
592ret: #2#1
593arg: #2#1 magnitude_value
594arg: #2#1 sign_value
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -0800595end:
596
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700597function: cos
598version: 9
599attrib: const
600w: 1, 2, 3, 4
601t: f32
602ret: #2#1
603arg: #2#1 v
604summary: Cosine
605description:
606 Returns the cosine of an angle measured in radians.
607
608 See also @native_cos().
609end:
610
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800611function: cos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800612version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800613attrib: const
614w: 1, 2, 3, 4
615t: f16
616ret: #2#1
617arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800618end:
619
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700620function: cosh
621version: 9
622attrib: const
623w: 1, 2, 3, 4
624t: f32
625ret: #2#1
626arg: #2#1 v
627summary: Hypebolic cosine
628description:
629 Returns the hypebolic cosine of v, where v is measured in radians.
630
631 See also @native_cosh().
632end:
633
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800634function: cosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800635version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800636attrib: const
637w: 1, 2, 3, 4
638t: f16
639ret: #2#1
640arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800641end:
642
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700643function: cospi
644version: 9
645attrib: const
646w: 1, 2, 3, 4
647t: f32
648ret: #2#1
649arg: #2#1 v
650summary: Cosine of a number multiplied by pi
651description:
652 Returns the cosine of <code>(v * pi)</code>, where <code>(v * pi)</code> is measured in radians.
653
654 To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
655
656 See also @native_cospi().
657end:
658
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800659function: cospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800660version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800661attrib: const
662w: 1, 2, 3, 4
663t: f16
664ret: #2#1
665arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800666end:
667
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700668function: degrees
669version: 9
670attrib: const
671w: 1, 2, 3, 4
672t: f32
673ret: #2#1
674arg: #2#1 v
675summary: Converts radians into degrees
676description:
677 Converts from radians to degrees.
678end:
679
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800680function: degrees
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800681version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800682attrib: const
683w: 1, 2, 3, 4
684t: f16
685ret: #2#1
686arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800687end:
688
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700689function: erf
690version: 9
691attrib: const
692w: 1, 2, 3, 4
693t: f32
694ret: #2#1
695arg: #2#1 v
696summary: Mathematical error function
697description:
698 Returns the error function.
699end:
700
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800701function: erf
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800702version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800703attrib: const
704w: 1, 2, 3, 4
705t: f16
706ret: #2#1
707arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800708end:
709
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700710function: erfc
711version: 9
712attrib: const
713w: 1, 2, 3, 4
714t: f32
715ret: #2#1
716arg: #2#1 v
717summary: Mathematical complementary error function
718description:
719 Returns the complementary error function.
720end:
721
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800722function: erfc
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800723version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800724attrib: const
725w: 1, 2, 3, 4
726t: f16
727ret: #2#1
728arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800729end:
730
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700731function: exp
732version: 9
733attrib: const
734w: 1, 2, 3, 4
735t: f32
736ret: #2#1
737arg: #2#1 v
738summary: e raised to a number
739description:
740 Returns e raised to v, i.e. e ^ v.
741
742 See also @native_exp().
743end:
744
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800745function: exp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800746version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800747attrib: const
748w: 1, 2, 3, 4
749t: f16
750ret: #2#1
751arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800752end:
753
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700754function: exp10
755version: 9
756attrib: const
757w: 1, 2, 3, 4
758t: f32
759ret: #2#1
760arg: #2#1 v
761summary: 10 raised to a number
762description:
763 Returns 10 raised to v, i.e. 10.f ^ v.
764
765 See also @native_exp10().
766end:
767
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800768function: exp10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800769version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800770attrib: const
771w: 1, 2, 3, 4
772t: f16
773ret: #2#1
774arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800775end:
776
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700777function: exp2
778version: 9
779attrib: const
780w: 1, 2, 3, 4
781t: f32
782ret: #2#1
783arg: #2#1 v
784summary: 2 raised to a number
785description:
786 Returns 2 raised to v, i.e. 2.f ^ v.
787
788 See also @native_exp2().
789end:
790
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800791function: exp2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800792version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800793attrib: const
794w: 1, 2, 3, 4
795t: f16
796ret: #2#1
797arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800798end:
799
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700800function: expm1
801version: 9
802attrib: const
803w: 1, 2, 3, 4
804t: f32
805ret: #2#1
806arg: #2#1 v
807summary: e raised to a number minus one
808description:
809 Returns e raised to v minus 1, i.e. (e ^ v) - 1.
810
811 See also @native_expm1().
812end:
813
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800814function: expm1
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800815version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800816attrib: const
817w: 1, 2, 3, 4
818t: f16
819ret: #2#1
820arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800821end:
822
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700823function: fabs
824version: 9
825attrib: const
826w: 1, 2, 3, 4
827t: f32
828ret: #2#1
829arg: #2#1 v
830summary: Absolute value of a float
831description:
832 Returns the absolute value of the float v.
833
834 For integers, use @abs().
835end:
836
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800837function: fabs
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800838version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800839attrib: const
840w: 1, 2, 3, 4
841t: f16
842ret: #2#1
843arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800844end:
845
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700846function: fdim
847version: 9
848attrib: const
849w: 1, 2, 3, 4
850t: f32
851ret: #2#1
852arg: #2#1 a
853arg: #2#1 b
854summary: Positive difference between two values
855description:
856 Returns the positive difference between two values.
857
858 If a &gt; b, returns (a - b) otherwise returns 0f.
859end:
860
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800861function: fdim
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800862version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800863attrib: const
864w: 1, 2, 3, 4
865t: f16
866ret: #2#1
867arg: #2#1 a
868arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800869end:
870
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700871function: floor
872version: 9
873attrib: const
874w: 1, 2, 3, 4
875t: f32
876ret: #2#1
877arg: #2#1 v
878summary: Smallest integer not greater than a value
879description:
880 Returns the smallest integer not greater than a value.
881
882 For example, <code>floor(1.2f)</code> returns 1.f, and <code>floor(-1.2f)</code> returns -2.f.
883
884 See also @ceil().
885end:
886
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800887function: floor
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800888version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800889attrib: const
890w: 1, 2, 3, 4
891t: f16
892ret: #2#1
893arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800894end:
895
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700896function: fma
897version: 9
898attrib: const
899w: 1, 2, 3, 4
900t: f32
901ret: #2#1
902arg: #2#1 multiplicand1
903arg: #2#1 multiplicand2
904arg: #2#1 offset
905summary: Multiply and add
906description:
907 Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>.
908
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700909 This function is similar to @mad(). fma() retains full precision of the multiplied result
910 and rounds only after the addition. @mad() rounds after the multiplication and the addition.
911 This extra precision is not guaranteed in rs_fp_relaxed mode.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700912end:
913
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800914function: fma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800915version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800916attrib: const
917w: 1, 2, 3, 4
918t: f16
919ret: #2#1
920arg: #2#1 multiplicand1
921arg: #2#1 multiplicand2
922arg: #2#1 offset
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800923end:
924
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700925function: fmax
926version: 9
927attrib: const
928w: 1, 2, 3, 4
929t: f32
930ret: #2#1
931arg: #2#1 a
932arg: #2#1 b
933summary: Maximum of two floats
934description:
935 Returns the maximum of a and b, i.e. <code>(a &lt; b ? b : a)</code>.
936
937 The @max() function returns identical results but can be applied to more data types.
938end:
939
940function: fmax
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800941version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800942attrib: const
943w: 1, 2, 3, 4
944t: f16
945ret: #2#1
946arg: #2#1 a
947arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800948end:
949
950function: fmax
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700951version: 9
952attrib: const
953w: 2, 3, 4
954t: f32
955ret: #2#1
956arg: #2#1 a
957arg: #2 b
958end:
959
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800960function: fmax
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800961version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800962attrib: const
963w: 2, 3, 4
964t: f16
965ret: #2#1
966arg: #2#1 a
967arg: #2 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800968end:
969
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700970function: fmin
971version: 9
972attrib: const
973w: 1, 2, 3, 4
974t: f32
975ret: #2#1
976arg: #2#1 a
977arg: #2#1 b
978summary: Minimum of two floats
979description:
980 Returns the minimum of a and b, i.e. <code>(a &gt; b ? b : a)</code>.
981
982 The @min() function returns identical results but can be applied to more data types.
983end:
984
985function: fmin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800986version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800987attrib: const
988w: 1, 2, 3, 4
989t: f16
990ret: #2#1
991arg: #2#1 a
992arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800993end:
994
995function: fmin
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700996version: 9
997attrib: const
998w: 2, 3, 4
999t: f32
1000ret: #2#1
1001arg: #2#1 a
1002arg: #2 b
1003end:
1004
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001005function: fmin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001006version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001007attrib: const
1008w: 2, 3, 4
1009t: f16
1010ret: #2#1
1011arg: #2#1 a
1012arg: #2 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001013end:
1014
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001015function: fmod
1016version: 9
1017attrib: const
1018w: 1, 2, 3, 4
1019t: f32
1020ret: #2#1
1021arg: #2#1 numerator
1022arg: #2#1 denominator
1023summary: Modulo
1024description:
1025 Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero.
1026
1027 The function @remainder() is similar but rounds toward the closest interger.
1028 For example, <code>fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
1029 while <code>@remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
1030end:
1031
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001032function: fmod
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001033version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001034attrib: const
1035w: 1, 2, 3, 4
1036t: f16
1037ret: #2#1
1038arg: #2#1 numerator
1039arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001040end:
1041
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001042function: fract
1043version: 9
1044w: 1, 2, 3, 4
1045t: f32
1046ret: #2#1
1047arg: #2#1 v, "Input value."
1048arg: #2#1* floor, "If floor is not null, *floor will be set to the floor of v."
1049summary: Positive fractional part
1050description:
1051 Returns the positive fractional part of v, i.e. <code>v - floor(v)</code>.
1052
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001053 For example, <code>fract(1.3f, &amp;val)</code> returns 0.3f and sets val to 1.f.
1054 <code>fract(-1.3f, &amp;val)</code> returns 0.7f and sets val to -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001055end:
1056
1057function: fract
Verena Beckham9cbc99b2015-11-16 12:25:54 +00001058version: 9 23
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001059attrib: const
1060w: 1, 2, 3, 4
1061t: f32
1062ret: #2#1
1063arg: #2#1 v
1064inline:
1065 #2#1 unused;
1066 return fract(v, &unused);
1067end:
1068
Verena Beckham9cbc99b2015-11-16 12:25:54 +00001069function: fract
1070version: 24
1071w: 1, 2, 3, 4
1072t: f32
1073ret: #2#1
1074arg: #2#1 v
1075end:
1076
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001077function: fract
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001078version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001079w: 1, 2, 3, 4
1080t: f16
1081ret: #2#1
1082arg: #2#1 v
1083arg: #2#1* floor
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001084end:
1085
1086function: fract
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001087version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001088w: 1, 2, 3, 4
1089t: f16
1090ret: #2#1
1091arg: #2#1 v
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001092end:
1093
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001094function: frexp
1095version: 9
1096w: 1, 2, 3, 4
1097t: f32
1098ret: #2#1
1099arg: #2#1 v, "Input value."
1100arg: int#1* exponent, "If exponent is not null, *exponent will be set to the exponent of v."
1101summary: Binary mantissa and exponent
1102description:
1103 Returns the binary mantissa and exponent of v, i.e. <code>v == mantissa * 2 ^ exponent</code>.
1104
1105 The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
1106
1107 See @ldexp() for the reverse operation. See also @logb() and @ilogb().
1108end:
1109
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001110function: frexp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001111version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001112w: 1, 2, 3, 4
1113t: f16
1114ret: #2#1
1115arg: #2#1 v
1116arg: int#1* exponent
1117test: none
1118end:
1119
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001120function: half_recip
1121version: 17
1122attrib: const
1123w: 1, 2, 3, 4
1124t: f32
1125ret: #2#1
1126arg: #2#1 v
1127summary: Reciprocal computed to 16 bit precision
1128description:
1129 Returns the approximate reciprocal of a value.
1130
1131 The precision is that of a 16 bit floating point value.
1132
1133 See also @native_recip().
1134end:
1135
1136function: half_rsqrt
1137version: 17
1138attrib: const
1139w: 1, 2, 3, 4
1140t: f32
1141ret: #2#1
1142arg: #2#1 v
1143summary: Reciprocal of a square root computed to 16 bit precision
1144description:
1145 Returns the approximate value of <code>(1.f / sqrt(value))</code>.
1146
1147 The precision is that of a 16 bit floating point value.
1148
1149 See also @rsqrt(), @native_rsqrt().
1150end:
1151
1152function: half_sqrt
1153version: 17
1154attrib: const
1155w: 1, 2, 3, 4
1156t: f32
1157ret: #2#1
1158arg: #2#1 v
1159summary: Square root computed to 16 bit precision
1160description:
1161 Returns the approximate square root of a value.
1162
1163 The precision is that of a 16 bit floating point value.
1164
1165 See also @sqrt(), @native_sqrt().
1166end:
1167
1168function: hypot
1169version: 9
1170attrib: const
1171w: 1, 2, 3, 4
1172t: f32
1173ret: #2#1
1174arg: #2#1 a
1175arg: #2#1 b
1176summary: Hypotenuse
1177description:
1178 Returns the hypotenuse, i.e. <code>sqrt(a * a + b * b)</code>.
1179
1180 See also @native_hypot().
1181end:
1182
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001183function: hypot
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001184version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001185attrib: const
1186w: 1, 2, 3, 4
1187t: f16
1188ret: #2#1
1189arg: #2#1 a
1190arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001191end:
1192
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001193function: ilogb
1194version: 9
1195attrib: const
1196w: 1, 2, 3, 4
1197t: f32
1198ret: int#1
1199arg: float#1 v
1200summary: Base two exponent
1201description:
1202 Returns the base two exponent of a value, where the mantissa is between
1203 1.f (inclusive) and 2.f (exclusive).
1204
1205 For example, <code>ilogb(8.5f)</code> returns 3.
1206
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001207 Because of the difference in mantissa, this number is one less than is returned by @frexp().
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001208
1209 @logb() is similar but returns a float.
1210test: custom
1211end:
1212
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08001213function: ilogb
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001214version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08001215attrib: const
1216w: 1, 2, 3, 4
1217t: f16
1218ret: int#1
1219arg: half#1 v
1220test: none
1221end:
1222
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001223function: ldexp
1224version: 9
1225attrib: const
1226w: 1, 2, 3, 4
1227ret: float#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001228arg: float#1 mantissa, "Mantissa."
1229arg: int#1 exponent, "Exponent, a single component or matching vector."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001230summary: Creates a floating point from mantissa and exponent
1231description:
1232 Returns the floating point created from the mantissa and exponent,
1233 i.e. (mantissa * 2 ^ exponent).
1234
1235 See @frexp() for the reverse operation.
1236end:
1237
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001238function: ldexp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001239version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001240attrib: const
1241w: 1, 2, 3, 4
1242ret: half#1
1243arg: half#1 mantissa
1244arg: int#1 exponent
1245test: none
1246end:
1247
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001248function: ldexp
1249version: 9
1250attrib: const
1251w: 2, 3, 4
1252ret: float#1
1253arg: float#1 mantissa
1254arg: int exponent
1255end:
1256
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001257function: ldexp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001258version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001259attrib: const
1260w: 2, 3, 4
1261ret: half#1
1262arg: half#1 mantissa
1263arg: int exponent
1264test: none
1265end:
1266
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001267function: lgamma
1268version: 9
1269attrib: const
1270w: 1, 2, 3, 4
1271t: f32
1272ret: #2#1
1273arg: #2#1 v
1274summary: Natural logarithm of the gamma function
1275description:
1276 Returns the natural logarithm of the absolute value of the gamma function,
1277 i.e. <code>@log(@fabs(@tgamma(v)))</code>.
1278
1279 See also @tgamma().
1280end:
1281
1282function: lgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001283version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001284attrib: const
1285w: 1, 2, 3, 4
1286t: f16
1287ret: #2#1
1288arg: #2#1 v
1289test: none
1290end:
1291
1292function: lgamma
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001293version: 9
1294w: 1, 2, 3, 4
1295t: f32
1296ret: #2#1
1297arg: #2#1 v
1298arg: int#1* sign_of_gamma, "If sign_of_gamma is not null, *sign_of_gamma will be set to -1.f if the gamma of v is negative, otherwise to 1.f."
1299test: custom
1300#TODO Temporary until bionic & associated drivers are fixed
1301end:
1302
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001303function: lgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001304version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001305w: 1, 2, 3, 4
1306t: f16
1307ret: #2#1
1308arg: #2#1 v
1309arg: int#1* sign_of_gamma
1310test: none
1311end:
1312
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001313function: log
1314version: 9
1315attrib: const
1316w: 1, 2, 3, 4
1317t: f32
1318ret: #2#1
1319arg: #2#1 v
1320summary: Natural logarithm
1321description:
1322 Returns the natural logarithm.
1323
1324 See also @native_log().
1325end:
1326
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001327function: log
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001328version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001329attrib: const
1330w: 1, 2, 3, 4
1331t: f16
1332ret: #2#1
1333arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001334end:
1335
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001336function: log10
1337version: 9
1338attrib: const
1339w: 1, 2, 3, 4
1340t: f32
1341ret: #2#1
1342arg: #2#1 v
1343summary: Base 10 logarithm
1344description:
1345 Returns the base 10 logarithm.
1346
1347 See also @native_log10().
1348end:
1349
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001350function: log10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001351version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001352attrib: const
1353w: 1, 2, 3, 4
1354t: f16
1355ret: #2#1
1356arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001357end:
1358
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001359function: log1p
1360version: 9
1361attrib: const
1362w: 1, 2, 3, 4
1363t: f32
1364ret: #2#1
1365arg: #2#1 v
1366summary: Natural logarithm of a value plus 1
1367description:
1368 Returns the natural logarithm of <code>(v + 1.f)</code>.
1369
1370 See also @native_log1p().
1371end:
1372
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001373function: log1p
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001374version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001375attrib: const
1376w: 1, 2, 3, 4
1377t: f16
1378ret: #2#1
1379arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001380end:
1381
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001382function: log2
1383version: 9
1384attrib: const
1385w: 1, 2, 3, 4
1386t: f32
1387ret: #2#1
1388arg: #2#1 v
1389summary: Base 2 logarithm
1390description:
1391 Returns the base 2 logarithm.
1392
1393 See also @native_log2().
1394end:
1395
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001396function: log2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001397version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001398attrib: const
1399w: 1, 2, 3, 4
1400t: f16
1401ret: #2#1
1402arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001403end:
1404
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001405function: logb
1406version: 9
1407attrib: const
1408w: 1, 2, 3, 4
1409t: f32
1410ret: #2#1
1411arg: #2#1 v
1412summary: Base two exponent
1413description:
1414 Returns the base two exponent of a value, where the mantissa is between
1415 1.f (inclusive) and 2.f (exclusive).
1416
1417 For example, <code>logb(8.5f)</code> returns 3.f.
1418
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001419 Because of the difference in mantissa, this number is one less than is returned by frexp().
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001420
1421 @ilogb() is similar but returns an integer.
1422end:
1423
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001424function: logb
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001425version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001426attrib: const
1427w: 1, 2, 3, 4
1428t: f16
1429ret: #2#1
1430arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001431end:
1432
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001433function: mad
1434version: 9
1435attrib: const
1436w: 1, 2, 3, 4
1437t: f32
1438ret: #2#1
1439arg: #2#1 multiplicand1
1440arg: #2#1 multiplicand2
1441arg: #2#1 offset
1442summary: Multiply and add
1443description:
1444 Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>.
1445
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001446 This function is similar to @fma(). @fma() retains full precision of the multiplied result
1447 and rounds only after the addition. mad() rounds after the multiplication and the addition.
1448 In rs_fp_relaxed mode, mad() may not do the rounding after multiplicaiton.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001449end:
1450
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001451function: mad
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001452version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001453attrib: const
1454w: 1, 2, 3, 4
1455t: f16
1456ret: #2#1
1457arg: #2#1 multiplicand1
1458arg: #2#1 multiplicand2
1459arg: #2#1 offset
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001460end:
1461
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001462function: max
1463version: 9
1464attrib: const
1465w: 1, 2, 3, 4
1466t: f32
1467ret: #2#1
1468arg: #2#1 a
1469arg: #2#1 b
1470summary: Maximum
1471description:
1472 Returns the maximum value of two arguments.
1473end:
1474
1475function: max
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001476version:24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001477attrib: const
1478w: 1, 2, 3, 4
1479t: f16
1480ret: #2#1
1481arg: #2#1 a
1482arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001483end:
1484
1485function: max
Jean-Luc Brouillet7cf263d2015-08-20 17:30:41 -07001486version: 9
1487attrib: const
1488w: 2, 3, 4
1489t: f32
1490ret: #2#1
1491arg: #2#1 a
1492arg: #2 b
1493end:
1494
1495function: max
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001496version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001497attrib: const
1498w: 2, 3, 4
1499t: f16
1500ret: #2#1
1501arg: #2#1 a
1502arg: #2 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001503end:
1504
1505function: max
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001506version: 9 20
1507attrib: const
1508w: 1
1509t: i8, i16, i32, u8, u16, u32
1510ret: #2#1
1511arg: #2#1 a
1512arg: #2#1 b
1513inline:
1514 return (a > b ? a : b);
1515end:
1516
1517function: max
1518version: 9 20
1519attrib: const
1520w: 2
1521t: i8, i16, i32, u8, u16, u32
1522ret: #2#1
1523arg: #2#1 a
1524arg: #2#1 b
1525inline:
1526 #2#1 tmp;
1527 tmp.x = (a.x > b.x ? a.x : b.x);
1528 tmp.y = (a.y > b.y ? a.y : b.y);
1529 return tmp;
1530end:
1531
1532function: max
1533version: 9 20
1534attrib: const
1535w: 3
1536t: i8, i16, i32, u8, u16, u32
1537ret: #2#1
1538arg: #2#1 a
1539arg: #2#1 b
1540inline:
1541 #2#1 tmp;
1542 tmp.x = (a.x > b.x ? a.x : b.x);
1543 tmp.y = (a.y > b.y ? a.y : b.y);
1544 tmp.z = (a.z > b.z ? a.z : b.z);
1545 return tmp;
1546end:
1547
1548function: max
1549version: 9 20
1550attrib: const
1551w: 4
1552t: i8, i16, i32, u8, u16, u32
1553ret: #2#1
1554arg: #2#1 a
1555arg: #2#1 b
1556inline:
1557 #2#1 tmp;
1558 tmp.x = (a.x > b.x ? a.x : b.x);
1559 tmp.y = (a.y > b.y ? a.y : b.y);
1560 tmp.z = (a.z > b.z ? a.z : b.z);
1561 tmp.w = (a.w > b.w ? a.w : b.w);
1562 return tmp;
1563end:
1564
1565function: max
1566version: 21
1567attrib: const
1568w: 1, 2, 3, 4
1569t: i8, i16, i32, i64, u8, u16, u32, u64
1570ret: #2#1
1571arg: #2#1 a
1572arg: #2#1 b
1573end:
1574
1575function: min
1576version: 9
1577attrib: const
1578w: 1, 2, 3, 4
1579t: f32
1580ret: #2#1
1581arg: #2#1 a
1582arg: #2#1 b
1583summary: Minimum
1584description:
1585 Returns the minimum value of two arguments.
1586end:
1587
1588function: min
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001589version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001590attrib: const
1591w: 1, 2, 3, 4
1592t: f16
1593ret: #2#1
1594arg: #2#1 a
1595arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001596end:
1597
1598function: min
Jean-Luc Brouillet7cf263d2015-08-20 17:30:41 -07001599version: 9
1600attrib: const
1601w: 2, 3, 4
1602t: f32
1603ret: #2#1
1604arg: #2#1 a
1605arg: #2 b
1606end:
1607
1608function: min
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001609version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001610attrib: const
1611w: 2, 3, 4
1612t: f16
1613ret: #2#1
1614arg: #2#1 a
1615arg: #2 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001616end:
1617
1618function: min
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001619version: 9 20
1620attrib: const
1621w: 1
1622t: i8, i16, i32, u8, u16, u32
1623ret: #2#1
1624arg: #2#1 a
1625arg: #2#1 b
1626inline:
1627 return (a < b ? a : b);
1628end:
1629
1630function: min
1631version: 9 20
1632attrib: const
1633w: 2
1634t: i8, i16, i32, u8, u16, u32
1635ret: #2#1
1636arg: #2#1 a
1637arg: #2#1 b
1638inline:
1639 #2#1 tmp;
1640 tmp.x = (a.x < b.x ? a.x : b.x);
1641 tmp.y = (a.y < b.y ? a.y : b.y);
1642 return tmp;
1643end:
1644
1645function: min
1646version: 9 20
1647attrib: const
1648w: 3
1649t: i8, i16, i32, u8, u16, u32
1650ret: #2#1
1651arg: #2#1 a
1652arg: #2#1 b
1653inline:
1654 #2#1 tmp;
1655 tmp.x = (a.x < b.x ? a.x : b.x);
1656 tmp.y = (a.y < b.y ? a.y : b.y);
1657 tmp.z = (a.z < b.z ? a.z : b.z);
1658 return tmp;
1659end:
1660
1661function: min
1662version: 9 20
1663attrib: const
1664w: 4
1665t: i8, i16, i32, u8, u16, u32
1666ret: #2#1
1667arg: #2#1 a
1668arg: #2#1 b
1669inline:
1670 #2#1 tmp;
1671 tmp.x = (a.x < b.x ? a.x : b.x);
1672 tmp.y = (a.y < b.y ? a.y : b.y);
1673 tmp.z = (a.z < b.z ? a.z : b.z);
1674 tmp.w = (a.w < b.w ? a.w : b.w);
1675 return tmp;
1676end:
1677
1678function: min
1679version: 21
1680attrib: const
1681w: 1, 2, 3, 4
1682t: i8, i16, i32, i64, u8, u16, u32, u64
1683ret: #2#1
1684arg: #2#1 a
1685arg: #2#1 b
1686end:
1687
1688function: mix
1689version: 9
1690attrib: const
1691w: 1, 2, 3, 4
1692t: f32
1693ret: #2#1
1694arg: #2#1 start
1695arg: #2#1 stop
1696arg: #2#1 fraction
1697summary: Mixes two values
1698description:
1699 Returns start + ((stop - start) * fraction).
1700
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001701 This can be useful for mixing two values. For example, to create a new color that is
1702 40% color1 and 60% color2, use <code>mix(color1, color2, 0.6f)</code>.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001703end:
1704
1705function: mix
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001706version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001707attrib: const
1708w: 1, 2, 3, 4
1709t: f16
1710ret: #2#1
1711arg: #2#1 start
1712arg: #2#1 stop
1713arg: #2#1 fraction
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001714end:
1715
1716function: mix
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001717version: 9
1718attrib: const
1719w: 2, 3, 4
1720t: f32
1721ret: #2#1
1722arg: #2#1 start
1723arg: #2#1 stop
1724arg: #2 fraction
1725end:
1726
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001727function: mix
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001728version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001729attrib: const
1730w: 2, 3, 4
1731t: f16
1732ret: #2#1
1733arg: #2#1 start
1734arg: #2#1 stop
1735arg: #2 fraction
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001736end:
1737
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001738function: modf
1739version: 9
1740w: 1, 2, 3, 4
1741t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001742ret: #2#1, "Floating point portion of the value."
1743arg: #2#1 v, "Source value."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001744arg: #2#1* integral_part, "*integral_part will be set to the integral portion of the number."
1745summary: Integral and fractional components
1746description:
1747 Returns the integral and fractional components of a number.
1748
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001749 Both components will have the same sign as x. For example, for an input of -3.72f,
Pirama Arumuga Nainare6128ff2015-12-06 17:32:42 -08001750 *integral_part will be set to -3.f and .72f will be returned.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001751end:
1752
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001753function: modf
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001754version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001755w: 1, 2, 3, 4
1756t: f16
1757ret: #2#1
1758arg: #2#1 v
1759arg: #2#1* integral_part
1760test: none
1761end:
1762
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001763function: nan
1764version: 9
1765attrib: const
1766w: 1
1767t: f32
1768ret: #2#1
1769arg: uint#1 v, "Not used."
1770#TODO We're not using the argument. Once we do, add this documentation line:
1771# The argument is embedded into the return value and can be used to distinguish various NaNs.
1772summary: Not a Number
1773description:
1774 Returns a NaN value (Not a Number).
1775end:
1776
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001777function: nan_half
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001778version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001779attrib: const
1780t: f16
1781ret: #1
1782summary: Not a Number
1783description:
1784 Returns a half-precision floating point NaN value (Not a Number).
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001785end:
1786
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001787function: native_acos
1788version: 21
1789attrib: const
1790w: 1, 2, 3, 4
1791t: f32
1792ret: #2#1
1793arg: #2#1 v, range(-1,1)
1794summary: Approximate inverse cosine
1795description:
1796 Returns the approximate inverse cosine, in radians.
1797
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001798 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001799
1800 See also @acos().
1801# TODO Temporary
1802test: limited(0.0005)
1803end:
1804
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001805function: native_acos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001806version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001807attrib: const
1808w: 1, 2, 3, 4
1809t: f16
1810ret: #2#1
1811# TODO Need range(-1,1) here similar to the float version?
1812arg: #2#1 v
1813test: none
1814end:
1815
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001816function: native_acosh
1817version: 21
1818attrib: const
1819w: 1, 2, 3, 4
1820t: f32
1821ret: #2#1
1822arg: #2#1 v
1823summary: Approximate inverse hyperbolic cosine
1824description:
1825 Returns the approximate inverse hyperbolic cosine, in radians.
1826
1827 See also @acosh().
1828# TODO Temporary
1829test: limited(0.0005)
1830end:
1831
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001832function: native_acosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001833version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001834attrib: const
1835w: 1, 2, 3, 4
1836t: f16
1837ret: #2#1
1838arg: #2#1 v
1839test: none
1840end:
1841
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001842function: native_acospi
1843version: 21
1844attrib: const
1845w: 1, 2, 3, 4
1846t: f32
1847ret: #2#1
1848arg: #2#1 v, range(-1,1)
1849summary: Approximate inverse cosine divided by pi
1850description:
1851 Returns the approximate inverse cosine in radians, divided by pi.
1852
1853 To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
1854
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001855 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001856
1857 See also @acospi().
1858# TODO Temporary
1859test: limited(0.0005)
1860end:
1861
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001862function: native_acospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001863version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001864attrib: const
1865w: 1, 2, 3, 4
1866t: f16
1867ret: #2#1
1868# TODO Need range(-1,1) here similar to the float version?
1869arg: #2#1 v
1870test: none
1871end:
1872
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001873function: native_asin
1874version: 21
1875attrib: const
1876w: 1, 2, 3, 4
1877t: f32
1878ret: #2#1
1879arg: #2#1 v, range(-1,1)
1880summary: Approximate inverse sine
1881description:
1882 Returns the approximate inverse sine, in radians.
1883
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001884 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001885
1886 See also @asin().
1887# TODO Temporary
1888test: limited(0.0005)
1889end:
1890
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001891function: native_asin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001892version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001893attrib: const
1894w: 1, 2, 3, 4
1895t: f16
1896ret: #2#1
1897# TODO Need range(-1,1) here similar to the float version?
1898arg: #2#1 v
1899test: none
1900end:
1901
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001902function: native_asinh
1903version: 21
1904attrib: const
1905w: 1, 2, 3, 4
1906t: f32
1907ret: #2#1
1908arg: #2#1 v
1909summary: Approximate inverse hyperbolic sine
1910description:
1911 Returns the approximate inverse hyperbolic sine, in radians.
1912
1913 See also @asinh().
1914# TODO Temporary
1915test: limited(0.0005)
1916end:
1917
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001918function: native_asinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001919version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001920attrib: const
1921w: 1, 2, 3, 4
1922t: f16
1923ret: #2#1
1924arg: #2#1 v
1925test: none
1926end:
1927
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001928function: native_asinpi
1929version: 21
1930attrib: const
1931w: 1, 2, 3, 4
1932t: f32
1933ret: #2#1
1934arg: #2#1 v, range(-1,1)
1935summary: Approximate inverse sine divided by pi
1936description:
1937 Returns the approximate inverse sine in radians, divided by pi.
1938
1939 To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
1940
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001941 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001942
1943 See also @asinpi().
1944# TODO Temporary
1945test: limited(0.0005)
1946end:
1947
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001948function: native_asinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001949version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001950attrib: const
1951w: 1, 2, 3, 4
1952t: f16
1953ret: #2#1
1954# TODO Need range(-1,1) here similar to the float version?
1955arg: #2#1 v
1956test: none
1957end:
1958
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001959function: native_atan
1960version: 21
1961attrib: const
1962w: 1, 2, 3, 4
1963t: f32
1964ret: #2#1
1965arg: #2#1 v, range(-1,1)
1966summary: Approximate inverse tangent
1967description:
1968 Returns the approximate inverse tangent, in radians.
1969
1970 See also @atan().
1971# TODO Temporary
1972test: limited(0.0005)
1973end:
1974
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001975function: native_atan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001976version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001977attrib: const
1978w: 1, 2, 3, 4
1979t: f16
1980ret: #2#1
1981# TODO Need range(-1,1) here similar to the float version?
1982arg: #2#1 v
1983test: none
1984end:
1985
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001986function: native_atan2
1987version: 21
1988attrib: const
1989w: 1, 2, 3, 4
1990t: f32
1991ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001992arg: #2#1 numerator, "Numerator."
1993arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001994summary: Approximate inverse tangent of a ratio
1995description:
1996 Returns the approximate inverse tangent of <code>(numerator / denominator)</code>, in radians.
1997
1998 See also @atan2().
1999# TODO Temporary
2000test: limited(0.0005)
2001end:
2002
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002003function: native_atan2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002004version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002005attrib: const
2006w: 1, 2, 3, 4
2007t: f16
2008ret: #2#1
2009arg: #2#1 numerator
2010arg: #2#1 denominator
2011test: none
2012end:
2013
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002014function: native_atan2pi
2015version: 21
2016attrib: const
2017w: 1, 2, 3, 4
2018t: f32
2019ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002020arg: #2#1 numerator, "Numerator."
2021arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002022summary: Approximate inverse tangent of a ratio, divided by pi
2023description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002024 Returns the approximate inverse tangent of <code>(numerator / denominator)</code>,
2025 in radians, divided by pi.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002026
2027 To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
2028
2029 See also @atan2pi().
2030# TODO Temporary
2031test: limited(0.0005)
2032end:
2033
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002034function: native_atan2pi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002035version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002036attrib: const
2037w: 1, 2, 3, 4
2038t: f16
2039ret: #2#1
2040arg: #2#1 numerator
2041arg: #2#1 denominator
2042test: none
2043end:
2044
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002045function: native_atanh
2046version: 21
2047attrib: const
2048w: 1, 2, 3, 4
2049t: f32
2050ret: #2#1
2051arg: #2#1 v, range(-1,1)
2052summary: Approximate inverse hyperbolic tangent
2053description:
2054 Returns the approximate inverse hyperbolic tangent, in radians.
2055
2056 See also @atanh().
2057# TODO Temporary
2058test: limited(0.0005)
2059end:
2060
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002061function: native_atanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002062version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002063attrib: const
2064w: 1, 2, 3, 4
2065t: f16
2066ret: #2#1
2067# TODO Need range(-1,1) here similar to the float version?
2068arg: #2#1 v
2069test: none
2070end:
2071
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002072function: native_atanpi
2073version: 21
2074attrib: const
2075w: 1, 2, 3, 4
2076t: f32
2077ret: #2#1
2078arg: #2#1 v, range(-1,1)
2079summary: Approximate inverse tangent divided by pi
2080description:
2081 Returns the approximate inverse tangent in radians, divided by pi.
2082
2083 To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
2084
2085 See also @atanpi().
2086# TODO Temporary
2087test: limited(0.0005)
2088end:
2089
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002090function: native_atanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002091version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002092attrib: const
2093w: 1, 2, 3, 4
2094t: f16
2095ret: #2#1
2096# TODO Need range(-1,1) here similar to the float version?
2097arg: #2#1 v
2098test: none
2099end:
2100
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002101function: native_cbrt
2102version: 21
2103attrib: const
2104w: 1, 2, 3, 4
2105t: f32
2106ret: #2#1
2107arg: #2#1 v
2108summary: Approximate cube root
2109description:
2110 Returns the approximate cubic root.
2111
2112 See also @cbrt().
2113end:
2114
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002115function: native_cbrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002116version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002117attrib: const
2118w: 1, 2, 3, 4
2119t: f16
2120ret: #2#1
2121arg: #2#1 v
2122test: none
2123end:
2124
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002125function: native_cos
2126version: 21
2127attrib: const
2128w: 1, 2, 3, 4
2129t: f32
2130ret: #2#1
2131arg: #2#1 v
2132summary: Approximate cosine
2133description:
2134 Returns the approximate cosine of an angle measured in radians.
2135
2136 See also @cos().
2137end:
2138
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002139function: native_cos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002140version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002141attrib: const
2142w: 1, 2, 3, 4
2143t: f16
2144ret: #2#1
2145arg: #2#1 v
2146test: none
2147end:
2148
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002149function: native_cosh
2150version: 21
2151attrib: const
2152w: 1, 2, 3, 4
2153t: f32
2154ret: #2#1
2155arg: #2#1 v
2156summary: Approximate hypebolic cosine
2157description:
2158 Returns the approximate hypebolic cosine.
2159
2160 See also @cosh().
2161end:
2162
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002163function: native_cosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002164version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002165attrib: const
2166w: 1, 2, 3, 4
2167t: f16
2168ret: #2#1
2169arg: #2#1 v
2170test: none
2171end:
2172
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002173function: native_cospi
2174version: 21
2175attrib: const
2176w: 1, 2, 3, 4
2177t: f32
2178ret: #2#1
2179arg: #2#1 v
2180summary: Approximate cosine of a number multiplied by pi
2181description:
2182 Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
2183
2184 To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
2185
2186 See also @cospi().
2187end:
2188
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002189function: native_cospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002190version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002191attrib: const
2192w: 1, 2, 3, 4
2193t: f16
2194ret: #2#1
2195arg: #2#1 v
2196test: none
2197end:
2198
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002199function: native_divide
2200version: 21
2201attrib: const
2202w: 1, 2, 3, 4
2203t: f32
2204ret: #2#1
2205arg: #2#1 left_vector
2206arg: #2#1 right_vector
2207summary: Approximate division
2208description:
2209 Computes the approximate division of two values.
2210end:
2211
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002212function: native_divide
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002213version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002214attrib: const
2215w: 1, 2, 3, 4
2216t: f16
2217ret: #2#1
2218arg: #2#1 left_vector
2219arg: #2#1 right_vector
2220test: none
2221end:
2222
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002223function: native_exp
2224version: 18
2225attrib: const
2226w: 1, 2, 3, 4
2227t: f32
2228ret: #2#1
2229arg: #2#1 v, range(-86,86)
2230summary: Approximate e raised to a number
2231description:
2232 Fast approximate exp.
2233
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002234 It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be
2235 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002236
2237 See also @exp().
2238test: limited
2239end:
2240
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002241function: native_exp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002242version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002243attrib: const
2244w: 1, 2, 3, 4
2245t: f16
2246ret: #2#1
2247# TODO Need range(-86, 86) here similar to the float version?
2248arg: #2#1 v
2249test: none
2250end:
2251
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002252function: native_exp10
2253version: 18
2254attrib: const
2255w: 1, 2, 3, 4
2256t: f32
2257ret: #2#1
2258arg: #2#1 v, range(-37,37)
2259summary: Approximate 10 raised to a number
2260description:
2261 Fast approximate exp10.
2262
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002263 It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be
2264 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002265
2266 See also @exp10().
2267test: limited
2268end:
2269
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002270function: native_exp10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002271version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002272attrib: const
2273w: 1, 2, 3, 4
2274t: f16
2275ret: #2#1
2276# TODO Need range(-37, 37) here similar to the float version?
2277arg: #2#1 v
2278test: none
2279end:
2280
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002281function: native_exp2
2282version: 18
2283attrib: const
2284w: 1, 2, 3, 4
2285t: f32
2286ret: #2#1
2287arg: #2#1 v, range(-125,125)
2288summary: Approximate 2 raised to a number
2289description:
2290 Fast approximate exp2.
2291
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002292 It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be
2293 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002294
2295 See also @exp2().
2296test: limited
2297end:
2298
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002299function: native_exp2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002300version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002301attrib: const
2302w: 1, 2, 3, 4
2303t: f16
2304ret: #2#1
2305# TODO Need range(-125, 125) here similar to the float version?
2306arg: #2#1 v
2307test: none
2308end:
2309
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002310function: native_expm1
2311version: 21
2312attrib: const
2313w: 1, 2, 3, 4
2314t: f32
2315ret: #2#1
2316arg: #2#1 v
2317summary: Approximate e raised to a number minus one
2318description:
2319 Returns the approximate (e ^ v) - 1.
2320
2321 See also @expm1().
2322end:
2323
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002324function: native_expm1
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002325version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002326attrib: const
2327w: 1, 2, 3, 4
2328t: f16
2329ret: #2#1
2330arg: #2#1 v
2331test: none
2332end:
2333
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002334function: native_hypot
2335version: 21
2336attrib: const
2337w: 1, 2, 3, 4
2338t: f32
2339ret: #2#1
2340arg: #2#1 a
2341arg: #2#1 b
2342summary: Approximate hypotenuse
2343description:
2344 Returns the approximate native_sqrt(a * a + b * b)
2345
2346 See also @hypot().
2347end:
2348
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002349function: native_hypot
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002350version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002351attrib: const
2352w: 1, 2, 3, 4
2353t: f16
2354ret: #2#1
2355arg: #2#1 a
2356arg: #2#1 b
2357test: none
2358end:
2359
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002360function: native_log
2361version: 18
2362attrib: const
2363w: 1, 2, 3, 4
2364t: f32
2365ret: #2#1
2366arg: #2#1 v, range(10e-10,10e10)
2367summary: Approximate natural logarithm
2368description:
2369 Fast approximate log.
2370
2371 It is not accurate for values very close to zero.
2372
2373 See also @log().
2374test: limited
2375end:
2376
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002377function: native_log
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002378version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002379attrib: const
2380w: 1, 2, 3, 4
2381t: f16
2382ret: #2#1
2383# TODO Need range(10e-10,10e10) here similar to the float version?
2384arg: #2#1 v
2385test: none
2386end:
2387
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002388function: native_log10
2389version: 18
2390attrib: const
2391w: 1, 2, 3, 4
2392t: f32
2393ret: #2#1
2394arg: #2#1 v, range(10e-10,10e10)
2395summary: Approximate base 10 logarithm
2396description:
2397 Fast approximate log10.
2398
2399 It is not accurate for values very close to zero.
2400
2401 See also @log10().
2402test: limited
2403end:
2404
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002405function: native_log10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002406version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002407attrib: const
2408w: 1, 2, 3, 4
2409t: f16
2410ret: #2#1
2411# TODO Need range(10e-10,10e10) here similar to the float version?
2412arg: #2#1 v
2413test: none
2414end:
2415
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002416function: native_log1p
2417version: 21
2418attrib: const
2419w: 1, 2, 3, 4
2420t: f32
2421ret: #2#1
2422arg: #2#1 v
2423summary: Approximate natural logarithm of a value plus 1
2424description:
2425 Returns the approximate natural logarithm of (v + 1.0f)
2426
2427 See also @log1p().
2428end:
2429
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002430function: native_log1p
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002431version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002432attrib: const
2433w: 1, 2, 3, 4
2434t: f16
2435ret: #2#1
2436arg: #2#1 v
2437test: none
2438end:
2439
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002440function: native_log2
2441version: 18
2442attrib: const
2443w: 1, 2, 3, 4
2444t: f32
2445ret: #2#1
2446arg: #2#1 v, range(10e-10,10e10)
2447summary: Approximate base 2 logarithm
2448description:
2449 Fast approximate log2.
2450
2451 It is not accurate for values very close to zero.
2452
2453 See also @log2().
2454test: limited
2455end:
2456
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002457function: native_log2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002458version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002459attrib: const
2460w: 1, 2, 3, 4
2461t: f16
2462ret: #2#1
2463# TODO Need range(10e-10,10e10) here similar to the float version?
2464arg: #2#1 v
2465test: none
2466end:
2467
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002468function: native_powr
2469version: 18
2470attrib: const
2471w: 1, 2, 3, 4
2472t: f32
2473ret: #2#1
2474arg: #2#1 base, range(0,256), "Must be between 0.f and 256.f. The function is not accurate for values very close to zero."
2475arg: #2#1 exponent, range(-15,15), "Must be between -15.f and 15.f."
2476summary: Approximate positive base raised to an exponent
2477description:
2478 Fast approximate (base ^ exponent).
2479
2480 See also @powr().
2481test: limited
2482end:
2483
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002484function: native_powr
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002485version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002486attrib: const
2487w: 1, 2, 3, 4
2488t: f16
2489ret: #2#1
2490# TODO Need range(0, 256) here similar to the float version?
2491arg: #2#1 base
2492# TODO Need range(-15,15) here similar to the float version?
2493arg: #2#1 exponent
2494test: none
2495end:
2496
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002497function: native_recip
2498version: 21
2499attrib: const
2500w: 1, 2, 3, 4
2501t: f32
2502ret: #2#1
2503arg: #2#1 v
2504summary: Approximate reciprocal
2505description:
2506 Returns the approximate approximate reciprocal of a value.
2507
2508 See also @half_recip().
2509end:
2510
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002511function: native_recip
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002512version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002513attrib: const
2514w: 1, 2, 3, 4
2515t: f16
2516ret: #2#1
2517arg: #2#1 v
2518test: none
2519end:
2520
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002521function: native_rootn
2522version: 21
2523attrib: const
2524w: 1, 2, 3, 4
2525t: f32
2526ret: #2#1
2527arg: #2#1 v
2528arg: int#1 n
2529summary: Approximate nth root
2530description:
2531 Compute the approximate Nth root of a value.
2532
2533 See also @rootn().
2534end:
2535
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002536function: native_rootn
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002537version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002538attrib: const
2539w: 1, 2, 3, 4
2540t: f16
2541ret: #2#1
2542arg: #2#1 v
2543arg: int#1 n
2544test: none
2545end:
2546
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002547function: native_rsqrt
2548version: 21
2549attrib: const
2550w: 1, 2, 3, 4
2551t: f32
2552ret: #2#1
2553arg: #2#1 v
2554summary: Approximate reciprocal of a square root
2555description:
2556 Returns approximate (1 / sqrt(v)).
2557
2558 See also @rsqrt(), @half_rsqrt().
2559end:
2560
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002561function: native_rsqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002562version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002563attrib: const
2564w: 1, 2, 3, 4
2565t: f16
2566ret: #2#1
2567arg: #2#1 v
2568test: none
2569end:
2570
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002571function: native_sin
2572version: 21
2573attrib: const
2574w: 1, 2, 3, 4
2575t: f32
2576ret: #2#1
2577arg: #2#1 v
2578summary: Approximate sine
2579description:
2580 Returns the approximate sine of an angle measured in radians.
2581
2582 See also @sin().
2583end:
2584
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002585function: native_sin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002586version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002587attrib: const
2588w: 1, 2, 3, 4
2589t: f16
2590ret: #2#1
2591arg: #2#1 v
2592test: none
2593end:
2594
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002595function: native_sincos
2596version: 21
2597w: 1, 2, 3, 4
2598t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002599ret: #2#1, "Sine."
2600arg: #2#1 v, "Incoming value in radians."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002601arg: #2#1* cos, "*cos will be set to the cosine value."
2602summary: Approximate sine and cosine
2603description:
2604 Returns the approximate sine and cosine of a value.
2605
2606 See also @sincos().
2607# TODO Temporary
2608test: limited(0.0005)
2609end:
2610
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002611function: native_sincos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002612version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002613w: 1, 2, 3, 4
2614t: f16
2615ret: #2#1
2616arg: #2#1 v
2617arg: #2#1* cos
2618test: none
2619end:
2620
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002621function: native_sinh
2622version: 21
2623attrib: const
2624w: 1, 2, 3, 4
2625t: f32
2626ret: #2#1
2627arg: #2#1 v
2628summary: Approximate hyperbolic sine
2629description:
2630 Returns the approximate hyperbolic sine of a value specified in radians.
2631
2632 See also @sinh().
2633end:
2634
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002635function: native_sinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002636version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002637attrib: const
2638w: 1, 2, 3, 4
2639t: f16
2640ret: #2#1
2641arg: #2#1 v
2642test: none
2643end:
2644
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002645function: native_sinpi
2646version: 21
2647attrib: const
2648w: 1, 2, 3, 4
2649t: f32
2650ret: #2#1
2651arg: #2#1 v
2652summary: Approximate sine of a number multiplied by pi
2653description:
2654 Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
2655
2656 To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
2657
2658 See also @sinpi().
2659end:
2660
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002661function: native_sinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002662version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002663attrib: const
2664w: 1, 2, 3, 4
2665t: f16
2666ret: #2#1
2667arg: #2#1 v
2668test: none
2669end:
2670
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002671function: native_sqrt
2672version: 21
2673attrib: const
2674w: 1, 2, 3, 4
2675t: f32
2676ret: #2#1
2677arg: #2#1 v
2678summary: Approximate square root
2679description:
2680 Returns the approximate sqrt(v).
2681
2682 See also @sqrt(), @half_sqrt().
2683end:
2684
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002685function: native_sqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002686version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002687attrib: const
2688w: 1, 2, 3, 4
2689t: f16
2690ret: #2#1
2691arg: #2#1 v
2692test: none
2693end:
2694
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002695function: native_tan
2696version: 21
2697attrib: const
2698w: 1, 2, 3, 4
2699t: f32
2700ret: #2#1
2701arg: #2#1 v
2702summary: Approximate tangent
2703description:
2704 Returns the approximate tangent of an angle measured in radians.
2705end:
2706
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002707function: native_tan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002708version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002709attrib: const
2710w: 1, 2, 3, 4
2711t: f16
2712ret: #2#1
2713arg: #2#1 v
2714test: none
2715end:
2716
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002717function: native_tanh
2718version: 21
2719attrib: const
2720w: 1, 2, 3, 4
2721t: f32
2722ret: #2#1
2723arg: #2#1 v
2724summary: Approximate hyperbolic tangent
2725description:
2726 Returns the approximate hyperbolic tangent of a value.
2727
2728 See also @tanh().
2729end:
2730
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002731function: native_tanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002732version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002733attrib: const
2734w: 1, 2, 3, 4
2735t: f16
2736ret: #2#1
2737arg: #2#1 v
2738test: none
2739end:
2740
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002741function: native_tanpi
2742version: 21
2743attrib: const
2744w: 1, 2, 3, 4
2745t: f32
2746ret: #2#1
2747arg: #2#1 v
2748summary: Approximate tangent of a number multiplied by pi
2749description:
2750 Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
2751
2752 To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
2753
2754 See also @tanpi().
2755end:
2756
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002757function: native_tanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002758version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002759attrib: const
2760w: 1, 2, 3, 4
2761t: f16
2762ret: #2#1
2763arg: #2#1 v
2764test: none
2765end:
2766
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002767function: nextafter
2768version: 9
2769attrib: const
2770w: 1, 2, 3, 4
2771t: f32
2772ret: #2#1
2773arg: #2#1 v
2774arg: #2#1 target
2775summary: Next floating point number
2776description:
2777 Returns the next representable floating point number from v towards target.
2778
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002779 In rs_fp_relaxed mode, a denormalized input value may not yield the next denormalized
2780 value, as support of denormalized values is optional in relaxed mode.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002781end:
2782
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08002783function: nextafter
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002784version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08002785attrib: const
2786w: 1, 2, 3, 4
2787t: f16
2788ret: #2#1
2789arg: #2#1 v
2790arg: #2#1 target
2791test: none
2792end:
2793
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002794function: pow
2795version: 9
2796attrib: const
2797w: 1, 2, 3, 4
2798t: f32
2799ret: #2#1
2800arg: #2#1 base
2801arg: #2#1 exponent
2802summary: Base raised to an exponent
2803description:
2804 Returns base raised to the power exponent, i.e. base ^ exponent.
2805
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002806 @pown() and @powr() are similar. @pown() takes an integer exponent. @powr() assumes the
2807 base to be non-negative.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002808end:
2809
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002810function: pow
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002811version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002812attrib: const
2813w: 1, 2, 3, 4
2814t: f16
2815ret: #2#1
2816arg: #2#1 base
2817arg: #2#1 exponent
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002818end:
2819
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002820function: pown
2821version: 9
2822attrib: const
2823w: 1, 2, 3, 4
2824t: f32
2825ret: #2#1
2826arg: #2#1 base
2827arg: int#1 exponent
2828summary: Base raised to an integer exponent
2829description:
2830 Returns base raised to the power exponent, i.e. base ^ exponent.
2831
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002832 @pow() and @powr() are similar. The both take a float exponent. @powr() also assumes the
2833 base to be non-negative.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002834end:
2835
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002836function: pown
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002837version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002838attrib: const
2839w: 1, 2, 3, 4
2840t: f16
2841ret: #2#1
2842arg: #2#1 base
2843arg: int#1 exponent
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002844end:
2845
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002846function: powr
2847version: 9
2848attrib: const
2849w: 1, 2, 3, 4
2850t: f32
2851ret: #2#1
2852arg: #2#1 base, range(0,3000)
2853arg: #2#1 exponent
2854summary: Positive base raised to an exponent
2855description:
2856 Returns base raised to the power exponent, i.e. base ^ exponent. base must be &gt;= 0.
2857
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002858 @pow() and @pown() are similar. They both make no assumptions about the base.
2859 @pow() takes a float exponent while @pown() take an integer.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002860
2861 See also @native_powr().
2862end:
2863
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002864function: powr
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002865version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002866attrib: const
2867w: 1, 2, 3, 4
2868t: f16
2869ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -07002870arg: #2#1 base, range(0,300)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002871arg: #2#1 exponent
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002872end:
2873
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002874function: radians
2875version: 9
2876attrib: const
2877w: 1, 2, 3, 4
2878t: f32
2879ret: #2#1
2880arg: #2#1 v
2881summary: Converts degrees into radians
2882description:
2883 Converts from degrees to radians.
2884end:
2885
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002886function: radians
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002887version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002888attrib: const
2889w: 1, 2, 3, 4
2890t: f16
2891ret: #2#1
2892arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002893end:
2894
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002895function: remainder
2896version: 9
2897attrib: const
2898w: 1, 2, 3, 4
2899t: f32
2900ret: #2#1
2901arg: #2#1 numerator
2902arg: #2#1 denominator
2903summary: Remainder of a division
2904description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002905 Returns the remainder of (numerator / denominator), where the quotient is rounded towards
2906 the nearest integer.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002907
2908 The function @fmod() is similar but rounds toward the closest interger.
2909 For example, <code>@fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
2910 while <code>remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
2911end:
2912
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002913function: remainder
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002914version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002915attrib: const
2916w: 1, 2, 3, 4
2917t: f16
2918ret: #2#1
2919arg: #2#1 numerator
2920arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002921end:
2922
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002923function: remquo
2924version: 9
2925w: 1, 2, 3, 4
2926t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002927ret: #2#1, "Remainder, precise only for the low three bits."
2928arg: #2#1 numerator, "Numerator."
2929arg: #2#1 denominator, "Denominator."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002930arg: int#1* quotient, "*quotient will be set to the integer quotient."
2931summary: Remainder and quotient of a division
2932description:
2933 Returns the quotient and the remainder of (numerator / denominator).
2934
2935 Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
2936
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002937 This function is useful for implementing periodic functions. The low three bits of the
2938 quotient gives the quadrant and the remainder the distance within the quadrant.
2939 For example, an implementation of @sin(x) could call <code>remquo(x, PI / 2.f, &amp;quadrant)</code>
2940 to reduce very large value of x to something within a limited range.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002941
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002942 Example: <code>remquo(-23.5f, 8.f, &amp;quot)</code> sets the lowest three bits of quot to 3
2943 and the sign negative. It returns 0.5f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002944test: custom
2945end:
2946
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002947function: remquo
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002948version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002949w: 1, 2, 3, 4
2950t: f16
2951ret: #2#1
2952arg: #2#1 numerator
2953arg: #2#1 denominator
2954arg: int#1* quotient
2955test: none
2956end:
2957
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002958function: rint
2959version: 9
2960attrib: const
2961w: 1, 2, 3, 4
2962t: f32
2963ret: #2#1
2964arg: #2#1 v
2965summary: Round to even
2966description:
2967 Rounds to the nearest integral value.
2968
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002969 rint() rounds half values to even. For example, <code>rint(0.5f)</code> returns 0.f and
2970 <code>rint(1.5f)</code> returns 2.f. Similarly, <code>rint(-0.5f)</code> returns -0.f and
2971 <code>rint(-1.5f)</code> returns -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002972
2973 @round() is similar but rounds away from zero. @trunc() truncates the decimal fraction.
2974end:
2975
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002976function: rint
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002977version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002978attrib: const
2979w: 1, 2, 3, 4
2980t: f16
2981ret: #2#1
2982arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002983end:
2984
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002985function: rootn
2986version: 9
2987attrib: const
2988w: 1, 2, 3, 4
2989t: f32
2990ret: #2#1
2991arg: #2#1 v
2992arg: int#1 n
2993summary: Nth root
2994description:
2995 Compute the Nth root of a value.
2996
2997 See also @native_rootn().
2998end:
2999
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003000function: rootn
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003001version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003002attrib: const
3003w: 1, 2, 3, 4
3004t: f16
3005ret: #2#1
3006arg: #2#1 v
3007arg: int#1 n
3008test: none
3009end:
3010
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003011function: round
3012version: 9
3013attrib: const
3014w: 1, 2, 3, 4
3015t: f32
3016ret: #2#1
3017arg: #2#1 v
3018summary: Round away from zero
3019description:
3020 Round to the nearest integral value.
3021
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003022 round() rounds half values away from zero. For example, <code>round(0.5f)</code> returns 1.f
3023 and <code>round(1.5f)</code> returns 2.f. Similarly, <code>round(-0.5f)</code> returns -1.f
3024 and <code>round(-1.5f)</code> returns -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003025
3026 @rint() is similar but rounds half values toward even. @trunc() truncates the decimal fraction.
3027end:
3028
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003029function: round
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003030version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003031attrib: const
3032w: 1, 2, 3, 4
3033t: f16
3034ret: #2#1
3035arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003036end:
3037
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003038function: rsqrt
3039version: 9
3040attrib: const
3041w: 1, 2, 3, 4
3042t: f32
3043ret: #2#1
3044arg: #2#1 v
3045summary: Reciprocal of a square root
3046description:
3047 Returns (1 / sqrt(v)).
3048
3049 See also @half_rsqrt(), @native_rsqrt().
3050end:
3051
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003052function: rsqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003053version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003054attrib: const
3055w: 1, 2, 3, 4
3056t: f16
3057ret: #2#1
3058arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003059end:
3060
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003061function: sign
3062version: 9
3063attrib: const
3064w: 1, 2, 3, 4
3065t: f32
3066ret: #2#1
3067arg: #2#1 v
3068summary: Sign of a value
3069description:
3070 Returns the sign of a value.
3071
3072 if (v &lt; 0) return -1.f;
3073 else if (v &gt; 0) return 1.f;
3074 else return 0.f;
3075end:
3076
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003077function: sign
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003078version:24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003079attrib: const
3080w: 1, 2, 3, 4
3081t: f16
3082ret: #2#1
3083arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003084end:
3085
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003086function: sin
3087version: 9
3088attrib: const
3089w: 1, 2, 3, 4
3090t: f32
3091ret: #2#1
3092arg: #2#1 v
3093summary: Sine
3094description:
3095 Returns the sine of an angle measured in radians.
3096
3097 See also @native_sin().
3098end:
3099
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003100function: sin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003101version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003102attrib: const
3103w: 1, 2, 3, 4
3104t: f16
3105ret: #2#1
3106arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003107end:
3108
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003109function: sincos
3110version: 9
3111w: 1, 2, 3, 4
3112t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003113ret: #2#1, "Sine of v."
3114arg: #2#1 v, "Incoming value in radians."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003115arg: #2#1* cos, "*cos will be set to the cosine value."
3116summary: Sine and cosine
3117description:
3118 Returns the sine and cosine of a value.
3119
3120 See also @native_sincos().
3121end:
3122
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003123function: sincos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003124version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003125w: 1, 2, 3, 4
3126t: f16
3127ret: #2#1
3128arg: #2#1 v
3129arg: #2#1* cos
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003130end:
3131
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003132function: sinh
3133version: 9
3134attrib: const
3135w: 1, 2, 3, 4
3136t: f32
3137ret: #2#1
3138arg: #2#1 v
3139summary: Hyperbolic sine
3140description:
3141 Returns the hyperbolic sine of v, where v is measured in radians.
3142
3143 See also @native_sinh().
3144end:
3145
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003146function: sinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003147version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003148attrib: const
3149w: 1, 2, 3, 4
3150t: f16
3151ret: #2#1
3152arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003153end:
3154
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003155function: sinpi
3156version: 9
3157attrib: const
3158w: 1, 2, 3, 4
3159t: f32
3160ret: #2#1
3161arg: #2#1 v
3162summary: Sine of a number multiplied by pi
3163description:
3164 Returns the sine of (v * pi), where (v * pi) is measured in radians.
3165
3166 To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
3167
3168 See also @native_sinpi().
3169end:
3170
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003171function: sinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003172version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003173attrib: const
3174w: 1, 2, 3, 4
3175t: f16
3176ret: #2#1
3177arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003178end:
3179
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003180function: sqrt
3181version: 9
3182attrib: const
3183w: 1, 2, 3, 4
3184t: f32
3185ret: #2#1
3186arg: #2#1 v
3187summary: Square root
3188description:
3189 Returns the square root of a value.
3190
3191 See also @half_sqrt(), @native_sqrt().
3192end:
3193
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003194function: sqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003195version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003196attrib: const
3197w: 1, 2, 3, 4
3198t: f16
3199ret: #2#1
3200arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003201end:
3202
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003203function: step
3204version: 9
3205attrib: const
3206w: 1, 2, 3, 4
3207t: f32
3208ret: #2#1
3209arg: #2#1 edge
3210arg: #2#1 v
3211summary: 0 if less than a value, 0 otherwise
3212description:
3213 Returns 0.f if v &lt; edge, 1.f otherwise.
3214
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003215 This can be useful to create conditional computations without using loops and branching
3216 instructions. For example, instead of computing <code>(a[i] &lt; b[i]) ? 0.f : @atan2(a[i], b[i])</code>
3217 for the corresponding elements of a vector, you could instead use <code>step(a, b) * @atan2(a, b)</code>.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003218end:
3219
3220function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003221version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003222attrib: const
3223w: 1, 2, 3, 4
3224t: f16
3225ret: #2#1
3226arg: #2#1 edge
3227arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003228end:
3229
3230function: step
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003231version: 9
3232attrib: const
3233w: 2, 3, 4
3234t: f32
3235ret: #2#1
3236arg: #2#1 edge
3237arg: #2 v
3238end:
3239
3240function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003241version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003242attrib: const
3243w: 2, 3, 4
3244t: f16
3245ret: #2#1
3246arg: #2#1 edge
3247arg: #2 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003248end:
3249
3250function: step
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003251version: 21
3252attrib: const
3253w: 2, 3, 4
3254t: f32
3255ret: #2#1
3256arg: #2 edge
3257arg: #2#1 v
3258end:
3259
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003260function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003261version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003262attrib: const
3263w: 2, 3, 4
3264t: f16
3265ret: #2#1
3266arg: #2 edge
3267arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003268end:
3269
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003270function: tan
3271version: 9
3272attrib: const
3273w: 1, 2, 3, 4
3274t: f32
3275ret: #2#1
3276arg: #2#1 v
3277summary: Tangent
3278description:
3279 Returns the tangent of an angle measured in radians.
3280
3281 See also @native_tan().
3282end:
3283
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003284function: tan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003285version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003286attrib: const
3287w: 1, 2, 3, 4
3288t: f16
3289ret: #2#1
3290arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003291end:
3292
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003293function: tanh
3294version: 9
3295attrib: const
3296w: 1, 2, 3, 4
3297t: f32
3298ret: #2#1
3299arg: #2#1 v
3300summary: Hyperbolic tangent
3301description:
3302 Returns the hyperbolic tangent of a value.
3303
3304 See also @native_tanh().
3305end:
3306
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003307function: tanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003308version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003309attrib: const
3310w: 1, 2, 3, 4
3311t: f16
3312ret: #2#1
3313arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003314end:
3315
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003316function: tanpi
3317version: 9
3318attrib: const
3319w: 1, 2, 3, 4
3320t: f32
3321ret: #2#1
3322arg: #2#1 v
3323summary: Tangent of a number multiplied by pi
3324description:
3325 Returns the tangent of (v * pi), where (v * pi) is measured in radians.
3326
3327 To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
3328
3329 See also @native_tanpi().
3330end:
3331
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003332function: tanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003333version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003334attrib: const
3335w: 1, 2, 3, 4
3336t: f16
3337ret: #2#1
3338arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003339end:
3340
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003341function: tgamma
3342version: 9
3343attrib: const
3344w: 1, 2, 3, 4
3345t: f32
3346ret: #2#1
3347arg: #2#1 v
3348summary: Gamma function
3349description:
3350 Returns the gamma function of a value.
3351
3352 See also @lgamma().
3353end:
3354
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003355function: tgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003356version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003357attrib: const
3358w: 1, 2, 3, 4
3359t: f16
3360ret: #2#1
3361arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003362end:
3363
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003364function: trunc
3365version: 9
3366attrib: const
3367w: 1, 2, 3, 4
3368t: f32
3369ret: #2#1
3370arg: #2#1 v
3371summary: Truncates a floating point
3372description:
3373 Rounds to integral using truncation.
3374
3375 For example, <code>trunc(1.7f)</code> returns 1.f and <code>trunc(-1.7f)</code> returns -1.f.
3376
3377 See @rint() and @round() for other rounding options.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003378end:
3379
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003380function: trunc
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003381version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003382attrib: const
3383w: 1, 2, 3, 4
3384t: f16
3385ret: #2#1
3386arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003387end:
3388
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003389function: rsClamp
Verena Beckhama4d25bc2015-11-12 14:20:31 +00003390attrib: const
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003391t: i8, i16, i32, u8, u16, u32
3392ret: #1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003393arg: #1 amount, "Value to clamp."
3394arg: #1 low, "Lower bound."
3395arg: #1 high, "Upper bound."
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -07003396deprecated: 22, Use @clamp() instead.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003397summary: Restrain a value to a range
3398description:
3399 Clamp a value between low and high.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003400test: none
3401end:
3402
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003403function: rsFrac
3404attrib: const
3405ret: float
3406arg: float v
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -07003407deprecated: 22, Use @fract() instead.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -07003408summary: Returns the fractional part of a float
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003409description:
3410 Returns the fractional part of a float
3411test: none
3412end:
3413
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003414function: rsRand
3415ret: int
3416arg: int max_value
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -07003417summary: Pseudo-random number
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003418description:
3419 Return a random value between 0 (or min_value) and max_malue.
3420test: none
3421end:
3422
3423function: rsRand
3424ret: int
3425arg: int min_value
3426arg: int max_value
3427test: none
3428end:
3429
3430function: rsRand
3431ret: float
3432arg: float max_value
3433test: none
3434end:
3435
3436function: rsRand
3437ret: float
3438arg: float min_value
3439arg: float max_value
3440test: none
3441end: