blob: ef66f7dc2476522c78eb07c909b3ad62da5911aa [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
186arg: #2#1 v
187test: none
188end:
189
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700190function: acosh
191version: 9
192attrib: const
193w: 1, 2, 3, 4
194t: f32
195ret: #2#1
196arg: #2#1 v
197summary: Inverse hyperbolic cosine
198description:
199 Returns the inverse hyperbolic cosine, in radians.
200
201 See also @native_acosh().
202end:
203
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800204function: acosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800205version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800206attrib: const
207w: 1, 2, 3, 4
208t: f16
209ret: #2#1
210arg: #2#1 v
211test: none
212end:
213
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700214function: acospi
215version: 9
216attrib: const
217w: 1, 2, 3, 4
218t: f32
219ret: #2#1
220arg: #2#1 v, range(-1,1)
221summary: Inverse cosine divided by pi
222description:
223 Returns the inverse cosine in radians, divided by pi.
224
225 To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
226
227 See also @native_acospi().
228end:
229
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800230function: acospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800231version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800232attrib: const
233w: 1, 2, 3, 4
234t: f16
235ret: #2#1
236arg: #2#1 v
237test: none
238end:
239
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700240function: asin
241version: 9
242attrib: const
243w: 1, 2, 3, 4
244t: f32
245ret: #2#1
246arg: #2#1 v, range(-1,1)
247summary: Inverse sine
248description:
249 Returns the inverse sine, in radians.
250
251 See also @native_asin().
252end:
253
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800254function: asin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800255version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800256attrib: const
257w: 1, 2, 3, 4
258t: f16
259ret: #2#1
260arg: #2#1 v
261test: none
262end:
263
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700264function: asinh
265version: 9
266attrib: const
267w: 1, 2, 3, 4
268t: f32
269ret: #2#1
270arg: #2#1 v
271summary: Inverse hyperbolic sine
272description:
273 Returns the inverse hyperbolic sine, in radians.
274
275 See also @native_asinh().
276end:
277
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800278function: asinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800279version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800280attrib: const
281w: 1, 2, 3, 4
282t: f16
283ret: #2#1
284arg: #2#1 v
285test: none
286end:
287
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700288function: asinpi
289version: 9
290attrib: const
291w: 1, 2, 3, 4
292t: f32
293ret: #2#1
294arg: #2#1 v, range(-1,1)
295summary: Inverse sine divided by pi
296description:
297 Returns the inverse sine in radians, divided by pi.
298
299 To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
300
301 See also @native_asinpi().
302end:
303
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800304function: asinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800305version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800306attrib: const
307w: 1, 2, 3, 4
308t: f16
309ret: #2#1
310arg: #2#1 v
311test: none
312end:
313
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700314function: atan
315version: 9
316attrib: const
317w: 1, 2, 3, 4
318t: f32
319ret: #2#1
320arg: #2#1 v, range(-1,1)
321summary: Inverse tangent
322description:
323 Returns the inverse tangent, in radians.
324
325 See also @native_atan().
326end:
327
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800328function: atan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800329version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800330attrib: const
331w: 1, 2, 3, 4
332t: f16
333ret: #2#1
334arg: #2#1 v
335test: none
336end:
337
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700338function: atan2
339version: 9
340attrib: const
341w: 1, 2, 3, 4
342t: f32
343ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700344arg: #2#1 numerator, "Numerator."
345arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700346summary: Inverse tangent of a ratio
347description:
348 Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians.
349
350 See also @native_atan2().
351end:
352
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800353function: atan2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800354version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800355attrib: const
356w: 1, 2, 3, 4
357t: f16
358ret: #2#1
359arg: #2#1 numerator
360arg: #2#1 denominator
361test: none
362end:
363
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700364function: atan2pi
365version: 9
366attrib: const
367w: 1, 2, 3, 4
368t: f32
369ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700370arg: #2#1 numerator, "Numerator."
371arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700372summary: Inverse tangent of a ratio, divided by pi
373description:
374 Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians, divided by pi.
375
376 To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
377
378 See also @native_atan2pi().
379end:
380
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800381function: atan2pi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800382version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800383attrib: const
384w: 1, 2, 3, 4
385t: f16
386ret: #2#1
387arg: #2#1 numerator
388arg: #2#1 denominator
389test: none
390end:
391
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700392function: atanh
393version: 9
394attrib: const
395w: 1, 2, 3, 4
396t: f32
397ret: #2#1
398arg: #2#1 v, range(-1,1)
399summary: Inverse hyperbolic tangent
400description:
401 Returns the inverse hyperbolic tangent, in radians.
402
403 See also @native_atanh().
404end:
405
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800406function: atanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800407version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800408attrib: const
409w: 1, 2, 3, 4
410t: f16
411ret: #2#1
412arg: #2#1 v
413test: none
414end:
415
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700416function: atanpi
417version: 9
418attrib: const
419w: 1, 2, 3, 4
420t: f32
421ret: #2#1
422arg: #2#1 v, range(-1,1)
423summary: Inverse tangent divided by pi
424description:
425 Returns the inverse tangent in radians, divided by pi.
426
427 To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
428
429 See also @native_atanpi().
430end:
431
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800432function: atanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800433version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800434attrib: const
435w: 1, 2, 3, 4
436t: f16
437ret: #2#1
438arg: #2#1 v
439test: none
440end:
441
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700442function: cbrt
443version: 9
444attrib: const
445w: 1, 2, 3, 4
446t: f32
447ret: #2#1
448arg: #2#1 v
449summary: Cube root
450description:
451 Returns the cube root.
452
453 See also @native_cbrt().
454end:
455
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800456function: cbrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800457version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800458attrib: const
459w: 1, 2, 3, 4
460t: f16
461ret: #2#1
462arg: #2#1 v
463test: none
464end:
465
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700466function: ceil
467version: 9
468attrib: const
469w: 1, 2, 3, 4
470t: f32
471ret: #2#1
472arg: #2#1 v
473summary: Smallest integer not less than a value
474description:
475 Returns the smallest integer not less than a value.
476
477 For example, <code>ceil(1.2f)</code> returns 2.f, and <code>ceil(-1.2f)</code> returns -1.f.
478
479 See also @floor().
480end:
481
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800482function: ceil
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800483version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800484attrib: const
485w: 1, 2, 3, 4
486t: f16
487ret: #2#1
488arg: #2#1 v
489test: none
490end:
491
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700492function: clamp
493version: 9
494attrib: const
495w: 1, 2, 3, 4
496t: f32
497ret: #2#1
498arg: #2#1 value, "Value to be clamped."
499arg: #2#1 min_value, "Lower bound, a scalar or matching vector."
500arg: #2#1 max_value, above(min_value), "High bound, must match the type of low."
501summary: Restrain a value to a range
502description:
503 Clamps a value to a specified high and low bound. clamp() returns min_value
504 if value &lt; min_value, max_value if value &gt; max_value, otherwise value.
505
506 There are two variants of clamp: one where the min and max are scalars applied
507 to all entries of the value, the other where the min and max are also vectors.
508
509 If min_value is greater than max_value, the results are undefined.
510end:
511
512function: clamp
513version: 9
514attrib: const
515w: 2, 3, 4
516t: f32
517ret: #2#1
518arg: #2#1 value
519arg: #2 min_value
520arg: #2 max_value, above(min_value)
521end:
522
523function: clamp
524version: 19
525attrib: const
526w: 1, 2, 3, 4
527t: u8, u16, u32, u64, i8, i16, i32, i64
528ret: #2#1
529arg: #2#1 value
530arg: #2#1 min_value
531arg: #2#1 max_value, above(min_value)
532end:
533
534function: clamp
535version: 19
536attrib: const
537w: 2, 3, 4
538t: u8, u16, u32, u64, i8, i16, i32, i64
539ret: #2#1
540arg: #2#1 value
541arg: #2 min_value
542arg: #2 max_value, above(min_value)
543end:
544
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800545function: clamp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800546version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800547attrib: const
548w: 1, 2, 3, 4
549t: f16
550ret: #2#1
551arg: #2#1 value
552arg: #2#1 min_value
553arg: #2#1 max_value, above(min_value)
554test: none
555end:
556
557function: clamp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800558version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800559attrib: const
560w: 2, 3, 4
561t: f16
562ret: #2#1
563arg: #2#1 value
564arg: #2 min_value
565arg: #2 max_value, above(min_value)
566test: none
567end:
568
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700569function: clz
570version: 9
571attrib: const
572w: 1, 2, 3, 4
573t: u8, u16, u32, i8, i16, i32
574ret: #2#1
575arg: #2#1 value
576summary: Number of leading 0 bits
577description:
578 Returns the number of leading 0-bits in a value.
579
580 For example, <code>clz((char)0x03)</code> returns 6.
581end:
582
583function: copysign
584version: 9
585attrib: const
586w: 1, 2, 3, 4
587t: f32
588ret: #2#1
589arg: #2#1 magnitude_value
590arg: #2#1 sign_value
591summary: Copies the sign of a number to another
592description:
593 Copies the sign from sign_value to magnitude_value.
594
595 The value returned is either magnitude_value or -magnitude_value.
596
597 For example, <code>copysign(4.0f, -2.7f)</code> returns -4.0f and <code>copysign(-4.0f, 2.7f)</code> returns 4.0f.
598end:
599
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -0800600function: copysign
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800601version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -0800602attrib: const
603w: 1, 2, 3, 4
604t: f16
605ret: #2#1
606arg: #2#1 magnitude_value
607arg: #2#1 sign_value
608test: none
609end:
610
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700611function: cos
612version: 9
613attrib: const
614w: 1, 2, 3, 4
615t: f32
616ret: #2#1
617arg: #2#1 v
618summary: Cosine
619description:
620 Returns the cosine of an angle measured in radians.
621
622 See also @native_cos().
623end:
624
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800625function: cos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800626version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800627attrib: const
628w: 1, 2, 3, 4
629t: f16
630ret: #2#1
631arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800632end:
633
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700634function: cosh
635version: 9
636attrib: const
637w: 1, 2, 3, 4
638t: f32
639ret: #2#1
640arg: #2#1 v
641summary: Hypebolic cosine
642description:
643 Returns the hypebolic cosine of v, where v is measured in radians.
644
645 See also @native_cosh().
646end:
647
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800648function: cosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800649version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800650attrib: const
651w: 1, 2, 3, 4
652t: f16
653ret: #2#1
654arg: #2#1 v
655test: none
656end:
657
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700658function: cospi
659version: 9
660attrib: const
661w: 1, 2, 3, 4
662t: f32
663ret: #2#1
664arg: #2#1 v
665summary: Cosine of a number multiplied by pi
666description:
667 Returns the cosine of <code>(v * pi)</code>, where <code>(v * pi)</code> is measured in radians.
668
669 To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
670
671 See also @native_cospi().
672end:
673
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800674function: cospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800675version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800676attrib: const
677w: 1, 2, 3, 4
678t: f16
679ret: #2#1
680arg: #2#1 v
681test: none
682end:
683
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700684function: degrees
685version: 9
686attrib: const
687w: 1, 2, 3, 4
688t: f32
689ret: #2#1
690arg: #2#1 v
691summary: Converts radians into degrees
692description:
693 Converts from radians to degrees.
694end:
695
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800696function: degrees
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800697version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800698attrib: const
699w: 1, 2, 3, 4
700t: f16
701ret: #2#1
702arg: #2#1 v
703test: none
704end:
705
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700706function: erf
707version: 9
708attrib: const
709w: 1, 2, 3, 4
710t: f32
711ret: #2#1
712arg: #2#1 v
713summary: Mathematical error function
714description:
715 Returns the error function.
716end:
717
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800718function: erf
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800719version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800720attrib: const
721w: 1, 2, 3, 4
722t: f16
723ret: #2#1
724arg: #2#1 v
725test: none
726end:
727
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700728function: erfc
729version: 9
730attrib: const
731w: 1, 2, 3, 4
732t: f32
733ret: #2#1
734arg: #2#1 v
735summary: Mathematical complementary error function
736description:
737 Returns the complementary error function.
738end:
739
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800740function: erfc
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800741version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800742attrib: const
743w: 1, 2, 3, 4
744t: f16
745ret: #2#1
746arg: #2#1 v
747test: none
748end:
749
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700750function: exp
751version: 9
752attrib: const
753w: 1, 2, 3, 4
754t: f32
755ret: #2#1
756arg: #2#1 v
757summary: e raised to a number
758description:
759 Returns e raised to v, i.e. e ^ v.
760
761 See also @native_exp().
762end:
763
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800764function: exp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800765version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800766attrib: const
767w: 1, 2, 3, 4
768t: f16
769ret: #2#1
770arg: #2#1 v
771test: none
772end:
773
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700774function: exp10
775version: 9
776attrib: const
777w: 1, 2, 3, 4
778t: f32
779ret: #2#1
780arg: #2#1 v
781summary: 10 raised to a number
782description:
783 Returns 10 raised to v, i.e. 10.f ^ v.
784
785 See also @native_exp10().
786end:
787
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800788function: exp10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800789version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800790attrib: const
791w: 1, 2, 3, 4
792t: f16
793ret: #2#1
794arg: #2#1 v
795test: none
796end:
797
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700798function: exp2
799version: 9
800attrib: const
801w: 1, 2, 3, 4
802t: f32
803ret: #2#1
804arg: #2#1 v
805summary: 2 raised to a number
806description:
807 Returns 2 raised to v, i.e. 2.f ^ v.
808
809 See also @native_exp2().
810end:
811
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800812function: exp2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800813version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800814attrib: const
815w: 1, 2, 3, 4
816t: f16
817ret: #2#1
818arg: #2#1 v
819test: none
820end:
821
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700822function: expm1
823version: 9
824attrib: const
825w: 1, 2, 3, 4
826t: f32
827ret: #2#1
828arg: #2#1 v
829summary: e raised to a number minus one
830description:
831 Returns e raised to v minus 1, i.e. (e ^ v) - 1.
832
833 See also @native_expm1().
834end:
835
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800836function: expm1
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800837version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800838attrib: const
839w: 1, 2, 3, 4
840t: f16
841ret: #2#1
842arg: #2#1 v
843test: none
844end:
845
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700846function: fabs
847version: 9
848attrib: const
849w: 1, 2, 3, 4
850t: f32
851ret: #2#1
852arg: #2#1 v
853summary: Absolute value of a float
854description:
855 Returns the absolute value of the float v.
856
857 For integers, use @abs().
858end:
859
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800860function: fabs
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800861version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800862attrib: const
863w: 1, 2, 3, 4
864t: f16
865ret: #2#1
866arg: #2#1 v
867test: none
868end:
869
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700870function: fdim
871version: 9
872attrib: const
873w: 1, 2, 3, 4
874t: f32
875ret: #2#1
876arg: #2#1 a
877arg: #2#1 b
878summary: Positive difference between two values
879description:
880 Returns the positive difference between two values.
881
882 If a &gt; b, returns (a - b) otherwise returns 0f.
883end:
884
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800885function: fdim
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800886version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800887attrib: const
888w: 1, 2, 3, 4
889t: f16
890ret: #2#1
891arg: #2#1 a
892arg: #2#1 b
893test: none
894end:
895
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700896function: floor
897version: 9
898attrib: const
899w: 1, 2, 3, 4
900t: f32
901ret: #2#1
902arg: #2#1 v
903summary: Smallest integer not greater than a value
904description:
905 Returns the smallest integer not greater than a value.
906
907 For example, <code>floor(1.2f)</code> returns 1.f, and <code>floor(-1.2f)</code> returns -2.f.
908
909 See also @ceil().
910end:
911
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800912function: floor
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800913version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800914attrib: const
915w: 1, 2, 3, 4
916t: f16
917ret: #2#1
918arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800919end:
920
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700921function: fma
922version: 9
923attrib: const
924w: 1, 2, 3, 4
925t: f32
926ret: #2#1
927arg: #2#1 multiplicand1
928arg: #2#1 multiplicand2
929arg: #2#1 offset
930summary: Multiply and add
931description:
932 Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>.
933
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -0700934 This function is similar to @mad(). fma() retains full precision of the multiplied result
935 and rounds only after the addition. @mad() rounds after the multiplication and the addition.
936 This extra precision is not guaranteed in rs_fp_relaxed mode.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700937end:
938
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800939function: fma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800940version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800941attrib: const
942w: 1, 2, 3, 4
943t: f16
944ret: #2#1
945arg: #2#1 multiplicand1
946arg: #2#1 multiplicand2
947arg: #2#1 offset
948test: none
949end:
950
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700951function: fmax
952version: 9
953attrib: const
954w: 1, 2, 3, 4
955t: f32
956ret: #2#1
957arg: #2#1 a
958arg: #2#1 b
959summary: Maximum of two floats
960description:
961 Returns the maximum of a and b, i.e. <code>(a &lt; b ? b : a)</code>.
962
963 The @max() function returns identical results but can be applied to more data types.
964end:
965
966function: fmax
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800967version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800968attrib: const
969w: 1, 2, 3, 4
970t: f16
971ret: #2#1
972arg: #2#1 a
973arg: #2#1 b
974test: none
975end:
976
977function: fmax
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700978version: 9
979attrib: const
980w: 2, 3, 4
981t: f32
982ret: #2#1
983arg: #2#1 a
984arg: #2 b
985end:
986
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800987function: fmax
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -0800988version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -0800989attrib: const
990w: 2, 3, 4
991t: f16
992ret: #2#1
993arg: #2#1 a
994arg: #2 b
995test: none
996end:
997
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -0700998function: fmin
999version: 9
1000attrib: const
1001w: 1, 2, 3, 4
1002t: f32
1003ret: #2#1
1004arg: #2#1 a
1005arg: #2#1 b
1006summary: Minimum of two floats
1007description:
1008 Returns the minimum of a and b, i.e. <code>(a &gt; b ? b : a)</code>.
1009
1010 The @min() function returns identical results but can be applied to more data types.
1011end:
1012
1013function: fmin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001014version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001015attrib: const
1016w: 1, 2, 3, 4
1017t: f16
1018ret: #2#1
1019arg: #2#1 a
1020arg: #2#1 b
1021test: none
1022end:
1023
1024function: fmin
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001025version: 9
1026attrib: const
1027w: 2, 3, 4
1028t: f32
1029ret: #2#1
1030arg: #2#1 a
1031arg: #2 b
1032end:
1033
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001034function: fmin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001035version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001036attrib: const
1037w: 2, 3, 4
1038t: f16
1039ret: #2#1
1040arg: #2#1 a
1041arg: #2 b
1042test: none
1043end:
1044
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001045function: fmod
1046version: 9
1047attrib: const
1048w: 1, 2, 3, 4
1049t: f32
1050ret: #2#1
1051arg: #2#1 numerator
1052arg: #2#1 denominator
1053summary: Modulo
1054description:
1055 Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero.
1056
1057 The function @remainder() is similar but rounds toward the closest interger.
1058 For example, <code>fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
1059 while <code>@remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
1060end:
1061
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001062function: fmod
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001063version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001064attrib: const
1065w: 1, 2, 3, 4
1066t: f16
1067ret: #2#1
1068arg: #2#1 numerator
1069arg: #2#1 denominator
1070test: none
1071end:
1072
1073# TODO Add (both variants) of fract for f16
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001074function: fract
1075version: 9
1076w: 1, 2, 3, 4
1077t: f32
1078ret: #2#1
1079arg: #2#1 v, "Input value."
1080arg: #2#1* floor, "If floor is not null, *floor will be set to the floor of v."
1081summary: Positive fractional part
1082description:
1083 Returns the positive fractional part of v, i.e. <code>v - floor(v)</code>.
1084
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001085 For example, <code>fract(1.3f, &amp;val)</code> returns 0.3f and sets val to 1.f.
1086 <code>fract(-1.3f, &amp;val)</code> returns 0.7f and sets val to -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001087end:
1088
1089function: fract
Verena Beckham9cbc99b2015-11-16 12:25:54 +00001090version: 9 23
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001091attrib: const
1092w: 1, 2, 3, 4
1093t: f32
1094ret: #2#1
1095arg: #2#1 v
1096inline:
1097 #2#1 unused;
1098 return fract(v, &unused);
1099end:
1100
Verena Beckham9cbc99b2015-11-16 12:25:54 +00001101function: fract
1102version: 24
1103w: 1, 2, 3, 4
1104t: f32
1105ret: #2#1
1106arg: #2#1 v
1107end:
1108
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001109function: fract
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001110version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001111w: 1, 2, 3, 4
1112t: f16
1113ret: #2#1
1114arg: #2#1 v
1115arg: #2#1* floor
1116test: none
1117end:
1118
1119function: fract
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001120version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001121w: 1, 2, 3, 4
1122t: f16
1123ret: #2#1
1124arg: #2#1 v
1125test: none
1126end:
1127
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001128# TODO Add f16 frexp
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001129function: frexp
1130version: 9
1131w: 1, 2, 3, 4
1132t: f32
1133ret: #2#1
1134arg: #2#1 v, "Input value."
1135arg: int#1* exponent, "If exponent is not null, *exponent will be set to the exponent of v."
1136summary: Binary mantissa and exponent
1137description:
1138 Returns the binary mantissa and exponent of v, i.e. <code>v == mantissa * 2 ^ exponent</code>.
1139
1140 The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
1141
1142 See @ldexp() for the reverse operation. See also @logb() and @ilogb().
1143end:
1144
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001145function: frexp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001146version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001147w: 1, 2, 3, 4
1148t: f16
1149ret: #2#1
1150arg: #2#1 v
1151arg: int#1* exponent
1152test: none
1153end:
1154
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001155function: half_recip
1156version: 17
1157attrib: const
1158w: 1, 2, 3, 4
1159t: f32
1160ret: #2#1
1161arg: #2#1 v
1162summary: Reciprocal computed to 16 bit precision
1163description:
1164 Returns the approximate reciprocal of a value.
1165
1166 The precision is that of a 16 bit floating point value.
1167
1168 See also @native_recip().
1169end:
1170
1171function: half_rsqrt
1172version: 17
1173attrib: const
1174w: 1, 2, 3, 4
1175t: f32
1176ret: #2#1
1177arg: #2#1 v
1178summary: Reciprocal of a square root computed to 16 bit precision
1179description:
1180 Returns the approximate value of <code>(1.f / sqrt(value))</code>.
1181
1182 The precision is that of a 16 bit floating point value.
1183
1184 See also @rsqrt(), @native_rsqrt().
1185end:
1186
1187function: half_sqrt
1188version: 17
1189attrib: const
1190w: 1, 2, 3, 4
1191t: f32
1192ret: #2#1
1193arg: #2#1 v
1194summary: Square root computed to 16 bit precision
1195description:
1196 Returns the approximate square root of a value.
1197
1198 The precision is that of a 16 bit floating point value.
1199
1200 See also @sqrt(), @native_sqrt().
1201end:
1202
1203function: hypot
1204version: 9
1205attrib: const
1206w: 1, 2, 3, 4
1207t: f32
1208ret: #2#1
1209arg: #2#1 a
1210arg: #2#1 b
1211summary: Hypotenuse
1212description:
1213 Returns the hypotenuse, i.e. <code>sqrt(a * a + b * b)</code>.
1214
1215 See also @native_hypot().
1216end:
1217
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001218function: hypot
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001219version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001220attrib: const
1221w: 1, 2, 3, 4
1222t: f16
1223ret: #2#1
1224arg: #2#1 a
1225arg: #2#1 b
1226test: none
1227end:
1228
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001229function: ilogb
1230version: 9
1231attrib: const
1232w: 1, 2, 3, 4
1233t: f32
1234ret: int#1
1235arg: float#1 v
1236summary: Base two exponent
1237description:
1238 Returns the base two exponent of a value, where the mantissa is between
1239 1.f (inclusive) and 2.f (exclusive).
1240
1241 For example, <code>ilogb(8.5f)</code> returns 3.
1242
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001243 Because of the difference in mantissa, this number is one less than is returned by @frexp().
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001244
1245 @logb() is similar but returns a float.
1246test: custom
1247end:
1248
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08001249function: ilogb
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001250version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08001251attrib: const
1252w: 1, 2, 3, 4
1253t: f16
1254ret: int#1
1255arg: half#1 v
1256test: none
1257end:
1258
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001259function: ldexp
1260version: 9
1261attrib: const
1262w: 1, 2, 3, 4
1263ret: float#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001264arg: float#1 mantissa, "Mantissa."
1265arg: int#1 exponent, "Exponent, a single component or matching vector."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001266summary: Creates a floating point from mantissa and exponent
1267description:
1268 Returns the floating point created from the mantissa and exponent,
1269 i.e. (mantissa * 2 ^ exponent).
1270
1271 See @frexp() for the reverse operation.
1272end:
1273
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001274function: ldexp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001275version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001276attrib: const
1277w: 1, 2, 3, 4
1278ret: half#1
1279arg: half#1 mantissa
1280arg: int#1 exponent
1281test: none
1282end:
1283
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001284function: ldexp
1285version: 9
1286attrib: const
1287w: 2, 3, 4
1288ret: float#1
1289arg: float#1 mantissa
1290arg: int exponent
1291end:
1292
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001293function: ldexp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001294version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001295attrib: const
1296w: 2, 3, 4
1297ret: half#1
1298arg: half#1 mantissa
1299arg: int exponent
1300test: none
1301end:
1302
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001303function: lgamma
1304version: 9
1305attrib: const
1306w: 1, 2, 3, 4
1307t: f32
1308ret: #2#1
1309arg: #2#1 v
1310summary: Natural logarithm of the gamma function
1311description:
1312 Returns the natural logarithm of the absolute value of the gamma function,
1313 i.e. <code>@log(@fabs(@tgamma(v)))</code>.
1314
1315 See also @tgamma().
1316end:
1317
1318function: lgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001319version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001320attrib: const
1321w: 1, 2, 3, 4
1322t: f16
1323ret: #2#1
1324arg: #2#1 v
1325test: none
1326end:
1327
1328function: lgamma
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001329version: 9
1330w: 1, 2, 3, 4
1331t: f32
1332ret: #2#1
1333arg: #2#1 v
1334arg: 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."
1335test: custom
1336#TODO Temporary until bionic & associated drivers are fixed
1337end:
1338
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001339function: lgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001340version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001341w: 1, 2, 3, 4
1342t: f16
1343ret: #2#1
1344arg: #2#1 v
1345arg: int#1* sign_of_gamma
1346test: none
1347end:
1348
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001349function: log
1350version: 9
1351attrib: const
1352w: 1, 2, 3, 4
1353t: f32
1354ret: #2#1
1355arg: #2#1 v
1356summary: Natural logarithm
1357description:
1358 Returns the natural logarithm.
1359
1360 See also @native_log().
1361end:
1362
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001363function: log
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001364version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001365attrib: const
1366w: 1, 2, 3, 4
1367t: f16
1368ret: #2#1
1369arg: #2#1 v
1370test: none
1371end:
1372
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001373function: log10
1374version: 9
1375attrib: const
1376w: 1, 2, 3, 4
1377t: f32
1378ret: #2#1
1379arg: #2#1 v
1380summary: Base 10 logarithm
1381description:
1382 Returns the base 10 logarithm.
1383
1384 See also @native_log10().
1385end:
1386
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001387function: log10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001388version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001389attrib: const
1390w: 1, 2, 3, 4
1391t: f16
1392ret: #2#1
1393arg: #2#1 v
1394test: none
1395end:
1396
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001397function: log1p
1398version: 9
1399attrib: const
1400w: 1, 2, 3, 4
1401t: f32
1402ret: #2#1
1403arg: #2#1 v
1404summary: Natural logarithm of a value plus 1
1405description:
1406 Returns the natural logarithm of <code>(v + 1.f)</code>.
1407
1408 See also @native_log1p().
1409end:
1410
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001411function: log1p
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001412version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001413attrib: const
1414w: 1, 2, 3, 4
1415t: f16
1416ret: #2#1
1417arg: #2#1 v
1418test: none
1419end:
1420
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001421function: log2
1422version: 9
1423attrib: const
1424w: 1, 2, 3, 4
1425t: f32
1426ret: #2#1
1427arg: #2#1 v
1428summary: Base 2 logarithm
1429description:
1430 Returns the base 2 logarithm.
1431
1432 See also @native_log2().
1433end:
1434
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001435function: log2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001436version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001437attrib: const
1438w: 1, 2, 3, 4
1439t: f16
1440ret: #2#1
1441arg: #2#1 v
1442test: none
1443end:
1444
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001445function: logb
1446version: 9
1447attrib: const
1448w: 1, 2, 3, 4
1449t: f32
1450ret: #2#1
1451arg: #2#1 v
1452summary: Base two exponent
1453description:
1454 Returns the base two exponent of a value, where the mantissa is between
1455 1.f (inclusive) and 2.f (exclusive).
1456
1457 For example, <code>logb(8.5f)</code> returns 3.f.
1458
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001459 Because of the difference in mantissa, this number is one less than is returned by frexp().
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001460
1461 @ilogb() is similar but returns an integer.
1462end:
1463
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001464function: logb
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001465version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001466attrib: const
1467w: 1, 2, 3, 4
1468t: f16
1469ret: #2#1
1470arg: #2#1 v
1471test: none
1472end:
1473
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001474function: mad
1475version: 9
1476attrib: const
1477w: 1, 2, 3, 4
1478t: f32
1479ret: #2#1
1480arg: #2#1 multiplicand1
1481arg: #2#1 multiplicand2
1482arg: #2#1 offset
1483summary: Multiply and add
1484description:
1485 Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>.
1486
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001487 This function is similar to @fma(). @fma() retains full precision of the multiplied result
1488 and rounds only after the addition. mad() rounds after the multiplication and the addition.
1489 In rs_fp_relaxed mode, mad() may not do the rounding after multiplicaiton.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001490end:
1491
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001492function: mad
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001493version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001494attrib: const
1495w: 1, 2, 3, 4
1496t: f16
1497ret: #2#1
1498arg: #2#1 multiplicand1
1499arg: #2#1 multiplicand2
1500arg: #2#1 offset
1501test: none
1502end:
1503
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001504function: max
1505version: 9
1506attrib: const
1507w: 1, 2, 3, 4
1508t: f32
1509ret: #2#1
1510arg: #2#1 a
1511arg: #2#1 b
1512summary: Maximum
1513description:
1514 Returns the maximum value of two arguments.
1515end:
1516
1517function: max
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001518version:24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001519attrib: const
1520w: 1, 2, 3, 4
1521t: f16
1522ret: #2#1
1523arg: #2#1 a
1524arg: #2#1 b
1525test: none
1526end:
1527
1528function: max
Jean-Luc Brouillet7cf263d2015-08-20 17:30:41 -07001529version: 9
1530attrib: const
1531w: 2, 3, 4
1532t: f32
1533ret: #2#1
1534arg: #2#1 a
1535arg: #2 b
1536end:
1537
1538function: max
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001539version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001540attrib: const
1541w: 2, 3, 4
1542t: f16
1543ret: #2#1
1544arg: #2#1 a
1545arg: #2 b
1546test: none
1547end:
1548
1549function: max
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001550version: 9 20
1551attrib: const
1552w: 1
1553t: i8, i16, i32, u8, u16, u32
1554ret: #2#1
1555arg: #2#1 a
1556arg: #2#1 b
1557inline:
1558 return (a > b ? a : b);
1559end:
1560
1561function: max
1562version: 9 20
1563attrib: const
1564w: 2
1565t: i8, i16, i32, u8, u16, u32
1566ret: #2#1
1567arg: #2#1 a
1568arg: #2#1 b
1569inline:
1570 #2#1 tmp;
1571 tmp.x = (a.x > b.x ? a.x : b.x);
1572 tmp.y = (a.y > b.y ? a.y : b.y);
1573 return tmp;
1574end:
1575
1576function: max
1577version: 9 20
1578attrib: const
1579w: 3
1580t: i8, i16, i32, u8, u16, u32
1581ret: #2#1
1582arg: #2#1 a
1583arg: #2#1 b
1584inline:
1585 #2#1 tmp;
1586 tmp.x = (a.x > b.x ? a.x : b.x);
1587 tmp.y = (a.y > b.y ? a.y : b.y);
1588 tmp.z = (a.z > b.z ? a.z : b.z);
1589 return tmp;
1590end:
1591
1592function: max
1593version: 9 20
1594attrib: const
1595w: 4
1596t: i8, i16, i32, u8, u16, u32
1597ret: #2#1
1598arg: #2#1 a
1599arg: #2#1 b
1600inline:
1601 #2#1 tmp;
1602 tmp.x = (a.x > b.x ? a.x : b.x);
1603 tmp.y = (a.y > b.y ? a.y : b.y);
1604 tmp.z = (a.z > b.z ? a.z : b.z);
1605 tmp.w = (a.w > b.w ? a.w : b.w);
1606 return tmp;
1607end:
1608
1609function: max
1610version: 21
1611attrib: const
1612w: 1, 2, 3, 4
1613t: i8, i16, i32, i64, u8, u16, u32, u64
1614ret: #2#1
1615arg: #2#1 a
1616arg: #2#1 b
1617end:
1618
1619function: min
1620version: 9
1621attrib: const
1622w: 1, 2, 3, 4
1623t: f32
1624ret: #2#1
1625arg: #2#1 a
1626arg: #2#1 b
1627summary: Minimum
1628description:
1629 Returns the minimum value of two arguments.
1630end:
1631
1632function: min
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001633version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001634attrib: const
1635w: 1, 2, 3, 4
1636t: f16
1637ret: #2#1
1638arg: #2#1 a
1639arg: #2#1 b
1640test: none
1641end:
1642
1643function: min
Jean-Luc Brouillet7cf263d2015-08-20 17:30:41 -07001644version: 9
1645attrib: const
1646w: 2, 3, 4
1647t: f32
1648ret: #2#1
1649arg: #2#1 a
1650arg: #2 b
1651end:
1652
1653function: min
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001654version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001655attrib: const
1656w: 2, 3, 4
1657t: f16
1658ret: #2#1
1659arg: #2#1 a
1660arg: #2 b
1661test: none
1662end:
1663
1664function: min
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001665version: 9 20
1666attrib: const
1667w: 1
1668t: i8, i16, i32, u8, u16, u32
1669ret: #2#1
1670arg: #2#1 a
1671arg: #2#1 b
1672inline:
1673 return (a < b ? a : b);
1674end:
1675
1676function: min
1677version: 9 20
1678attrib: const
1679w: 2
1680t: i8, i16, i32, u8, u16, u32
1681ret: #2#1
1682arg: #2#1 a
1683arg: #2#1 b
1684inline:
1685 #2#1 tmp;
1686 tmp.x = (a.x < b.x ? a.x : b.x);
1687 tmp.y = (a.y < b.y ? a.y : b.y);
1688 return tmp;
1689end:
1690
1691function: min
1692version: 9 20
1693attrib: const
1694w: 3
1695t: i8, i16, i32, u8, u16, u32
1696ret: #2#1
1697arg: #2#1 a
1698arg: #2#1 b
1699inline:
1700 #2#1 tmp;
1701 tmp.x = (a.x < b.x ? a.x : b.x);
1702 tmp.y = (a.y < b.y ? a.y : b.y);
1703 tmp.z = (a.z < b.z ? a.z : b.z);
1704 return tmp;
1705end:
1706
1707function: min
1708version: 9 20
1709attrib: const
1710w: 4
1711t: i8, i16, i32, u8, u16, u32
1712ret: #2#1
1713arg: #2#1 a
1714arg: #2#1 b
1715inline:
1716 #2#1 tmp;
1717 tmp.x = (a.x < b.x ? a.x : b.x);
1718 tmp.y = (a.y < b.y ? a.y : b.y);
1719 tmp.z = (a.z < b.z ? a.z : b.z);
1720 tmp.w = (a.w < b.w ? a.w : b.w);
1721 return tmp;
1722end:
1723
1724function: min
1725version: 21
1726attrib: const
1727w: 1, 2, 3, 4
1728t: i8, i16, i32, i64, u8, u16, u32, u64
1729ret: #2#1
1730arg: #2#1 a
1731arg: #2#1 b
1732end:
1733
1734function: mix
1735version: 9
1736attrib: const
1737w: 1, 2, 3, 4
1738t: f32
1739ret: #2#1
1740arg: #2#1 start
1741arg: #2#1 stop
1742arg: #2#1 fraction
1743summary: Mixes two values
1744description:
1745 Returns start + ((stop - start) * fraction).
1746
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001747 This can be useful for mixing two values. For example, to create a new color that is
1748 40% color1 and 60% color2, use <code>mix(color1, color2, 0.6f)</code>.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001749end:
1750
1751function: mix
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001752version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001753attrib: const
1754w: 1, 2, 3, 4
1755t: f16
1756ret: #2#1
1757arg: #2#1 start
1758arg: #2#1 stop
1759arg: #2#1 fraction
1760test: none
1761end:
1762
1763function: mix
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001764version: 9
1765attrib: const
1766w: 2, 3, 4
1767t: f32
1768ret: #2#1
1769arg: #2#1 start
1770arg: #2#1 stop
1771arg: #2 fraction
1772end:
1773
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001774function: mix
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001775version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001776attrib: const
1777w: 2, 3, 4
1778t: f16
1779ret: #2#1
1780arg: #2#1 start
1781arg: #2#1 stop
1782arg: #2 fraction
1783test: none
1784end:
1785
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001786function: modf
1787version: 9
1788w: 1, 2, 3, 4
1789t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001790ret: #2#1, "Floating point portion of the value."
1791arg: #2#1 v, "Source value."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001792arg: #2#1* integral_part, "*integral_part will be set to the integral portion of the number."
1793summary: Integral and fractional components
1794description:
1795 Returns the integral and fractional components of a number.
1796
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001797 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 -08001798 *integral_part will be set to -3.f and .72f will be returned.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001799end:
1800
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001801function: modf
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001802version: 24
Pirama Arumuga Nainar91ad8912016-02-05 16:50:13 -08001803w: 1, 2, 3, 4
1804t: f16
1805ret: #2#1
1806arg: #2#1 v
1807arg: #2#1* integral_part
1808test: none
1809end:
1810
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001811function: nan
1812version: 9
1813attrib: const
1814w: 1
1815t: f32
1816ret: #2#1
1817arg: uint#1 v, "Not used."
1818#TODO We're not using the argument. Once we do, add this documentation line:
1819# The argument is embedded into the return value and can be used to distinguish various NaNs.
1820summary: Not a Number
1821description:
1822 Returns a NaN value (Not a Number).
1823end:
1824
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001825function: nan_half
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001826version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001827attrib: const
1828t: f16
1829ret: #1
1830summary: Not a Number
1831description:
1832 Returns a half-precision floating point NaN value (Not a Number).
1833test: none
1834end:
1835
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001836function: native_acos
1837version: 21
1838attrib: const
1839w: 1, 2, 3, 4
1840t: f32
1841ret: #2#1
1842arg: #2#1 v, range(-1,1)
1843summary: Approximate inverse cosine
1844description:
1845 Returns the approximate inverse cosine, in radians.
1846
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001847 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001848
1849 See also @acos().
1850# TODO Temporary
1851test: limited(0.0005)
1852end:
1853
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001854function: native_acos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001855version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001856attrib: const
1857w: 1, 2, 3, 4
1858t: f16
1859ret: #2#1
1860# TODO Need range(-1,1) here similar to the float version?
1861arg: #2#1 v
1862test: none
1863end:
1864
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001865function: native_acosh
1866version: 21
1867attrib: const
1868w: 1, 2, 3, 4
1869t: f32
1870ret: #2#1
1871arg: #2#1 v
1872summary: Approximate inverse hyperbolic cosine
1873description:
1874 Returns the approximate inverse hyperbolic cosine, in radians.
1875
1876 See also @acosh().
1877# TODO Temporary
1878test: limited(0.0005)
1879end:
1880
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001881function: native_acosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001882version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001883attrib: const
1884w: 1, 2, 3, 4
1885t: f16
1886ret: #2#1
1887arg: #2#1 v
1888test: none
1889end:
1890
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001891function: native_acospi
1892version: 21
1893attrib: const
1894w: 1, 2, 3, 4
1895t: f32
1896ret: #2#1
1897arg: #2#1 v, range(-1,1)
1898summary: Approximate inverse cosine divided by pi
1899description:
1900 Returns the approximate inverse cosine in radians, divided by pi.
1901
1902 To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
1903
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001904 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001905
1906 See also @acospi().
1907# TODO Temporary
1908test: limited(0.0005)
1909end:
1910
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001911function: native_acospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001912version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001913attrib: const
1914w: 1, 2, 3, 4
1915t: f16
1916ret: #2#1
1917# TODO Need range(-1,1) here similar to the float version?
1918arg: #2#1 v
1919test: none
1920end:
1921
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001922function: native_asin
1923version: 21
1924attrib: const
1925w: 1, 2, 3, 4
1926t: f32
1927ret: #2#1
1928arg: #2#1 v, range(-1,1)
1929summary: Approximate inverse sine
1930description:
1931 Returns the approximate inverse sine, in radians.
1932
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001933 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001934
1935 See also @asin().
1936# TODO Temporary
1937test: limited(0.0005)
1938end:
1939
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001940function: native_asin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001941version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001942attrib: const
1943w: 1, 2, 3, 4
1944t: f16
1945ret: #2#1
1946# TODO Need range(-1,1) here similar to the float version?
1947arg: #2#1 v
1948test: none
1949end:
1950
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001951function: native_asinh
1952version: 21
1953attrib: const
1954w: 1, 2, 3, 4
1955t: f32
1956ret: #2#1
1957arg: #2#1 v
1958summary: Approximate inverse hyperbolic sine
1959description:
1960 Returns the approximate inverse hyperbolic sine, in radians.
1961
1962 See also @asinh().
1963# TODO Temporary
1964test: limited(0.0005)
1965end:
1966
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001967function: native_asinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001968version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001969attrib: const
1970w: 1, 2, 3, 4
1971t: f16
1972ret: #2#1
1973arg: #2#1 v
1974test: none
1975end:
1976
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001977function: native_asinpi
1978version: 21
1979attrib: const
1980w: 1, 2, 3, 4
1981t: f32
1982ret: #2#1
1983arg: #2#1 v, range(-1,1)
1984summary: Approximate inverse sine divided by pi
1985description:
1986 Returns the approximate inverse sine in radians, divided by pi.
1987
1988 To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
1989
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07001990 This function yields undefined results from input values less than -1 or greater than 1.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07001991
1992 See also @asinpi().
1993# TODO Temporary
1994test: limited(0.0005)
1995end:
1996
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001997function: native_asinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08001998version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08001999attrib: const
2000w: 1, 2, 3, 4
2001t: f16
2002ret: #2#1
2003# TODO Need range(-1,1) here similar to the float version?
2004arg: #2#1 v
2005test: none
2006end:
2007
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002008function: native_atan
2009version: 21
2010attrib: const
2011w: 1, 2, 3, 4
2012t: f32
2013ret: #2#1
2014arg: #2#1 v, range(-1,1)
2015summary: Approximate inverse tangent
2016description:
2017 Returns the approximate inverse tangent, in radians.
2018
2019 See also @atan().
2020# TODO Temporary
2021test: limited(0.0005)
2022end:
2023
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002024function: native_atan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002025version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002026attrib: const
2027w: 1, 2, 3, 4
2028t: f16
2029ret: #2#1
2030# TODO Need range(-1,1) here similar to the float version?
2031arg: #2#1 v
2032test: none
2033end:
2034
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002035function: native_atan2
2036version: 21
2037attrib: const
2038w: 1, 2, 3, 4
2039t: f32
2040ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002041arg: #2#1 numerator, "Numerator."
2042arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002043summary: Approximate inverse tangent of a ratio
2044description:
2045 Returns the approximate inverse tangent of <code>(numerator / denominator)</code>, in radians.
2046
2047 See also @atan2().
2048# TODO Temporary
2049test: limited(0.0005)
2050end:
2051
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002052function: native_atan2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002053version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002054attrib: const
2055w: 1, 2, 3, 4
2056t: f16
2057ret: #2#1
2058arg: #2#1 numerator
2059arg: #2#1 denominator
2060test: none
2061end:
2062
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002063function: native_atan2pi
2064version: 21
2065attrib: const
2066w: 1, 2, 3, 4
2067t: f32
2068ret: #2#1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002069arg: #2#1 numerator, "Numerator."
2070arg: #2#1 denominator, "Denominator. Can be 0."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002071summary: Approximate inverse tangent of a ratio, divided by pi
2072description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002073 Returns the approximate inverse tangent of <code>(numerator / denominator)</code>,
2074 in radians, divided by pi.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002075
2076 To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
2077
2078 See also @atan2pi().
2079# TODO Temporary
2080test: limited(0.0005)
2081end:
2082
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002083function: native_atan2pi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002084version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002085attrib: const
2086w: 1, 2, 3, 4
2087t: f16
2088ret: #2#1
2089arg: #2#1 numerator
2090arg: #2#1 denominator
2091test: none
2092end:
2093
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002094function: native_atanh
2095version: 21
2096attrib: const
2097w: 1, 2, 3, 4
2098t: f32
2099ret: #2#1
2100arg: #2#1 v, range(-1,1)
2101summary: Approximate inverse hyperbolic tangent
2102description:
2103 Returns the approximate inverse hyperbolic tangent, in radians.
2104
2105 See also @atanh().
2106# TODO Temporary
2107test: limited(0.0005)
2108end:
2109
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002110function: native_atanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002111version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002112attrib: const
2113w: 1, 2, 3, 4
2114t: f16
2115ret: #2#1
2116# TODO Need range(-1,1) here similar to the float version?
2117arg: #2#1 v
2118test: none
2119end:
2120
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002121function: native_atanpi
2122version: 21
2123attrib: const
2124w: 1, 2, 3, 4
2125t: f32
2126ret: #2#1
2127arg: #2#1 v, range(-1,1)
2128summary: Approximate inverse tangent divided by pi
2129description:
2130 Returns the approximate inverse tangent in radians, divided by pi.
2131
2132 To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
2133
2134 See also @atanpi().
2135# TODO Temporary
2136test: limited(0.0005)
2137end:
2138
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002139function: native_atanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002140version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002141attrib: const
2142w: 1, 2, 3, 4
2143t: f16
2144ret: #2#1
2145# TODO Need range(-1,1) here similar to the float version?
2146arg: #2#1 v
2147test: none
2148end:
2149
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002150function: native_cbrt
2151version: 21
2152attrib: const
2153w: 1, 2, 3, 4
2154t: f32
2155ret: #2#1
2156arg: #2#1 v
2157summary: Approximate cube root
2158description:
2159 Returns the approximate cubic root.
2160
2161 See also @cbrt().
2162end:
2163
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002164function: native_cbrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002165version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002166attrib: const
2167w: 1, 2, 3, 4
2168t: f16
2169ret: #2#1
2170arg: #2#1 v
2171test: none
2172end:
2173
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002174function: native_cos
2175version: 21
2176attrib: const
2177w: 1, 2, 3, 4
2178t: f32
2179ret: #2#1
2180arg: #2#1 v
2181summary: Approximate cosine
2182description:
2183 Returns the approximate cosine of an angle measured in radians.
2184
2185 See also @cos().
2186end:
2187
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002188function: native_cos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002189version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002190attrib: const
2191w: 1, 2, 3, 4
2192t: f16
2193ret: #2#1
2194arg: #2#1 v
2195test: none
2196end:
2197
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002198function: native_cosh
2199version: 21
2200attrib: const
2201w: 1, 2, 3, 4
2202t: f32
2203ret: #2#1
2204arg: #2#1 v
2205summary: Approximate hypebolic cosine
2206description:
2207 Returns the approximate hypebolic cosine.
2208
2209 See also @cosh().
2210end:
2211
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002212function: native_cosh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002213version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002214attrib: const
2215w: 1, 2, 3, 4
2216t: f16
2217ret: #2#1
2218arg: #2#1 v
2219test: none
2220end:
2221
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002222function: native_cospi
2223version: 21
2224attrib: const
2225w: 1, 2, 3, 4
2226t: f32
2227ret: #2#1
2228arg: #2#1 v
2229summary: Approximate cosine of a number multiplied by pi
2230description:
2231 Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
2232
2233 To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
2234
2235 See also @cospi().
2236end:
2237
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002238function: native_cospi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002239version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002240attrib: const
2241w: 1, 2, 3, 4
2242t: f16
2243ret: #2#1
2244arg: #2#1 v
2245test: none
2246end:
2247
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002248function: native_divide
2249version: 21
2250attrib: const
2251w: 1, 2, 3, 4
2252t: f32
2253ret: #2#1
2254arg: #2#1 left_vector
2255arg: #2#1 right_vector
2256summary: Approximate division
2257description:
2258 Computes the approximate division of two values.
2259end:
2260
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002261function: native_divide
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002262version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002263attrib: const
2264w: 1, 2, 3, 4
2265t: f16
2266ret: #2#1
2267arg: #2#1 left_vector
2268arg: #2#1 right_vector
2269test: none
2270end:
2271
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002272function: native_exp
2273version: 18
2274attrib: const
2275w: 1, 2, 3, 4
2276t: f32
2277ret: #2#1
2278arg: #2#1 v, range(-86,86)
2279summary: Approximate e raised to a number
2280description:
2281 Fast approximate exp.
2282
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002283 It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be
2284 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002285
2286 See also @exp().
2287test: limited
2288end:
2289
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002290function: native_exp
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002291version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002292attrib: const
2293w: 1, 2, 3, 4
2294t: f16
2295ret: #2#1
2296# TODO Need range(-86, 86) here similar to the float version?
2297arg: #2#1 v
2298test: none
2299end:
2300
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002301function: native_exp10
2302version: 18
2303attrib: const
2304w: 1, 2, 3, 4
2305t: f32
2306ret: #2#1
2307arg: #2#1 v, range(-37,37)
2308summary: Approximate 10 raised to a number
2309description:
2310 Fast approximate exp10.
2311
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002312 It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be
2313 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002314
2315 See also @exp10().
2316test: limited
2317end:
2318
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002319function: native_exp10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002320version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002321attrib: const
2322w: 1, 2, 3, 4
2323t: f16
2324ret: #2#1
2325# TODO Need range(-37, 37) here similar to the float version?
2326arg: #2#1 v
2327test: none
2328end:
2329
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002330function: native_exp2
2331version: 18
2332attrib: const
2333w: 1, 2, 3, 4
2334t: f32
2335ret: #2#1
2336arg: #2#1 v, range(-125,125)
2337summary: Approximate 2 raised to a number
2338description:
2339 Fast approximate exp2.
2340
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002341 It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be
2342 expected from using 16 bit floating point values.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002343
2344 See also @exp2().
2345test: limited
2346end:
2347
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002348function: native_exp2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002349version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002350attrib: const
2351w: 1, 2, 3, 4
2352t: f16
2353ret: #2#1
2354# TODO Need range(-125, 125) here similar to the float version?
2355arg: #2#1 v
2356test: none
2357end:
2358
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002359function: native_expm1
2360version: 21
2361attrib: const
2362w: 1, 2, 3, 4
2363t: f32
2364ret: #2#1
2365arg: #2#1 v
2366summary: Approximate e raised to a number minus one
2367description:
2368 Returns the approximate (e ^ v) - 1.
2369
2370 See also @expm1().
2371end:
2372
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002373function: native_expm1
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002374version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002375attrib: const
2376w: 1, 2, 3, 4
2377t: f16
2378ret: #2#1
2379arg: #2#1 v
2380test: none
2381end:
2382
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002383function: native_hypot
2384version: 21
2385attrib: const
2386w: 1, 2, 3, 4
2387t: f32
2388ret: #2#1
2389arg: #2#1 a
2390arg: #2#1 b
2391summary: Approximate hypotenuse
2392description:
2393 Returns the approximate native_sqrt(a * a + b * b)
2394
2395 See also @hypot().
2396end:
2397
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002398function: native_hypot
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002399version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002400attrib: const
2401w: 1, 2, 3, 4
2402t: f16
2403ret: #2#1
2404arg: #2#1 a
2405arg: #2#1 b
2406test: none
2407end:
2408
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002409function: native_log
2410version: 18
2411attrib: const
2412w: 1, 2, 3, 4
2413t: f32
2414ret: #2#1
2415arg: #2#1 v, range(10e-10,10e10)
2416summary: Approximate natural logarithm
2417description:
2418 Fast approximate log.
2419
2420 It is not accurate for values very close to zero.
2421
2422 See also @log().
2423test: limited
2424end:
2425
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002426function: native_log
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002427version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002428attrib: const
2429w: 1, 2, 3, 4
2430t: f16
2431ret: #2#1
2432# TODO Need range(10e-10,10e10) here similar to the float version?
2433arg: #2#1 v
2434test: none
2435end:
2436
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002437function: native_log10
2438version: 18
2439attrib: const
2440w: 1, 2, 3, 4
2441t: f32
2442ret: #2#1
2443arg: #2#1 v, range(10e-10,10e10)
2444summary: Approximate base 10 logarithm
2445description:
2446 Fast approximate log10.
2447
2448 It is not accurate for values very close to zero.
2449
2450 See also @log10().
2451test: limited
2452end:
2453
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002454function: native_log10
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002455version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002456attrib: const
2457w: 1, 2, 3, 4
2458t: f16
2459ret: #2#1
2460# TODO Need range(10e-10,10e10) here similar to the float version?
2461arg: #2#1 v
2462test: none
2463end:
2464
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002465function: native_log1p
2466version: 21
2467attrib: const
2468w: 1, 2, 3, 4
2469t: f32
2470ret: #2#1
2471arg: #2#1 v
2472summary: Approximate natural logarithm of a value plus 1
2473description:
2474 Returns the approximate natural logarithm of (v + 1.0f)
2475
2476 See also @log1p().
2477end:
2478
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002479function: native_log1p
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002480version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002481attrib: const
2482w: 1, 2, 3, 4
2483t: f16
2484ret: #2#1
2485arg: #2#1 v
2486test: none
2487end:
2488
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002489function: native_log2
2490version: 18
2491attrib: const
2492w: 1, 2, 3, 4
2493t: f32
2494ret: #2#1
2495arg: #2#1 v, range(10e-10,10e10)
2496summary: Approximate base 2 logarithm
2497description:
2498 Fast approximate log2.
2499
2500 It is not accurate for values very close to zero.
2501
2502 See also @log2().
2503test: limited
2504end:
2505
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002506function: native_log2
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002507version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002508attrib: const
2509w: 1, 2, 3, 4
2510t: f16
2511ret: #2#1
2512# TODO Need range(10e-10,10e10) here similar to the float version?
2513arg: #2#1 v
2514test: none
2515end:
2516
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002517function: native_powr
2518version: 18
2519attrib: const
2520w: 1, 2, 3, 4
2521t: f32
2522ret: #2#1
2523arg: #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."
2524arg: #2#1 exponent, range(-15,15), "Must be between -15.f and 15.f."
2525summary: Approximate positive base raised to an exponent
2526description:
2527 Fast approximate (base ^ exponent).
2528
2529 See also @powr().
2530test: limited
2531end:
2532
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002533function: native_powr
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002534version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002535attrib: const
2536w: 1, 2, 3, 4
2537t: f16
2538ret: #2#1
2539# TODO Need range(0, 256) here similar to the float version?
2540arg: #2#1 base
2541# TODO Need range(-15,15) here similar to the float version?
2542arg: #2#1 exponent
2543test: none
2544end:
2545
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002546function: native_recip
2547version: 21
2548attrib: const
2549w: 1, 2, 3, 4
2550t: f32
2551ret: #2#1
2552arg: #2#1 v
2553summary: Approximate reciprocal
2554description:
2555 Returns the approximate approximate reciprocal of a value.
2556
2557 See also @half_recip().
2558end:
2559
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002560function: native_recip
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002561version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002562attrib: const
2563w: 1, 2, 3, 4
2564t: f16
2565ret: #2#1
2566arg: #2#1 v
2567test: none
2568end:
2569
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002570function: native_rootn
2571version: 21
2572attrib: const
2573w: 1, 2, 3, 4
2574t: f32
2575ret: #2#1
2576arg: #2#1 v
2577arg: int#1 n
2578summary: Approximate nth root
2579description:
2580 Compute the approximate Nth root of a value.
2581
2582 See also @rootn().
2583end:
2584
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002585function: native_rootn
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002586version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002587attrib: const
2588w: 1, 2, 3, 4
2589t: f16
2590ret: #2#1
2591arg: #2#1 v
2592arg: int#1 n
2593test: none
2594end:
2595
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002596function: native_rsqrt
2597version: 21
2598attrib: const
2599w: 1, 2, 3, 4
2600t: f32
2601ret: #2#1
2602arg: #2#1 v
2603summary: Approximate reciprocal of a square root
2604description:
2605 Returns approximate (1 / sqrt(v)).
2606
2607 See also @rsqrt(), @half_rsqrt().
2608end:
2609
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002610function: native_rsqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002611version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002612attrib: const
2613w: 1, 2, 3, 4
2614t: f16
2615ret: #2#1
2616arg: #2#1 v
2617test: none
2618end:
2619
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002620function: native_sin
2621version: 21
2622attrib: const
2623w: 1, 2, 3, 4
2624t: f32
2625ret: #2#1
2626arg: #2#1 v
2627summary: Approximate sine
2628description:
2629 Returns the approximate sine of an angle measured in radians.
2630
2631 See also @sin().
2632end:
2633
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002634function: native_sin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002635version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002636attrib: const
2637w: 1, 2, 3, 4
2638t: f16
2639ret: #2#1
2640arg: #2#1 v
2641test: none
2642end:
2643
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002644function: native_sincos
2645version: 21
2646w: 1, 2, 3, 4
2647t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002648ret: #2#1, "Sine."
2649arg: #2#1 v, "Incoming value in radians."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002650arg: #2#1* cos, "*cos will be set to the cosine value."
2651summary: Approximate sine and cosine
2652description:
2653 Returns the approximate sine and cosine of a value.
2654
2655 See also @sincos().
2656# TODO Temporary
2657test: limited(0.0005)
2658end:
2659
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002660function: native_sincos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002661version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002662w: 1, 2, 3, 4
2663t: f16
2664ret: #2#1
2665arg: #2#1 v
2666arg: #2#1* cos
2667test: none
2668end:
2669
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002670function: native_sinh
2671version: 21
2672attrib: const
2673w: 1, 2, 3, 4
2674t: f32
2675ret: #2#1
2676arg: #2#1 v
2677summary: Approximate hyperbolic sine
2678description:
2679 Returns the approximate hyperbolic sine of a value specified in radians.
2680
2681 See also @sinh().
2682end:
2683
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002684function: native_sinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002685version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002686attrib: const
2687w: 1, 2, 3, 4
2688t: f16
2689ret: #2#1
2690arg: #2#1 v
2691test: none
2692end:
2693
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002694function: native_sinpi
2695version: 21
2696attrib: const
2697w: 1, 2, 3, 4
2698t: f32
2699ret: #2#1
2700arg: #2#1 v
2701summary: Approximate sine of a number multiplied by pi
2702description:
2703 Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
2704
2705 To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
2706
2707 See also @sinpi().
2708end:
2709
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002710function: native_sinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002711version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002712attrib: const
2713w: 1, 2, 3, 4
2714t: f16
2715ret: #2#1
2716arg: #2#1 v
2717test: none
2718end:
2719
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002720function: native_sqrt
2721version: 21
2722attrib: const
2723w: 1, 2, 3, 4
2724t: f32
2725ret: #2#1
2726arg: #2#1 v
2727summary: Approximate square root
2728description:
2729 Returns the approximate sqrt(v).
2730
2731 See also @sqrt(), @half_sqrt().
2732end:
2733
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002734function: native_sqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002735version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002736attrib: const
2737w: 1, 2, 3, 4
2738t: f16
2739ret: #2#1
2740arg: #2#1 v
2741test: none
2742end:
2743
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002744function: native_tan
2745version: 21
2746attrib: const
2747w: 1, 2, 3, 4
2748t: f32
2749ret: #2#1
2750arg: #2#1 v
2751summary: Approximate tangent
2752description:
2753 Returns the approximate tangent of an angle measured in radians.
2754end:
2755
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002756function: native_tan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002757version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002758attrib: const
2759w: 1, 2, 3, 4
2760t: f16
2761ret: #2#1
2762arg: #2#1 v
2763test: none
2764end:
2765
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002766function: native_tanh
2767version: 21
2768attrib: const
2769w: 1, 2, 3, 4
2770t: f32
2771ret: #2#1
2772arg: #2#1 v
2773summary: Approximate hyperbolic tangent
2774description:
2775 Returns the approximate hyperbolic tangent of a value.
2776
2777 See also @tanh().
2778end:
2779
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002780function: native_tanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002781version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002782attrib: const
2783w: 1, 2, 3, 4
2784t: f16
2785ret: #2#1
2786arg: #2#1 v
2787test: none
2788end:
2789
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002790function: native_tanpi
2791version: 21
2792attrib: const
2793w: 1, 2, 3, 4
2794t: f32
2795ret: #2#1
2796arg: #2#1 v
2797summary: Approximate tangent of a number multiplied by pi
2798description:
2799 Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
2800
2801 To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
2802
2803 See also @tanpi().
2804end:
2805
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002806function: native_tanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002807version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002808attrib: const
2809w: 1, 2, 3, 4
2810t: f16
2811ret: #2#1
2812arg: #2#1 v
2813test: none
2814end:
2815
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002816function: nextafter
2817version: 9
2818attrib: const
2819w: 1, 2, 3, 4
2820t: f32
2821ret: #2#1
2822arg: #2#1 v
2823arg: #2#1 target
2824summary: Next floating point number
2825description:
2826 Returns the next representable floating point number from v towards target.
2827
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002828 In rs_fp_relaxed mode, a denormalized input value may not yield the next denormalized
2829 value, as support of denormalized values is optional in relaxed mode.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002830end:
2831
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08002832function: nextafter
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002833version: 24
Pirama Arumuga Nainard021b482016-02-04 11:40:05 -08002834attrib: const
2835w: 1, 2, 3, 4
2836t: f16
2837ret: #2#1
2838arg: #2#1 v
2839arg: #2#1 target
2840test: none
2841end:
2842
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002843function: pow
2844version: 9
2845attrib: const
2846w: 1, 2, 3, 4
2847t: f32
2848ret: #2#1
2849arg: #2#1 base
2850arg: #2#1 exponent
2851summary: Base raised to an exponent
2852description:
2853 Returns base raised to the power exponent, i.e. base ^ exponent.
2854
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002855 @pown() and @powr() are similar. @pown() takes an integer exponent. @powr() assumes the
2856 base to be non-negative.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002857end:
2858
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002859function: pow
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002860version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002861attrib: const
2862w: 1, 2, 3, 4
2863t: f16
2864ret: #2#1
2865arg: #2#1 base
2866arg: #2#1 exponent
2867test: none
2868end:
2869
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002870function: pown
2871version: 9
2872attrib: const
2873w: 1, 2, 3, 4
2874t: f32
2875ret: #2#1
2876arg: #2#1 base
2877arg: int#1 exponent
2878summary: Base raised to an integer exponent
2879description:
2880 Returns base raised to the power exponent, i.e. base ^ exponent.
2881
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002882 @pow() and @powr() are similar. The both take a float exponent. @powr() also assumes the
2883 base to be non-negative.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002884end:
2885
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002886function: pown
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002887version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002888attrib: const
2889w: 1, 2, 3, 4
2890t: f16
2891ret: #2#1
2892arg: #2#1 base
2893arg: int#1 exponent
2894test: none
2895end:
2896
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002897function: powr
2898version: 9
2899attrib: const
2900w: 1, 2, 3, 4
2901t: f32
2902ret: #2#1
2903arg: #2#1 base, range(0,3000)
2904arg: #2#1 exponent
2905summary: Positive base raised to an exponent
2906description:
2907 Returns base raised to the power exponent, i.e. base ^ exponent. base must be &gt;= 0.
2908
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002909 @pow() and @pown() are similar. They both make no assumptions about the base.
2910 @pow() takes a float exponent while @pown() take an integer.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002911
2912 See also @native_powr().
2913end:
2914
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002915function: powr
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002916version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002917attrib: const
2918w: 1, 2, 3, 4
2919t: f16
2920ret: #2#1
2921# TODO Need range(0,3000) here similar to the float version?
2922arg: #2#1 base
2923arg: #2#1 exponent
2924test: none
2925end:
2926
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002927function: radians
2928version: 9
2929attrib: const
2930w: 1, 2, 3, 4
2931t: f32
2932ret: #2#1
2933arg: #2#1 v
2934summary: Converts degrees into radians
2935description:
2936 Converts from degrees to radians.
2937end:
2938
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002939function: radians
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002940version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002941attrib: const
2942w: 1, 2, 3, 4
2943t: f16
2944ret: #2#1
2945arg: #2#1 v
2946test: none
2947end:
2948
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002949function: remainder
2950version: 9
2951attrib: const
2952w: 1, 2, 3, 4
2953t: f32
2954ret: #2#1
2955arg: #2#1 numerator
2956arg: #2#1 denominator
2957summary: Remainder of a division
2958description:
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002959 Returns the remainder of (numerator / denominator), where the quotient is rounded towards
2960 the nearest integer.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002961
2962 The function @fmod() is similar but rounds toward the closest interger.
2963 For example, <code>@fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
2964 while <code>remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
2965end:
2966
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002967function: remainder
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08002968version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08002969attrib: const
2970w: 1, 2, 3, 4
2971t: f16
2972ret: #2#1
2973arg: #2#1 numerator
2974arg: #2#1 denominator
2975test: none
2976end:
2977
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002978function: remquo
2979version: 9
2980w: 1, 2, 3, 4
2981t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002982ret: #2#1, "Remainder, precise only for the low three bits."
2983arg: #2#1 numerator, "Numerator."
2984arg: #2#1 denominator, "Denominator."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002985arg: int#1* quotient, "*quotient will be set to the integer quotient."
2986summary: Remainder and quotient of a division
2987description:
2988 Returns the quotient and the remainder of (numerator / denominator).
2989
2990 Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
2991
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002992 This function is useful for implementing periodic functions. The low three bits of the
2993 quotient gives the quadrant and the remainder the distance within the quadrant.
2994 For example, an implementation of @sin(x) could call <code>remquo(x, PI / 2.f, &amp;quadrant)</code>
2995 to reduce very large value of x to something within a limited range.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002996
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07002997 Example: <code>remquo(-23.5f, 8.f, &amp;quot)</code> sets the lowest three bits of quot to 3
2998 and the sign negative. It returns 0.5f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07002999test: custom
3000end:
3001
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003002function: remquo
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003003version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003004w: 1, 2, 3, 4
3005t: f16
3006ret: #2#1
3007arg: #2#1 numerator
3008arg: #2#1 denominator
3009arg: int#1* quotient
3010test: none
3011end:
3012
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003013function: rint
3014version: 9
3015attrib: const
3016w: 1, 2, 3, 4
3017t: f32
3018ret: #2#1
3019arg: #2#1 v
3020summary: Round to even
3021description:
3022 Rounds to the nearest integral value.
3023
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003024 rint() rounds half values to even. For example, <code>rint(0.5f)</code> returns 0.f and
3025 <code>rint(1.5f)</code> returns 2.f. Similarly, <code>rint(-0.5f)</code> returns -0.f and
3026 <code>rint(-1.5f)</code> returns -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003027
3028 @round() is similar but rounds away from zero. @trunc() truncates the decimal fraction.
3029end:
3030
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003031function: rint
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003032version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003033attrib: const
3034w: 1, 2, 3, 4
3035t: f16
3036ret: #2#1
3037arg: #2#1 v
3038test: none
3039end:
3040
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003041function: rootn
3042version: 9
3043attrib: const
3044w: 1, 2, 3, 4
3045t: f32
3046ret: #2#1
3047arg: #2#1 v
3048arg: int#1 n
3049summary: Nth root
3050description:
3051 Compute the Nth root of a value.
3052
3053 See also @native_rootn().
3054end:
3055
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003056function: rootn
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003057version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003058attrib: const
3059w: 1, 2, 3, 4
3060t: f16
3061ret: #2#1
3062arg: #2#1 v
3063arg: int#1 n
3064test: none
3065end:
3066
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003067function: round
3068version: 9
3069attrib: const
3070w: 1, 2, 3, 4
3071t: f32
3072ret: #2#1
3073arg: #2#1 v
3074summary: Round away from zero
3075description:
3076 Round to the nearest integral value.
3077
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003078 round() rounds half values away from zero. For example, <code>round(0.5f)</code> returns 1.f
3079 and <code>round(1.5f)</code> returns 2.f. Similarly, <code>round(-0.5f)</code> returns -1.f
3080 and <code>round(-1.5f)</code> returns -2.f.
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003081
3082 @rint() is similar but rounds half values toward even. @trunc() truncates the decimal fraction.
3083end:
3084
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003085function: round
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003086version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003087attrib: const
3088w: 1, 2, 3, 4
3089t: f16
3090ret: #2#1
3091arg: #2#1 v
3092test: none
3093end:
3094
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003095function: rsqrt
3096version: 9
3097attrib: const
3098w: 1, 2, 3, 4
3099t: f32
3100ret: #2#1
3101arg: #2#1 v
3102summary: Reciprocal of a square root
3103description:
3104 Returns (1 / sqrt(v)).
3105
3106 See also @half_rsqrt(), @native_rsqrt().
3107end:
3108
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003109function: rsqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003110version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003111attrib: const
3112w: 1, 2, 3, 4
3113t: f16
3114ret: #2#1
3115arg: #2#1 v
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003116end:
3117
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003118function: sign
3119version: 9
3120attrib: const
3121w: 1, 2, 3, 4
3122t: f32
3123ret: #2#1
3124arg: #2#1 v
3125summary: Sign of a value
3126description:
3127 Returns the sign of a value.
3128
3129 if (v &lt; 0) return -1.f;
3130 else if (v &gt; 0) return 1.f;
3131 else return 0.f;
3132end:
3133
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003134function: sign
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003135version:24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003136attrib: const
3137w: 1, 2, 3, 4
3138t: f16
3139ret: #2#1
3140arg: #2#1 v
3141test: none
3142end:
3143
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003144function: sin
3145version: 9
3146attrib: const
3147w: 1, 2, 3, 4
3148t: f32
3149ret: #2#1
3150arg: #2#1 v
3151summary: Sine
3152description:
3153 Returns the sine of an angle measured in radians.
3154
3155 See also @native_sin().
3156end:
3157
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003158function: sin
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003159version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003160attrib: const
3161w: 1, 2, 3, 4
3162t: f16
3163ret: #2#1
3164arg: #2#1 v
3165test: none
3166end:
3167
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003168function: sincos
3169version: 9
3170w: 1, 2, 3, 4
3171t: f32
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003172ret: #2#1, "Sine of v."
3173arg: #2#1 v, "Incoming value in radians."
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003174arg: #2#1* cos, "*cos will be set to the cosine value."
3175summary: Sine and cosine
3176description:
3177 Returns the sine and cosine of a value.
3178
3179 See also @native_sincos().
3180end:
3181
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003182function: sincos
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003183version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003184w: 1, 2, 3, 4
3185t: f16
3186ret: #2#1
3187arg: #2#1 v
3188arg: #2#1* cos
3189test: none
3190end:
3191
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003192function: sinh
3193version: 9
3194attrib: const
3195w: 1, 2, 3, 4
3196t: f32
3197ret: #2#1
3198arg: #2#1 v
3199summary: Hyperbolic sine
3200description:
3201 Returns the hyperbolic sine of v, where v is measured in radians.
3202
3203 See also @native_sinh().
3204end:
3205
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003206function: sinh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003207version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003208attrib: const
3209w: 1, 2, 3, 4
3210t: f16
3211ret: #2#1
3212arg: #2#1 v
3213test: none
3214end:
3215
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003216function: sinpi
3217version: 9
3218attrib: const
3219w: 1, 2, 3, 4
3220t: f32
3221ret: #2#1
3222arg: #2#1 v
3223summary: Sine of a number multiplied by pi
3224description:
3225 Returns the sine of (v * pi), where (v * pi) is measured in radians.
3226
3227 To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
3228
3229 See also @native_sinpi().
3230end:
3231
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003232function: sinpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003233version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003234attrib: const
3235w: 1, 2, 3, 4
3236t: f16
3237ret: #2#1
3238arg: #2#1 v
3239test: none
3240end:
3241
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003242function: sqrt
3243version: 9
3244attrib: const
3245w: 1, 2, 3, 4
3246t: f32
3247ret: #2#1
3248arg: #2#1 v
3249summary: Square root
3250description:
3251 Returns the square root of a value.
3252
3253 See also @half_sqrt(), @native_sqrt().
3254end:
3255
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003256function: sqrt
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003257version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003258attrib: const
3259w: 1, 2, 3, 4
3260t: f16
3261ret: #2#1
3262arg: #2#1 v
3263test: none
3264end:
3265
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003266function: step
3267version: 9
3268attrib: const
3269w: 1, 2, 3, 4
3270t: f32
3271ret: #2#1
3272arg: #2#1 edge
3273arg: #2#1 v
3274summary: 0 if less than a value, 0 otherwise
3275description:
3276 Returns 0.f if v &lt; edge, 1.f otherwise.
3277
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003278 This can be useful to create conditional computations without using loops and branching
3279 instructions. For example, instead of computing <code>(a[i] &lt; b[i]) ? 0.f : @atan2(a[i], b[i])</code>
3280 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 -07003281end:
3282
3283function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003284version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003285attrib: const
3286w: 1, 2, 3, 4
3287t: f16
3288ret: #2#1
3289arg: #2#1 edge
3290arg: #2#1 v
3291test: none
3292end:
3293
3294function: step
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003295version: 9
3296attrib: const
3297w: 2, 3, 4
3298t: f32
3299ret: #2#1
3300arg: #2#1 edge
3301arg: #2 v
3302end:
3303
3304function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003305version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003306attrib: const
3307w: 2, 3, 4
3308t: f16
3309ret: #2#1
3310arg: #2#1 edge
3311arg: #2 v
3312test: none
3313end:
3314
3315function: step
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003316version: 21
3317attrib: const
3318w: 2, 3, 4
3319t: f32
3320ret: #2#1
3321arg: #2 edge
3322arg: #2#1 v
3323end:
3324
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003325function: step
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003326version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003327attrib: const
3328w: 2, 3, 4
3329t: f16
3330ret: #2#1
3331arg: #2 edge
3332arg: #2#1 v
3333test: none
3334end:
3335
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003336function: tan
3337version: 9
3338attrib: const
3339w: 1, 2, 3, 4
3340t: f32
3341ret: #2#1
3342arg: #2#1 v
3343summary: Tangent
3344description:
3345 Returns the tangent of an angle measured in radians.
3346
3347 See also @native_tan().
3348end:
3349
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003350function: tan
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003351version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003352attrib: const
3353w: 1, 2, 3, 4
3354t: f16
3355ret: #2#1
3356arg: #2#1 v
3357test: none
3358end:
3359
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003360function: tanh
3361version: 9
3362attrib: const
3363w: 1, 2, 3, 4
3364t: f32
3365ret: #2#1
3366arg: #2#1 v
3367summary: Hyperbolic tangent
3368description:
3369 Returns the hyperbolic tangent of a value.
3370
3371 See also @native_tanh().
3372end:
3373
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003374function: tanh
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003375version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003376attrib: const
3377w: 1, 2, 3, 4
3378t: f16
3379ret: #2#1
3380arg: #2#1 v
3381test: none
3382end:
3383
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003384function: tanpi
3385version: 9
3386attrib: const
3387w: 1, 2, 3, 4
3388t: f32
3389ret: #2#1
3390arg: #2#1 v
3391summary: Tangent of a number multiplied by pi
3392description:
3393 Returns the tangent of (v * pi), where (v * pi) is measured in radians.
3394
3395 To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
3396
3397 See also @native_tanpi().
3398end:
3399
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003400function: tanpi
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003401version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003402attrib: const
3403w: 1, 2, 3, 4
3404t: f16
3405ret: #2#1
3406arg: #2#1 v
3407test: none
3408end:
3409
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003410function: tgamma
3411version: 9
3412attrib: const
3413w: 1, 2, 3, 4
3414t: f32
3415ret: #2#1
3416arg: #2#1 v
3417summary: Gamma function
3418description:
3419 Returns the gamma function of a value.
3420
3421 See also @lgamma().
3422end:
3423
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003424function: tgamma
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003425version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003426attrib: const
3427w: 1, 2, 3, 4
3428t: f16
3429ret: #2#1
3430arg: #2#1 v
3431test: none
3432end:
3433
Jean-Luc Brouilletbe216382015-03-22 12:44:27 -07003434function: trunc
3435version: 9
3436attrib: const
3437w: 1, 2, 3, 4
3438t: f32
3439ret: #2#1
3440arg: #2#1 v
3441summary: Truncates a floating point
3442description:
3443 Rounds to integral using truncation.
3444
3445 For example, <code>trunc(1.7f)</code> returns 1.f and <code>trunc(-1.7f)</code> returns -1.f.
3446
3447 See @rint() and @round() for other rounding options.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003448end:
3449
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003450function: trunc
Pirama Arumuga Nainar132b31f2016-02-18 14:46:28 -08003451version: 24
Pirama Arumuga Nainar193847b2015-12-09 15:54:35 -08003452attrib: const
3453w: 1, 2, 3, 4
3454t: f16
3455ret: #2#1
3456arg: #2#1 v
3457test: none
3458end:
3459
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003460function: rsClamp
Verena Beckhama4d25bc2015-11-12 14:20:31 +00003461attrib: const
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003462t: i8, i16, i32, u8, u16, u32
3463ret: #1
Jean-Luc Brouillet6386ceb2015-04-28 15:06:30 -07003464arg: #1 amount, "Value to clamp."
3465arg: #1 low, "Lower bound."
3466arg: #1 high, "Upper bound."
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -07003467deprecated: 22, Use @clamp() instead.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003468summary: Restrain a value to a range
3469description:
3470 Clamp a value between low and high.
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003471test: none
3472end:
3473
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003474function: rsFrac
3475attrib: const
3476ret: float
3477arg: float v
Jean-Luc Brouillet36e2be52015-04-30 14:41:24 -07003478deprecated: 22, Use @fract() instead.
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -07003479summary: Returns the fractional part of a float
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003480description:
3481 Returns the fractional part of a float
3482test: none
3483end:
3484
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003485function: rsRand
3486ret: int
3487arg: int max_value
Jean-Luc Brouillet20b27d62015-04-03 14:39:53 -07003488summary: Pseudo-random number
Jean-Luc Brouilletc5184e22015-03-13 13:51:24 -07003489description:
3490 Return a random value between 0 (or min_value) and max_malue.
3491test: none
3492end:
3493
3494function: rsRand
3495ret: int
3496arg: int min_value
3497arg: int max_value
3498test: none
3499end:
3500
3501function: rsRand
3502ret: float
3503arg: float max_value
3504test: none
3505end:
3506
3507function: rsRand
3508ret: float
3509arg: float min_value
3510arg: float max_value
3511test: none
3512end: