blob: 0320a8c2804c54635e87cc90826086af9c8412f8 [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
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001839end:
1840
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001841function: native_acospi
1842version: 21
1843attrib: const
1844w: 1, 2, 3, 4
1845t: f32
1846ret: #2#1
1847arg: #2#1 v, range(-1,1)
1848summary: Approximate inverse cosine divided by pi
1849description:
1850 Returns the approximate inverse cosine in radians, divided by pi.
1851
1852 To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
1853
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001854 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001855
1856 See also @acospi().
1857# TODO Temporary
1858test: limited(0.0005)
1859end:
1860
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001861function: native_acospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001862version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001863attrib: const
1864w: 1, 2, 3, 4
1865t: f16
1866ret: #2#1
1867# TODO Need range(-1,1) here similar to the float version?
1868arg: #2#1 v
1869test: none
1870end:
1871
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001872function: native_asin
1873version: 21
1874attrib: const
1875w: 1, 2, 3, 4
1876t: f32
1877ret: #2#1
1878arg: #2#1 v, range(-1,1)
1879summary: Approximate inverse sine
1880description:
1881 Returns the approximate inverse sine, in radians.
1882
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001883 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001884
1885 See also @asin().
1886# TODO Temporary
1887test: limited(0.0005)
1888end:
1889
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001890function: native_asin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001891version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001892attrib: const
1893w: 1, 2, 3, 4
1894t: f16
1895ret: #2#1
1896# TODO Need range(-1,1) here similar to the float version?
1897arg: #2#1 v
1898test: none
1899end:
1900
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001901function: native_asinh
1902version: 21
1903attrib: const
1904w: 1, 2, 3, 4
1905t: f32
1906ret: #2#1
1907arg: #2#1 v
1908summary: Approximate inverse hyperbolic sine
1909description:
1910 Returns the approximate inverse hyperbolic sine, in radians.
1911
1912 See also @asinh().
1913# TODO Temporary
1914test: limited(0.0005)
1915end:
1916
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001917function: native_asinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001918version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001919attrib: const
1920w: 1, 2, 3, 4
1921t: f16
1922ret: #2#1
1923arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001924end:
1925
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001926function: native_asinpi
1927version: 21
1928attrib: const
1929w: 1, 2, 3, 4
1930t: f32
1931ret: #2#1
1932arg: #2#1 v, range(-1,1)
1933summary: Approximate inverse sine divided by pi
1934description:
1935 Returns the approximate inverse sine in radians, divided by pi.
1936
1937 To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
1938
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001939 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001940
1941 See also @asinpi().
1942# TODO Temporary
1943test: limited(0.0005)
1944end:
1945
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001946function: native_asinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001947version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001948attrib: const
1949w: 1, 2, 3, 4
1950t: f16
1951ret: #2#1
1952# TODO Need range(-1,1) here similar to the float version?
1953arg: #2#1 v
1954test: none
1955end:
1956
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001957function: native_atan
1958version: 21
1959attrib: const
1960w: 1, 2, 3, 4
1961t: f32
1962ret: #2#1
1963arg: #2#1 v, range(-1,1)
1964summary: Approximate inverse tangent
1965description:
1966 Returns the approximate inverse tangent, in radians.
1967
1968 See also @atan().
1969# TODO Temporary
1970test: limited(0.0005)
1971end:
1972
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001973function: native_atan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001974version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001975attrib: const
1976w: 1, 2, 3, 4
1977t: f16
1978ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07001979arg: #2#1 v, range(-1, 1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001980end:
1981
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001982function: native_atan2
1983version: 21
1984attrib: const
1985w: 1, 2, 3, 4
1986t: f32
1987ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001988arg: #2#1 numerator, "Numerator."
1989arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001990summary: Approximate inverse tangent of a ratio
1991description:
1992 Returns the approximate inverse tangent of <code>(numerator / denominator)</code>, in radians.
1993
1994 See also @atan2().
1995# TODO Temporary
1996test: limited(0.0005)
1997end:
1998
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001999function: native_atan2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002000version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002001attrib: const
2002w: 1, 2, 3, 4
2003t: f16
2004ret: #2#1
2005arg: #2#1 numerator
2006arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002007end:
2008
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002009function: native_atan2pi
2010version: 21
2011attrib: const
2012w: 1, 2, 3, 4
2013t: f32
2014ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002015arg: #2#1 numerator, "Numerator."
2016arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002017summary: Approximate inverse tangent of a ratio, divided by pi
2018description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002019 Returns the approximate inverse tangent of <code>(numerator / denominator)</code>,
2020 in radians, divided by pi.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002021
2022 To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
2023
2024 See also @atan2pi().
2025# TODO Temporary
2026test: limited(0.0005)
2027end:
2028
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002029function: native_atan2pi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002030version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002031attrib: const
2032w: 1, 2, 3, 4
2033t: f16
2034ret: #2#1
2035arg: #2#1 numerator
2036arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002037end:
2038
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002039function: native_atanh
2040version: 21
2041attrib: const
2042w: 1, 2, 3, 4
2043t: f32
2044ret: #2#1
2045arg: #2#1 v, range(-1,1)
2046summary: Approximate inverse hyperbolic tangent
2047description:
2048 Returns the approximate inverse hyperbolic tangent, in radians.
2049
2050 See also @atanh().
2051# TODO Temporary
2052test: limited(0.0005)
2053end:
2054
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002055function: native_atanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002056version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002057attrib: const
2058w: 1, 2, 3, 4
2059t: f16
2060ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002061arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002062end:
2063
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002064function: native_atanpi
2065version: 21
2066attrib: const
2067w: 1, 2, 3, 4
2068t: f32
2069ret: #2#1
2070arg: #2#1 v, range(-1,1)
2071summary: Approximate inverse tangent divided by pi
2072description:
2073 Returns the approximate inverse tangent in radians, divided by pi.
2074
2075 To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
2076
2077 See also @atanpi().
2078# TODO Temporary
2079test: limited(0.0005)
2080end:
2081
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002082function: native_atanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002083version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002084attrib: const
2085w: 1, 2, 3, 4
2086t: f16
2087ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002088arg: #2#1 v, range(-1,1)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002089end:
2090
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002091function: native_cbrt
2092version: 21
2093attrib: const
2094w: 1, 2, 3, 4
2095t: f32
2096ret: #2#1
2097arg: #2#1 v
2098summary: Approximate cube root
2099description:
2100 Returns the approximate cubic root.
2101
2102 See also @cbrt().
2103end:
2104
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002105function: native_cbrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002106version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002107attrib: const
2108w: 1, 2, 3, 4
2109t: f16
2110ret: #2#1
2111arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002112end:
2113
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002114function: native_cos
2115version: 21
2116attrib: const
2117w: 1, 2, 3, 4
2118t: f32
2119ret: #2#1
2120arg: #2#1 v
2121summary: Approximate cosine
2122description:
2123 Returns the approximate cosine of an angle measured in radians.
2124
2125 See also @cos().
2126end:
2127
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002128function: native_cos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002129version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002130attrib: const
2131w: 1, 2, 3, 4
2132t: f16
2133ret: #2#1
2134arg: #2#1 v
2135test: none
2136end:
2137
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002138function: native_cosh
2139version: 21
2140attrib: const
2141w: 1, 2, 3, 4
2142t: f32
2143ret: #2#1
2144arg: #2#1 v
2145summary: Approximate hypebolic cosine
2146description:
2147 Returns the approximate hypebolic cosine.
2148
2149 See also @cosh().
2150end:
2151
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002152function: native_cosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002153version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002154attrib: const
2155w: 1, 2, 3, 4
2156t: f16
2157ret: #2#1
2158arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002159end:
2160
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002161function: native_cospi
2162version: 21
2163attrib: const
2164w: 1, 2, 3, 4
2165t: f32
2166ret: #2#1
2167arg: #2#1 v
2168summary: Approximate cosine of a number multiplied by pi
2169description:
2170 Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
2171
2172 To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
2173
2174 See also @cospi().
2175end:
2176
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002177function: native_cospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002178version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002179attrib: const
2180w: 1, 2, 3, 4
2181t: f16
2182ret: #2#1
2183arg: #2#1 v
2184test: none
2185end:
2186
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002187function: native_divide
2188version: 21
2189attrib: const
2190w: 1, 2, 3, 4
2191t: f32
2192ret: #2#1
2193arg: #2#1 left_vector
2194arg: #2#1 right_vector
2195summary: Approximate division
2196description:
2197 Computes the approximate division of two values.
2198end:
2199
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002200function: native_divide
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002201version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002202attrib: const
2203w: 1, 2, 3, 4
2204t: f16
2205ret: #2#1
2206arg: #2#1 left_vector
2207arg: #2#1 right_vector
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002208end:
2209
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002210function: native_exp
2211version: 18
2212attrib: const
2213w: 1, 2, 3, 4
2214t: f32
2215ret: #2#1
2216arg: #2#1 v, range(-86,86)
2217summary: Approximate e raised to a number
2218description:
2219 Fast approximate exp.
2220
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002221 It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be
2222 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002223
2224 See also @exp().
2225test: limited
2226end:
2227
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002228function: native_exp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002229version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002230attrib: const
2231w: 1, 2, 3, 4
2232t: f16
2233ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002234arg: #2#1 v, range(-86,86)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002235end:
2236
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002237function: native_exp10
2238version: 18
2239attrib: const
2240w: 1, 2, 3, 4
2241t: f32
2242ret: #2#1
2243arg: #2#1 v, range(-37,37)
2244summary: Approximate 10 raised to a number
2245description:
2246 Fast approximate exp10.
2247
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002248 It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be
2249 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002250
2251 See also @exp10().
2252test: limited
2253end:
2254
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002255function: native_exp10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002256version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002257attrib: const
2258w: 1, 2, 3, 4
2259t: f16
2260ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002261arg: #2#1 v, range(-37,37)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002262end:
2263
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002264function: native_exp2
2265version: 18
2266attrib: const
2267w: 1, 2, 3, 4
2268t: f32
2269ret: #2#1
2270arg: #2#1 v, range(-125,125)
2271summary: Approximate 2 raised to a number
2272description:
2273 Fast approximate exp2.
2274
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002275 It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be
2276 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002277
2278 See also @exp2().
2279test: limited
2280end:
2281
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002282function: native_exp2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002283version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002284attrib: const
2285w: 1, 2, 3, 4
2286t: f16
2287ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002288arg: #2#1 v, range(-125,125)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002289end:
2290
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002291function: native_expm1
2292version: 21
2293attrib: const
2294w: 1, 2, 3, 4
2295t: f32
2296ret: #2#1
2297arg: #2#1 v
2298summary: Approximate e raised to a number minus one
2299description:
2300 Returns the approximate (e ^ v) - 1.
2301
2302 See also @expm1().
2303end:
2304
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002305function: native_expm1
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002306version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002307attrib: const
2308w: 1, 2, 3, 4
2309t: f16
2310ret: #2#1
2311arg: #2#1 v
2312test: none
2313end:
2314
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002315function: native_hypot
2316version: 21
2317attrib: const
2318w: 1, 2, 3, 4
2319t: f32
2320ret: #2#1
2321arg: #2#1 a
2322arg: #2#1 b
2323summary: Approximate hypotenuse
2324description:
2325 Returns the approximate native_sqrt(a * a + b * b)
2326
2327 See also @hypot().
2328end:
2329
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002330function: native_hypot
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002331version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002332attrib: const
2333w: 1, 2, 3, 4
2334t: f16
2335ret: #2#1
2336arg: #2#1 a
2337arg: #2#1 b
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002338end:
2339
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002340function: native_log
2341version: 18
2342attrib: const
2343w: 1, 2, 3, 4
2344t: f32
2345ret: #2#1
2346arg: #2#1 v, range(10e-10,10e10)
2347summary: Approximate natural logarithm
2348description:
2349 Fast approximate log.
2350
2351 It is not accurate for values very close to zero.
2352
2353 See also @log().
2354test: limited
2355end:
2356
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002357function: native_log
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002358version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002359attrib: const
2360w: 1, 2, 3, 4
2361t: f16
2362ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002363arg: #2#1 v, range(10e-5,65504)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002364end:
2365
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002366function: native_log10
2367version: 18
2368attrib: const
2369w: 1, 2, 3, 4
2370t: f32
2371ret: #2#1
2372arg: #2#1 v, range(10e-10,10e10)
2373summary: Approximate base 10 logarithm
2374description:
2375 Fast approximate log10.
2376
2377 It is not accurate for values very close to zero.
2378
2379 See also @log10().
2380test: limited
2381end:
2382
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002383function: native_log10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002384version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002385attrib: const
2386w: 1, 2, 3, 4
2387t: f16
2388ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002389arg: #2#1 v, range(10e-5,65504)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002390end:
2391
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002392function: native_log1p
2393version: 21
2394attrib: const
2395w: 1, 2, 3, 4
2396t: f32
2397ret: #2#1
2398arg: #2#1 v
2399summary: Approximate natural logarithm of a value plus 1
2400description:
2401 Returns the approximate natural logarithm of (v + 1.0f)
2402
2403 See also @log1p().
2404end:
2405
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002406function: native_log1p
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002407version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002408attrib: const
2409w: 1, 2, 3, 4
2410t: f16
2411ret: #2#1
2412arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002413end:
2414
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002415function: native_log2
2416version: 18
2417attrib: const
2418w: 1, 2, 3, 4
2419t: f32
2420ret: #2#1
2421arg: #2#1 v, range(10e-10,10e10)
2422summary: Approximate base 2 logarithm
2423description:
2424 Fast approximate log2.
2425
2426 It is not accurate for values very close to zero.
2427
2428 See also @log2().
2429test: limited
2430end:
2431
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002432function: native_log2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002433version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002434attrib: const
2435w: 1, 2, 3, 4
2436t: f16
2437ret: #2#1
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002438arg: #2#1 v, range(10e-5,65504)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002439end:
2440
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002441function: native_powr
2442version: 18
2443attrib: const
2444w: 1, 2, 3, 4
2445t: f32
2446ret: #2#1
2447arg: #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."
2448arg: #2#1 exponent, range(-15,15), "Must be between -15.f and 15.f."
2449summary: Approximate positive base raised to an exponent
2450description:
2451 Fast approximate (base ^ exponent).
2452
2453 See also @powr().
2454test: limited
2455end:
2456
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002457function: native_powr
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
Pirama Arumuga Nainar5a7cc852016-03-25 15:57:23 -07002463arg: #2#1 base, range(0,256)
2464arg: #2#1 exponent, range(-15,15)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002465end:
2466
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002467function: native_recip
2468version: 21
2469attrib: const
2470w: 1, 2, 3, 4
2471t: f32
2472ret: #2#1
2473arg: #2#1 v
2474summary: Approximate reciprocal
2475description:
2476 Returns the approximate approximate reciprocal of a value.
2477
2478 See also @half_recip().
2479end:
2480
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002481function: native_recip
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002482version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002483attrib: const
2484w: 1, 2, 3, 4
2485t: f16
2486ret: #2#1
2487arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002488end:
2489
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002490function: native_rootn
2491version: 21
2492attrib: const
2493w: 1, 2, 3, 4
2494t: f32
2495ret: #2#1
2496arg: #2#1 v
2497arg: int#1 n
2498summary: Approximate nth root
2499description:
2500 Compute the approximate Nth root of a value.
2501
2502 See also @rootn().
2503end:
2504
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002505function: native_rootn
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002506version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002507attrib: const
2508w: 1, 2, 3, 4
2509t: f16
2510ret: #2#1
2511arg: #2#1 v
2512arg: int#1 n
2513test: none
2514end:
2515
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002516function: native_rsqrt
2517version: 21
2518attrib: const
2519w: 1, 2, 3, 4
2520t: f32
2521ret: #2#1
2522arg: #2#1 v
2523summary: Approximate reciprocal of a square root
2524description:
2525 Returns approximate (1 / sqrt(v)).
2526
2527 See also @rsqrt(), @half_rsqrt().
2528end:
2529
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002530function: native_rsqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002531version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002532attrib: const
2533w: 1, 2, 3, 4
2534t: f16
2535ret: #2#1
2536arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002537end:
2538
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002539function: native_sin
2540version: 21
2541attrib: const
2542w: 1, 2, 3, 4
2543t: f32
2544ret: #2#1
2545arg: #2#1 v
2546summary: Approximate sine
2547description:
2548 Returns the approximate sine of an angle measured in radians.
2549
2550 See also @sin().
2551end:
2552
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002553function: native_sin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002554version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002555attrib: const
2556w: 1, 2, 3, 4
2557t: f16
2558ret: #2#1
2559arg: #2#1 v
2560test: none
2561end:
2562
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002563function: native_sincos
2564version: 21
2565w: 1, 2, 3, 4
2566t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002567ret: #2#1, "Sine."
2568arg: #2#1 v, "Incoming value in radians."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002569arg: #2#1* cos, "*cos will be set to the cosine value."
2570summary: Approximate sine and cosine
2571description:
2572 Returns the approximate sine and cosine of a value.
2573
2574 See also @sincos().
2575# TODO Temporary
2576test: limited(0.0005)
2577end:
2578
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002579function: native_sincos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002580version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002581w: 1, 2, 3, 4
2582t: f16
2583ret: #2#1
2584arg: #2#1 v
2585arg: #2#1* cos
2586test: none
2587end:
2588
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002589function: native_sinh
2590version: 21
2591attrib: const
2592w: 1, 2, 3, 4
2593t: f32
2594ret: #2#1
2595arg: #2#1 v
2596summary: Approximate hyperbolic sine
2597description:
2598 Returns the approximate hyperbolic sine of a value specified in radians.
2599
2600 See also @sinh().
2601end:
2602
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002603function: native_sinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002604version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002605attrib: const
2606w: 1, 2, 3, 4
2607t: f16
2608ret: #2#1
2609arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002610end:
2611
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002612function: native_sinpi
2613version: 21
2614attrib: const
2615w: 1, 2, 3, 4
2616t: f32
2617ret: #2#1
2618arg: #2#1 v
2619summary: Approximate sine of a number multiplied by pi
2620description:
2621 Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
2622
2623 To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
2624
2625 See also @sinpi().
2626end:
2627
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002628function: native_sinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002629version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002630attrib: const
2631w: 1, 2, 3, 4
2632t: f16
2633ret: #2#1
2634arg: #2#1 v
2635test: none
2636end:
2637
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002638function: native_sqrt
2639version: 21
2640attrib: const
2641w: 1, 2, 3, 4
2642t: f32
2643ret: #2#1
2644arg: #2#1 v
2645summary: Approximate square root
2646description:
2647 Returns the approximate sqrt(v).
2648
2649 See also @sqrt(), @half_sqrt().
2650end:
2651
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002652function: native_sqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002653version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002654attrib: const
2655w: 1, 2, 3, 4
2656t: f16
2657ret: #2#1
2658arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002659end:
2660
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002661function: native_tan
2662version: 21
2663attrib: const
2664w: 1, 2, 3, 4
2665t: f32
2666ret: #2#1
2667arg: #2#1 v
2668summary: Approximate tangent
2669description:
2670 Returns the approximate tangent of an angle measured in radians.
2671end:
2672
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002673function: native_tan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002674version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002675attrib: const
2676w: 1, 2, 3, 4
2677t: f16
2678ret: #2#1
2679arg: #2#1 v
2680test: none
2681end:
2682
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002683function: native_tanh
2684version: 21
2685attrib: const
2686w: 1, 2, 3, 4
2687t: f32
2688ret: #2#1
2689arg: #2#1 v
2690summary: Approximate hyperbolic tangent
2691description:
2692 Returns the approximate hyperbolic tangent of a value.
2693
2694 See also @tanh().
2695end:
2696
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002697function: native_tanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002698version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002699attrib: const
2700w: 1, 2, 3, 4
2701t: f16
2702ret: #2#1
2703arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002704end:
2705
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002706function: native_tanpi
2707version: 21
2708attrib: const
2709w: 1, 2, 3, 4
2710t: f32
2711ret: #2#1
2712arg: #2#1 v
2713summary: Approximate tangent of a number multiplied by pi
2714description:
2715 Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
2716
2717 To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
2718
2719 See also @tanpi().
2720end:
2721
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002722function: native_tanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002723version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002724attrib: const
2725w: 1, 2, 3, 4
2726t: f16
2727ret: #2#1
2728arg: #2#1 v
2729test: none
2730end:
2731
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002732function: nextafter
2733version: 9
2734attrib: const
2735w: 1, 2, 3, 4
2736t: f32
2737ret: #2#1
2738arg: #2#1 v
2739arg: #2#1 target
2740summary: Next floating point number
2741description:
2742 Returns the next representable floating point number from v towards target.
2743
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002744 In rs_fp_relaxed mode, a denormalized input value may not yield the next denormalized
2745 value, as support of denormalized values is optional in relaxed mode.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002746end:
2747
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08002748function: nextafter
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002749version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08002750attrib: const
2751w: 1, 2, 3, 4
2752t: f16
2753ret: #2#1
2754arg: #2#1 v
2755arg: #2#1 target
2756test: none
2757end:
2758
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002759function: pow
2760version: 9
2761attrib: const
2762w: 1, 2, 3, 4
2763t: f32
2764ret: #2#1
2765arg: #2#1 base
2766arg: #2#1 exponent
2767summary: Base raised to an exponent
2768description:
2769 Returns base raised to the power exponent, i.e. base ^ exponent.
2770
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002771 @pown() and @powr() are similar. @pown() takes an integer exponent. @powr() assumes the
2772 base to be non-negative.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002773end:
2774
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002775function: pow
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002776version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002777attrib: const
2778w: 1, 2, 3, 4
2779t: f16
2780ret: #2#1
2781arg: #2#1 base
2782arg: #2#1 exponent
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002783end:
2784
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002785function: pown
2786version: 9
2787attrib: const
2788w: 1, 2, 3, 4
2789t: f32
2790ret: #2#1
2791arg: #2#1 base
2792arg: int#1 exponent
2793summary: Base raised to an integer exponent
2794description:
2795 Returns base raised to the power exponent, i.e. base ^ exponent.
2796
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002797 @pow() and @powr() are similar. The both take a float exponent. @powr() also assumes the
2798 base to be non-negative.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002799end:
2800
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002801function: pown
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002802version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002803attrib: const
2804w: 1, 2, 3, 4
2805t: f16
2806ret: #2#1
2807arg: #2#1 base
2808arg: int#1 exponent
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002809end:
2810
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002811function: powr
2812version: 9
2813attrib: const
2814w: 1, 2, 3, 4
2815t: f32
2816ret: #2#1
2817arg: #2#1 base, range(0,3000)
2818arg: #2#1 exponent
2819summary: Positive base raised to an exponent
2820description:
2821 Returns base raised to the power exponent, i.e. base ^ exponent. base must be &gt;= 0.
2822
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002823 @pow() and @pown() are similar. They both make no assumptions about the base.
2824 @pow() takes a float exponent while @pown() take an integer.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002825
2826 See also @native_powr().
2827end:
2828
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002829function: powr
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002830version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002831attrib: const
2832w: 1, 2, 3, 4
2833t: f16
2834ret: #2#1
Pirama Arumuga Nainar55f94822016-03-22 11:55:15 -07002835arg: #2#1 base, range(0,300)
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002836arg: #2#1 exponent
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002837end:
2838
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002839function: radians
2840version: 9
2841attrib: const
2842w: 1, 2, 3, 4
2843t: f32
2844ret: #2#1
2845arg: #2#1 v
2846summary: Converts degrees into radians
2847description:
2848 Converts from degrees to radians.
2849end:
2850
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002851function: radians
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002852version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002853attrib: const
2854w: 1, 2, 3, 4
2855t: f16
2856ret: #2#1
2857arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002858end:
2859
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002860function: remainder
2861version: 9
2862attrib: const
2863w: 1, 2, 3, 4
2864t: f32
2865ret: #2#1
2866arg: #2#1 numerator
2867arg: #2#1 denominator
2868summary: Remainder of a division
2869description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002870 Returns the remainder of (numerator / denominator), where the quotient is rounded towards
2871 the nearest integer.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002872
2873 The function @fmod() is similar but rounds toward the closest interger.
2874 For example, <code>@fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
2875 while <code>remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
2876end:
2877
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002878function: remainder
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002879version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002880attrib: const
2881w: 1, 2, 3, 4
2882t: f16
2883ret: #2#1
2884arg: #2#1 numerator
2885arg: #2#1 denominator
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002886end:
2887
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002888function: remquo
2889version: 9
2890w: 1, 2, 3, 4
2891t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002892ret: #2#1, "Remainder, precise only for the low three bits."
2893arg: #2#1 numerator, "Numerator."
2894arg: #2#1 denominator, "Denominator."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002895arg: int#1* quotient, "*quotient will be set to the integer quotient."
2896summary: Remainder and quotient of a division
2897description:
2898 Returns the quotient and the remainder of (numerator / denominator).
2899
2900 Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
2901
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002902 This function is useful for implementing periodic functions. The low three bits of the
2903 quotient gives the quadrant and the remainder the distance within the quadrant.
2904 For example, an implementation of @sin(x) could call <code>remquo(x, PI / 2.f, &amp;quadrant)</code>
2905 to reduce very large value of x to something within a limited range.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002906
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002907 Example: <code>remquo(-23.5f, 8.f, &amp;quot)</code> sets the lowest three bits of quot to 3
2908 and the sign negative. It returns 0.5f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002909test: custom
2910end:
2911
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002912function: remquo
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002913version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002914w: 1, 2, 3, 4
2915t: f16
2916ret: #2#1
2917arg: #2#1 numerator
2918arg: #2#1 denominator
2919arg: int#1* quotient
2920test: none
2921end:
2922
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002923function: rint
2924version: 9
2925attrib: const
2926w: 1, 2, 3, 4
2927t: f32
2928ret: #2#1
2929arg: #2#1 v
2930summary: Round to even
2931description:
2932 Rounds to the nearest integral value.
2933
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002934 rint() rounds half values to even. For example, <code>rint(0.5f)</code> returns 0.f and
2935 <code>rint(1.5f)</code> returns 2.f. Similarly, <code>rint(-0.5f)</code> returns -0.f and
2936 <code>rint(-1.5f)</code> returns -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002937
2938 @round() is similar but rounds away from zero. @trunc() truncates the decimal fraction.
2939end:
2940
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002941function: rint
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002942version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002943attrib: const
2944w: 1, 2, 3, 4
2945t: f16
2946ret: #2#1
2947arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002948end:
2949
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002950function: rootn
2951version: 9
2952attrib: const
2953w: 1, 2, 3, 4
2954t: f32
2955ret: #2#1
2956arg: #2#1 v
2957arg: int#1 n
2958summary: Nth root
2959description:
2960 Compute the Nth root of a value.
2961
2962 See also @native_rootn().
2963end:
2964
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002965function: rootn
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002966version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002967attrib: const
2968w: 1, 2, 3, 4
2969t: f16
2970ret: #2#1
2971arg: #2#1 v
2972arg: int#1 n
2973test: none
2974end:
2975
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002976function: round
2977version: 9
2978attrib: const
2979w: 1, 2, 3, 4
2980t: f32
2981ret: #2#1
2982arg: #2#1 v
2983summary: Round away from zero
2984description:
2985 Round to the nearest integral value.
2986
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002987 round() rounds half values away from zero. For example, <code>round(0.5f)</code> returns 1.f
2988 and <code>round(1.5f)</code> returns 2.f. Similarly, <code>round(-0.5f)</code> returns -1.f
2989 and <code>round(-1.5f)</code> returns -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002990
2991 @rint() is similar but rounds half values toward even. @trunc() truncates the decimal fraction.
2992end:
2993
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002994function: round
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002995version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002996attrib: const
2997w: 1, 2, 3, 4
2998t: f16
2999ret: #2#1
3000arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003001end:
3002
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003003function: rsqrt
3004version: 9
3005attrib: const
3006w: 1, 2, 3, 4
3007t: f32
3008ret: #2#1
3009arg: #2#1 v
3010summary: Reciprocal of a square root
3011description:
3012 Returns (1 / sqrt(v)).
3013
3014 See also @half_rsqrt(), @native_rsqrt().
3015end:
3016
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003017function: rsqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003018version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003019attrib: const
3020w: 1, 2, 3, 4
3021t: f16
3022ret: #2#1
3023arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003024end:
3025
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003026function: sign
3027version: 9
3028attrib: const
3029w: 1, 2, 3, 4
3030t: f32
3031ret: #2#1
3032arg: #2#1 v
3033summary: Sign of a value
3034description:
3035 Returns the sign of a value.
3036
3037 if (v &lt; 0) return -1.f;
3038 else if (v &gt; 0) return 1.f;
3039 else return 0.f;
3040end:
3041
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003042function: sign
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003043version:24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003044attrib: const
3045w: 1, 2, 3, 4
3046t: f16
3047ret: #2#1
3048arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003049end:
3050
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003051function: sin
3052version: 9
3053attrib: const
3054w: 1, 2, 3, 4
3055t: f32
3056ret: #2#1
3057arg: #2#1 v
3058summary: Sine
3059description:
3060 Returns the sine of an angle measured in radians.
3061
3062 See also @native_sin().
3063end:
3064
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003065function: sin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003066version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003067attrib: const
3068w: 1, 2, 3, 4
3069t: f16
3070ret: #2#1
3071arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003072end:
3073
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003074function: sincos
3075version: 9
3076w: 1, 2, 3, 4
3077t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003078ret: #2#1, "Sine of v."
3079arg: #2#1 v, "Incoming value in radians."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003080arg: #2#1* cos, "*cos will be set to the cosine value."
3081summary: Sine and cosine
3082description:
3083 Returns the sine and cosine of a value.
3084
3085 See also @native_sincos().
3086end:
3087
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003088function: sincos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003089version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003090w: 1, 2, 3, 4
3091t: f16
3092ret: #2#1
3093arg: #2#1 v
3094arg: #2#1* cos
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003095end:
3096
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003097function: sinh
3098version: 9
3099attrib: const
3100w: 1, 2, 3, 4
3101t: f32
3102ret: #2#1
3103arg: #2#1 v
3104summary: Hyperbolic sine
3105description:
3106 Returns the hyperbolic sine of v, where v is measured in radians.
3107
3108 See also @native_sinh().
3109end:
3110
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003111function: sinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003112version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003113attrib: const
3114w: 1, 2, 3, 4
3115t: f16
3116ret: #2#1
3117arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003118end:
3119
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003120function: sinpi
3121version: 9
3122attrib: const
3123w: 1, 2, 3, 4
3124t: f32
3125ret: #2#1
3126arg: #2#1 v
3127summary: Sine of a number multiplied by pi
3128description:
3129 Returns the sine of (v * pi), where (v * pi) is measured in radians.
3130
3131 To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
3132
3133 See also @native_sinpi().
3134end:
3135
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003136function: sinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003137version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003138attrib: const
3139w: 1, 2, 3, 4
3140t: f16
3141ret: #2#1
3142arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003143end:
3144
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003145function: sqrt
3146version: 9
3147attrib: const
3148w: 1, 2, 3, 4
3149t: f32
3150ret: #2#1
3151arg: #2#1 v
3152summary: Square root
3153description:
3154 Returns the square root of a value.
3155
3156 See also @half_sqrt(), @native_sqrt().
3157end:
3158
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003159function: sqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003160version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003161attrib: const
3162w: 1, 2, 3, 4
3163t: f16
3164ret: #2#1
3165arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003166end:
3167
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003168function: step
3169version: 9
3170attrib: const
3171w: 1, 2, 3, 4
3172t: f32
3173ret: #2#1
3174arg: #2#1 edge
3175arg: #2#1 v
3176summary: 0 if less than a value, 0 otherwise
3177description:
3178 Returns 0.f if v &lt; edge, 1.f otherwise.
3179
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003180 This can be useful to create conditional computations without using loops and branching
3181 instructions. For example, instead of computing <code>(a[i] &lt; b[i]) ? 0.f : @atan2(a[i], b[i])</code>
3182 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 -07003183end:
3184
3185function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003186version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003187attrib: const
3188w: 1, 2, 3, 4
3189t: f16
3190ret: #2#1
3191arg: #2#1 edge
3192arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003193end:
3194
3195function: step
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003196version: 9
3197attrib: const
3198w: 2, 3, 4
3199t: f32
3200ret: #2#1
3201arg: #2#1 edge
3202arg: #2 v
3203end:
3204
3205function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003206version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003207attrib: const
3208w: 2, 3, 4
3209t: f16
3210ret: #2#1
3211arg: #2#1 edge
3212arg: #2 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003213end:
3214
3215function: step
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003216version: 21
3217attrib: const
3218w: 2, 3, 4
3219t: f32
3220ret: #2#1
3221arg: #2 edge
3222arg: #2#1 v
3223end:
3224
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003225function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003226version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003227attrib: const
3228w: 2, 3, 4
3229t: f16
3230ret: #2#1
3231arg: #2 edge
3232arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003233end:
3234
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003235function: tan
3236version: 9
3237attrib: const
3238w: 1, 2, 3, 4
3239t: f32
3240ret: #2#1
3241arg: #2#1 v
3242summary: Tangent
3243description:
3244 Returns the tangent of an angle measured in radians.
3245
3246 See also @native_tan().
3247end:
3248
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003249function: tan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003250version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003251attrib: const
3252w: 1, 2, 3, 4
3253t: f16
3254ret: #2#1
3255arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003256end:
3257
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003258function: tanh
3259version: 9
3260attrib: const
3261w: 1, 2, 3, 4
3262t: f32
3263ret: #2#1
3264arg: #2#1 v
3265summary: Hyperbolic tangent
3266description:
3267 Returns the hyperbolic tangent of a value.
3268
3269 See also @native_tanh().
3270end:
3271
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003272function: tanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003273version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003274attrib: const
3275w: 1, 2, 3, 4
3276t: f16
3277ret: #2#1
3278arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003279end:
3280
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003281function: tanpi
3282version: 9
3283attrib: const
3284w: 1, 2, 3, 4
3285t: f32
3286ret: #2#1
3287arg: #2#1 v
3288summary: Tangent of a number multiplied by pi
3289description:
3290 Returns the tangent of (v * pi), where (v * pi) is measured in radians.
3291
3292 To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
3293
3294 See also @native_tanpi().
3295end:
3296
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003297function: tanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003298version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003299attrib: const
3300w: 1, 2, 3, 4
3301t: f16
3302ret: #2#1
3303arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003304end:
3305
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003306function: tgamma
3307version: 9
3308attrib: const
3309w: 1, 2, 3, 4
3310t: f32
3311ret: #2#1
3312arg: #2#1 v
3313summary: Gamma function
3314description:
3315 Returns the gamma function of a value.
3316
3317 See also @lgamma().
3318end:
3319
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003320function: tgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003321version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003322attrib: const
3323w: 1, 2, 3, 4
3324t: f16
3325ret: #2#1
3326arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003327end:
3328
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003329function: trunc
3330version: 9
3331attrib: const
3332w: 1, 2, 3, 4
3333t: f32
3334ret: #2#1
3335arg: #2#1 v
3336summary: Truncates a floating point
3337description:
3338 Rounds to integral using truncation.
3339
3340 For example, <code>trunc(1.7f)</code> returns 1.f and <code>trunc(-1.7f)</code> returns -1.f.
3341
3342 See @rint() and @round() for other rounding options.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003343end:
3344
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003345function: trunc
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003346version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003347attrib: const
3348w: 1, 2, 3, 4
3349t: f16
3350ret: #2#1
3351arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003352end:
3353
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003354function: rsClamp
Verena Beckhama4d25bc2015-11-12 14:20:31 +00003355attrib: const
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003356t: i8, i16, i32, u8, u16, u32
3357ret: #1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003358arg: #1 amount, "Value to clamp."
3359arg: #1 low, "Lower bound."
3360arg: #1 high, "Upper bound."
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -07003361deprecated: 22, Use @clamp() instead.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003362summary: Restrain a value to a range
3363description:
3364 Clamp a value between low and high.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003365test: none
3366end:
3367
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003368function: rsFrac
3369attrib: const
3370ret: float
3371arg: float v
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -07003372deprecated: 22, Use @fract() instead.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -07003373summary: Returns the fractional part of a float
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003374description:
3375 Returns the fractional part of a float
3376test: none
3377end:
3378
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003379function: rsRand
3380ret: int
3381arg: int max_value
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -07003382summary: Pseudo-random number
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003383description:
3384 Return a random value between 0 (or min_value) and max_malue.
3385test: none
3386end:
3387
3388function: rsRand
3389ret: int
3390arg: int min_value
3391arg: int max_value
3392test: none
3393end:
3394
3395function: rsRand
3396ret: float
3397arg: float max_value
3398test: none
3399end:
3400
3401function: rsRand
3402ret: float
3403arg: float min_value
3404arg: float max_value
3405test: none
3406end: