rs_math.spec 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423
  1. #
  2. # Copyright (C) 2014 The Android Open Source Project
  3. #
  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. header:
  17. summary: Mathematical Constants and Functions
  18. description:
  19. The mathematical functions below can be applied to scalars and vectors. When applied
  20. to vectors, the returned value is a vector of the function applied to each entry of the input.
  21. For example:<code><br/>
  22. float3 a, b;<br/>
  23. // The following call sets<br/>
  24. // a.x to sin(b.x),<br/>
  25. // a.y to sin(b.y), and<br/>
  26. // a.z to sin(b.z).<br/>
  27. a = sin(b);<br/>
  28. </code>
  29. See <a href='rs_vector_math.html'>Vector Math Functions</a> for functions like @distance() and @length() that interpret
  30. instead the input as a single vector in n-dimensional space.
  31. The precision of the mathematical operations on 32 bit floats is affected by the pragmas
  32. rs_fp_relaxed and rs_fp_full. Under rs_fp_relaxed, subnormal values may be flushed to zero and
  33. rounding may be done towards zero. In comparison, rs_fp_full requires correct handling of
  34. subnormal values, i.e. smaller than 1.17549435e-38f. rs_fp_rull also requires round to nearest
  35. with ties to even.
  36. Different precision/speed tradeoffs can be achieved by using variants of the common math
  37. functions. Functions with a name starting with<ul>
  38. <li>native_: May have custom hardware implementations with weaker precision. Additionally,
  39. subnormal values may be flushed to zero, rounding towards zero may be used, and NaN and
  40. infinity input may not be handled correctly.</li>
  41. <li>half_: May perform internal computations using 16 bit floats. Additionally, subnormal
  42. values may be flushed to zero, and rounding towards zero may be used.</li>
  43. </ul>
  44. end:
  45. # TODO Add f16 versions of these constants.
  46. constant: M_1_PI
  47. value: 0.318309886183790671537767526745028724f
  48. type: float
  49. summary: 1 / pi, as a 32 bit float
  50. description:
  51. The inverse of pi, as a 32 bit float.
  52. end:
  53. constant: M_2_PI
  54. value: 0.636619772367581343075535053490057448f
  55. type: float
  56. summary: 2 / pi, as a 32 bit float
  57. description:
  58. 2 divided by pi, as a 32 bit float.
  59. end:
  60. constant: M_2_PIl
  61. value: 0.636619772367581343075535053490057448f
  62. type: float
  63. hidden:
  64. deprecated: 22, Use M_2_PI instead.
  65. summary: 2 / pi, as a 32 bit float
  66. description:
  67. 2 divided by pi, as a 32 bit float.
  68. end:
  69. constant: M_2_SQRTPI
  70. value: 1.128379167095512573896158903121545172f
  71. type: float
  72. summary: 2 / sqrt(pi), as a 32 bit float
  73. description:
  74. 2 divided by the square root of pi, as a 32 bit float.
  75. end:
  76. constant: M_E
  77. value: 2.718281828459045235360287471352662498f
  78. type: float
  79. summary: e, as a 32 bit float
  80. description:
  81. The number e, the base of the natural logarithm, as a 32 bit float.
  82. end:
  83. constant: M_LN10
  84. value: 2.302585092994045684017991454684364208f
  85. type: float
  86. summary: log_e(10), as a 32 bit float
  87. description:
  88. The natural logarithm of 10, as a 32 bit float.
  89. end:
  90. constant: M_LN2
  91. value: 0.693147180559945309417232121458176568f
  92. type: float
  93. summary: log_e(2), as a 32 bit float
  94. description:
  95. The natural logarithm of 2, as a 32 bit float.
  96. end:
  97. constant: M_LOG10E
  98. value: 0.434294481903251827651128918916605082f
  99. type: float
  100. summary: log_10(e), as a 32 bit float
  101. description:
  102. The logarithm base 10 of e, as a 32 bit float.
  103. end:
  104. constant: M_LOG2E
  105. value: 1.442695040888963407359924681001892137f
  106. type: float
  107. summary: log_2(e), as a 32 bit float
  108. description:
  109. The logarithm base 2 of e, as a 32 bit float.
  110. end:
  111. constant: M_PI
  112. value: 3.141592653589793238462643383279502884f
  113. type: float
  114. summary: pi, as a 32 bit float
  115. description:
  116. The constant pi, as a 32 bit float.
  117. end:
  118. constant: M_PI_2
  119. value: 1.570796326794896619231321691639751442f
  120. type: float
  121. summary: pi / 2, as a 32 bit float
  122. description:
  123. Pi divided by 2, as a 32 bit float.
  124. end:
  125. constant: M_PI_4
  126. value: 0.785398163397448309615660845819875721f
  127. type: float
  128. summary: pi / 4, as a 32 bit float
  129. description:
  130. Pi divided by 4, as a 32 bit float.
  131. end:
  132. constant: M_SQRT1_2
  133. value: 0.707106781186547524400844362104849039f
  134. type: float
  135. summary: 1 / sqrt(2), as a 32 bit float
  136. description:
  137. The inverse of the square root of 2, as a 32 bit float.
  138. end:
  139. constant: M_SQRT2
  140. value: 1.414213562373095048801688724209698079f
  141. type: float
  142. summary: sqrt(2), as a 32 bit float
  143. description:
  144. The square root of 2, as a 32 bit float.
  145. end:
  146. function: abs
  147. version: 9
  148. attrib: const
  149. w: 1, 2, 3, 4
  150. t: i8, i16, i32
  151. ret: u#2#1
  152. arg: #2#1 v
  153. summary: Absolute value of an integer
  154. description:
  155. Returns the absolute value of an integer.
  156. For floats, use @fabs().
  157. end:
  158. function: acos
  159. version: 9
  160. attrib: const
  161. w: 1, 2, 3, 4
  162. t: f32
  163. ret: #2#1
  164. arg: #2#1 v, range(-1,1)
  165. summary: Inverse cosine
  166. description:
  167. Returns the inverse cosine, in radians.
  168. See also @native_acos().
  169. end:
  170. function: acos
  171. version: 24
  172. attrib: const
  173. w: 1, 2, 3, 4
  174. t: f16
  175. ret: #2#1
  176. arg: #2#1 v, range(-1,1)
  177. end:
  178. function: acosh
  179. version: 9
  180. attrib: const
  181. w: 1, 2, 3, 4
  182. t: f32
  183. ret: #2#1
  184. arg: #2#1 v
  185. summary: Inverse hyperbolic cosine
  186. description:
  187. Returns the inverse hyperbolic cosine, in radians.
  188. See also @native_acosh().
  189. end:
  190. function: acosh
  191. version: 24
  192. attrib: const
  193. w: 1, 2, 3, 4
  194. t: f16
  195. ret: #2#1
  196. arg: #2#1 v
  197. end:
  198. function: acospi
  199. version: 9
  200. attrib: const
  201. w: 1, 2, 3, 4
  202. t: f32
  203. ret: #2#1
  204. arg: #2#1 v, range(-1,1)
  205. summary: Inverse cosine divided by pi
  206. description:
  207. Returns the inverse cosine in radians, divided by pi.
  208. To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
  209. See also @native_acospi().
  210. end:
  211. function: acospi
  212. version: 24
  213. attrib: const
  214. w: 1, 2, 3, 4
  215. t: f16
  216. ret: #2#1
  217. arg: #2#1 v, range(-1,1)
  218. end:
  219. function: asin
  220. version: 9
  221. attrib: const
  222. w: 1, 2, 3, 4
  223. t: f32
  224. ret: #2#1
  225. arg: #2#1 v, range(-1,1)
  226. summary: Inverse sine
  227. description:
  228. Returns the inverse sine, in radians.
  229. See also @native_asin().
  230. end:
  231. function: asin
  232. version: 24
  233. attrib: const
  234. w: 1, 2, 3, 4
  235. t: f16
  236. ret: #2#1
  237. arg: #2#1 v, range(-1,1)
  238. end:
  239. function: asinh
  240. version: 9
  241. attrib: const
  242. w: 1, 2, 3, 4
  243. t: f32
  244. ret: #2#1
  245. arg: #2#1 v
  246. summary: Inverse hyperbolic sine
  247. description:
  248. Returns the inverse hyperbolic sine, in radians.
  249. See also @native_asinh().
  250. end:
  251. function: asinh
  252. version: 24
  253. attrib: const
  254. w: 1, 2, 3, 4
  255. t: f16
  256. ret: #2#1
  257. arg: #2#1 v
  258. end:
  259. function: asinpi
  260. version: 9
  261. attrib: const
  262. w: 1, 2, 3, 4
  263. t: f32
  264. ret: #2#1
  265. arg: #2#1 v, range(-1,1)
  266. summary: Inverse sine divided by pi
  267. description:
  268. Returns the inverse sine in radians, divided by pi.
  269. To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
  270. See also @native_asinpi().
  271. end:
  272. function: asinpi
  273. version: 24
  274. attrib: const
  275. w: 1, 2, 3, 4
  276. t: f16
  277. ret: #2#1
  278. arg: #2#1 v, range(-1,1)
  279. end:
  280. function: atan
  281. version: 9
  282. attrib: const
  283. w: 1, 2, 3, 4
  284. t: f32
  285. ret: #2#1
  286. arg: #2#1 v, range(-1,1)
  287. summary: Inverse tangent
  288. description:
  289. Returns the inverse tangent, in radians.
  290. See also @native_atan().
  291. end:
  292. function: atan
  293. version: 24
  294. attrib: const
  295. w: 1, 2, 3, 4
  296. t: f16
  297. ret: #2#1
  298. arg: #2#1 v, range(-1,1)
  299. end:
  300. function: atan2
  301. version: 9
  302. attrib: const
  303. w: 1, 2, 3, 4
  304. t: f32
  305. ret: #2#1
  306. arg: #2#1 numerator, "Numerator."
  307. arg: #2#1 denominator, "Denominator. Can be 0."
  308. summary: Inverse tangent of a ratio
  309. description:
  310. Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians.
  311. See also @native_atan2().
  312. end:
  313. function: atan2
  314. version: 24
  315. attrib: const
  316. w: 1, 2, 3, 4
  317. t: f16
  318. ret: #2#1
  319. arg: #2#1 numerator
  320. arg: #2#1 denominator
  321. end:
  322. function: atan2pi
  323. version: 9
  324. attrib: const
  325. w: 1, 2, 3, 4
  326. t: f32
  327. ret: #2#1
  328. arg: #2#1 numerator, "Numerator."
  329. arg: #2#1 denominator, "Denominator. Can be 0."
  330. summary: Inverse tangent of a ratio, divided by pi
  331. description:
  332. Returns the inverse tangent of <code>(numerator / denominator)</code>, in radians, divided by pi.
  333. To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
  334. See also @native_atan2pi().
  335. end:
  336. function: atan2pi
  337. version: 24
  338. attrib: const
  339. w: 1, 2, 3, 4
  340. t: f16
  341. ret: #2#1
  342. arg: #2#1 numerator
  343. arg: #2#1 denominator
  344. end:
  345. function: atanh
  346. version: 9
  347. attrib: const
  348. w: 1, 2, 3, 4
  349. t: f32
  350. ret: #2#1
  351. arg: #2#1 v, range(-1,1)
  352. summary: Inverse hyperbolic tangent
  353. description:
  354. Returns the inverse hyperbolic tangent, in radians.
  355. See also @native_atanh().
  356. end:
  357. function: atanh
  358. version: 24
  359. attrib: const
  360. w: 1, 2, 3, 4
  361. t: f16
  362. ret: #2#1
  363. arg: #2#1 v, range(-1,1)
  364. end:
  365. function: atanpi
  366. version: 9
  367. attrib: const
  368. w: 1, 2, 3, 4
  369. t: f32
  370. ret: #2#1
  371. arg: #2#1 v, range(-1,1)
  372. summary: Inverse tangent divided by pi
  373. description:
  374. Returns the inverse tangent in radians, divided by pi.
  375. To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
  376. See also @native_atanpi().
  377. end:
  378. function: atanpi
  379. version: 24
  380. attrib: const
  381. w: 1, 2, 3, 4
  382. t: f16
  383. ret: #2#1
  384. arg: #2#1 v, range(-1,1)
  385. end:
  386. function: cbrt
  387. version: 9
  388. attrib: const
  389. w: 1, 2, 3, 4
  390. t: f32
  391. ret: #2#1
  392. arg: #2#1 v
  393. summary: Cube root
  394. description:
  395. Returns the cube root.
  396. See also @native_cbrt().
  397. end:
  398. function: cbrt
  399. version: 24
  400. attrib: const
  401. w: 1, 2, 3, 4
  402. t: f16
  403. ret: #2#1
  404. arg: #2#1 v
  405. end:
  406. function: ceil
  407. version: 9
  408. attrib: const
  409. w: 1, 2, 3, 4
  410. t: f32
  411. ret: #2#1
  412. arg: #2#1 v
  413. summary: Smallest integer not less than a value
  414. description:
  415. Returns the smallest integer not less than a value.
  416. For example, <code>ceil(1.2f)</code> returns 2.f, and <code>ceil(-1.2f)</code> returns -1.f.
  417. See also @floor().
  418. end:
  419. function: ceil
  420. version: 24
  421. attrib: const
  422. w: 1, 2, 3, 4
  423. t: f16
  424. ret: #2#1
  425. arg: #2#1 v
  426. end:
  427. function: clamp
  428. version: 9
  429. attrib: const
  430. w: 1, 2, 3, 4
  431. t: f32
  432. ret: #2#1
  433. arg: #2#1 value, "Value to be clamped."
  434. arg: #2#1 min_value, "Lower bound, a scalar or matching vector."
  435. arg: #2#1 max_value, above(min_value), "High bound, must match the type of low."
  436. summary: Restrain a value to a range
  437. description:
  438. Clamps a value to a specified high and low bound. clamp() returns min_value
  439. if value &lt; min_value, max_value if value &gt; max_value, otherwise value.
  440. There are two variants of clamp: one where the min and max are scalars applied
  441. to all entries of the value, the other where the min and max are also vectors.
  442. If min_value is greater than max_value, the results are undefined.
  443. end:
  444. function: clamp
  445. version: 9
  446. attrib: const
  447. w: 2, 3, 4
  448. t: f32
  449. ret: #2#1
  450. arg: #2#1 value
  451. arg: #2 min_value
  452. arg: #2 max_value, above(min_value)
  453. end:
  454. function: clamp
  455. version: 19
  456. attrib: const
  457. w: 1, 2, 3, 4
  458. t: u8, u16, u32, u64, i8, i16, i32, i64
  459. ret: #2#1
  460. arg: #2#1 value
  461. arg: #2#1 min_value
  462. arg: #2#1 max_value, above(min_value)
  463. end:
  464. function: clamp
  465. version: 19
  466. attrib: const
  467. w: 2, 3, 4
  468. t: u8, u16, u32, u64, i8, i16, i32, i64
  469. ret: #2#1
  470. arg: #2#1 value
  471. arg: #2 min_value
  472. arg: #2 max_value, above(min_value)
  473. end:
  474. function: clamp
  475. version: 24
  476. attrib: const
  477. w: 1, 2, 3, 4
  478. t: f16
  479. ret: #2#1
  480. arg: #2#1 value
  481. arg: #2#1 min_value
  482. arg: #2#1 max_value, above(min_value)
  483. end:
  484. function: clamp
  485. version: 24
  486. attrib: const
  487. w: 2, 3, 4
  488. t: f16
  489. ret: #2#1
  490. arg: #2#1 value
  491. arg: #2 min_value
  492. arg: #2 max_value, above(min_value)
  493. end:
  494. function: clz
  495. version: 9
  496. attrib: const
  497. w: 1, 2, 3, 4
  498. t: u8, u16, u32, i8, i16, i32
  499. ret: #2#1
  500. arg: #2#1 value
  501. summary: Number of leading 0 bits
  502. description:
  503. Returns the number of leading 0-bits in a value.
  504. For example, <code>clz((char)0x03)</code> returns 6.
  505. end:
  506. function: copysign
  507. version: 9
  508. attrib: const
  509. w: 1, 2, 3, 4
  510. t: f32
  511. ret: #2#1
  512. arg: #2#1 magnitude_value
  513. arg: #2#1 sign_value
  514. summary: Copies the sign of a number to another
  515. description:
  516. Copies the sign from sign_value to magnitude_value.
  517. The value returned is either magnitude_value or -magnitude_value.
  518. For example, <code>copysign(4.0f, -2.7f)</code> returns -4.0f and <code>copysign(-4.0f, 2.7f)</code> returns 4.0f.
  519. end:
  520. function: copysign
  521. version: 24
  522. attrib: const
  523. w: 1, 2, 3, 4
  524. t: f16
  525. ret: #2#1
  526. arg: #2#1 magnitude_value
  527. arg: #2#1 sign_value
  528. end:
  529. function: cos
  530. version: 9
  531. attrib: const
  532. w: 1, 2, 3, 4
  533. t: f32
  534. ret: #2#1
  535. arg: #2#1 v
  536. summary: Cosine
  537. description:
  538. Returns the cosine of an angle measured in radians.
  539. See also @native_cos().
  540. end:
  541. function: cos
  542. version: 24
  543. attrib: const
  544. w: 1, 2, 3, 4
  545. t: f16
  546. ret: #2#1
  547. arg: #2#1 v
  548. end:
  549. function: cosh
  550. version: 9
  551. attrib: const
  552. w: 1, 2, 3, 4
  553. t: f32
  554. ret: #2#1
  555. arg: #2#1 v
  556. summary: Hypebolic cosine
  557. description:
  558. Returns the hypebolic cosine of v, where v is measured in radians.
  559. See also @native_cosh().
  560. end:
  561. function: cosh
  562. version: 24
  563. attrib: const
  564. w: 1, 2, 3, 4
  565. t: f16
  566. ret: #2#1
  567. arg: #2#1 v
  568. end:
  569. function: cospi
  570. version: 9
  571. attrib: const
  572. w: 1, 2, 3, 4
  573. t: f32
  574. ret: #2#1
  575. arg: #2#1 v
  576. summary: Cosine of a number multiplied by pi
  577. description:
  578. Returns the cosine of <code>(v * pi)</code>, where <code>(v * pi)</code> is measured in radians.
  579. To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
  580. See also @native_cospi().
  581. end:
  582. function: cospi
  583. version: 24
  584. attrib: const
  585. w: 1, 2, 3, 4
  586. t: f16
  587. ret: #2#1
  588. arg: #2#1 v
  589. end:
  590. function: degrees
  591. version: 9
  592. attrib: const
  593. w: 1, 2, 3, 4
  594. t: f32
  595. ret: #2#1
  596. arg: #2#1 v
  597. summary: Converts radians into degrees
  598. description:
  599. Converts from radians to degrees.
  600. end:
  601. function: degrees
  602. version: 24
  603. attrib: const
  604. w: 1, 2, 3, 4
  605. t: f16
  606. ret: #2#1
  607. arg: #2#1 v
  608. end:
  609. function: erf
  610. version: 9
  611. attrib: const
  612. w: 1, 2, 3, 4
  613. t: f32
  614. ret: #2#1
  615. arg: #2#1 v
  616. summary: Mathematical error function
  617. description:
  618. Returns the error function.
  619. end:
  620. function: erf
  621. version: 24
  622. attrib: const
  623. w: 1, 2, 3, 4
  624. t: f16
  625. ret: #2#1
  626. arg: #2#1 v
  627. end:
  628. function: erfc
  629. version: 9
  630. attrib: const
  631. w: 1, 2, 3, 4
  632. t: f32
  633. ret: #2#1
  634. arg: #2#1 v
  635. summary: Mathematical complementary error function
  636. description:
  637. Returns the complementary error function.
  638. end:
  639. function: erfc
  640. version: 24
  641. attrib: const
  642. w: 1, 2, 3, 4
  643. t: f16
  644. ret: #2#1
  645. arg: #2#1 v
  646. end:
  647. function: exp
  648. version: 9
  649. attrib: const
  650. w: 1, 2, 3, 4
  651. t: f32
  652. ret: #2#1
  653. arg: #2#1 v
  654. summary: e raised to a number
  655. description:
  656. Returns e raised to v, i.e. e ^ v.
  657. See also @native_exp().
  658. end:
  659. function: exp
  660. version: 24
  661. attrib: const
  662. w: 1, 2, 3, 4
  663. t: f16
  664. ret: #2#1
  665. arg: #2#1 v
  666. end:
  667. function: exp10
  668. version: 9
  669. attrib: const
  670. w: 1, 2, 3, 4
  671. t: f32
  672. ret: #2#1
  673. arg: #2#1 v
  674. summary: 10 raised to a number
  675. description:
  676. Returns 10 raised to v, i.e. 10.f ^ v.
  677. See also @native_exp10().
  678. end:
  679. function: exp10
  680. version: 24
  681. attrib: const
  682. w: 1, 2, 3, 4
  683. t: f16
  684. ret: #2#1
  685. arg: #2#1 v
  686. end:
  687. function: exp2
  688. version: 9
  689. attrib: const
  690. w: 1, 2, 3, 4
  691. t: f32
  692. ret: #2#1
  693. arg: #2#1 v
  694. summary: 2 raised to a number
  695. description:
  696. Returns 2 raised to v, i.e. 2.f ^ v.
  697. See also @native_exp2().
  698. end:
  699. function: exp2
  700. version: 24
  701. attrib: const
  702. w: 1, 2, 3, 4
  703. t: f16
  704. ret: #2#1
  705. arg: #2#1 v
  706. end:
  707. function: expm1
  708. version: 9
  709. attrib: const
  710. w: 1, 2, 3, 4
  711. t: f32
  712. ret: #2#1
  713. arg: #2#1 v
  714. summary: e raised to a number minus one
  715. description:
  716. Returns e raised to v minus 1, i.e. (e ^ v) - 1.
  717. See also @native_expm1().
  718. end:
  719. function: expm1
  720. version: 24
  721. attrib: const
  722. w: 1, 2, 3, 4
  723. t: f16
  724. ret: #2#1
  725. arg: #2#1 v
  726. end:
  727. function: fabs
  728. version: 9
  729. attrib: const
  730. w: 1, 2, 3, 4
  731. t: f32
  732. ret: #2#1
  733. arg: #2#1 v
  734. summary: Absolute value of a float
  735. description:
  736. Returns the absolute value of the float v.
  737. For integers, use @abs().
  738. end:
  739. function: fabs
  740. version: 24
  741. attrib: const
  742. w: 1, 2, 3, 4
  743. t: f16
  744. ret: #2#1
  745. arg: #2#1 v
  746. end:
  747. function: fdim
  748. version: 9
  749. attrib: const
  750. w: 1, 2, 3, 4
  751. t: f32
  752. ret: #2#1
  753. arg: #2#1 a
  754. arg: #2#1 b
  755. summary: Positive difference between two values
  756. description:
  757. Returns the positive difference between two values.
  758. If a &gt; b, returns (a - b) otherwise returns 0f.
  759. end:
  760. function: fdim
  761. version: 24
  762. attrib: const
  763. w: 1, 2, 3, 4
  764. t: f16
  765. ret: #2#1
  766. arg: #2#1 a
  767. arg: #2#1 b
  768. end:
  769. function: floor
  770. version: 9
  771. attrib: const
  772. w: 1, 2, 3, 4
  773. t: f32
  774. ret: #2#1
  775. arg: #2#1 v
  776. summary: Smallest integer not greater than a value
  777. description:
  778. Returns the smallest integer not greater than a value.
  779. For example, <code>floor(1.2f)</code> returns 1.f, and <code>floor(-1.2f)</code> returns -2.f.
  780. See also @ceil().
  781. end:
  782. function: floor
  783. version: 24
  784. attrib: const
  785. w: 1, 2, 3, 4
  786. t: f16
  787. ret: #2#1
  788. arg: #2#1 v
  789. end:
  790. function: fma
  791. version: 9
  792. attrib: const
  793. w: 1, 2, 3, 4
  794. t: f32
  795. ret: #2#1
  796. arg: #2#1 multiplicand1
  797. arg: #2#1 multiplicand2
  798. arg: #2#1 offset
  799. summary: Multiply and add
  800. description:
  801. Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>.
  802. This function is similar to @mad(). fma() retains full precision of the multiplied result
  803. and rounds only after the addition. @mad() rounds after the multiplication and the addition.
  804. This extra precision is not guaranteed in rs_fp_relaxed mode.
  805. end:
  806. function: fma
  807. version: 24
  808. attrib: const
  809. w: 1, 2, 3, 4
  810. t: f16
  811. ret: #2#1
  812. arg: #2#1 multiplicand1
  813. arg: #2#1 multiplicand2
  814. arg: #2#1 offset
  815. end:
  816. function: fmax
  817. version: 9
  818. attrib: const
  819. w: 1, 2, 3, 4
  820. t: f32
  821. ret: #2#1
  822. arg: #2#1 a
  823. arg: #2#1 b
  824. summary: Maximum of two floats
  825. description:
  826. Returns the maximum of a and b, i.e. <code>(a &lt; b ? b : a)</code>.
  827. The @max() function returns identical results but can be applied to more data types.
  828. end:
  829. function: fmax
  830. version: 24
  831. attrib: const
  832. w: 1, 2, 3, 4
  833. t: f16
  834. ret: #2#1
  835. arg: #2#1 a
  836. arg: #2#1 b
  837. end:
  838. function: fmax
  839. version: 9
  840. attrib: const
  841. w: 2, 3, 4
  842. t: f32
  843. ret: #2#1
  844. arg: #2#1 a
  845. arg: #2 b
  846. end:
  847. function: fmax
  848. version: 24
  849. attrib: const
  850. w: 2, 3, 4
  851. t: f16
  852. ret: #2#1
  853. arg: #2#1 a
  854. arg: #2 b
  855. end:
  856. function: fmin
  857. version: 9
  858. attrib: const
  859. w: 1, 2, 3, 4
  860. t: f32
  861. ret: #2#1
  862. arg: #2#1 a
  863. arg: #2#1 b
  864. summary: Minimum of two floats
  865. description:
  866. Returns the minimum of a and b, i.e. <code>(a &gt; b ? b : a)</code>.
  867. The @min() function returns identical results but can be applied to more data types.
  868. end:
  869. function: fmin
  870. version: 24
  871. attrib: const
  872. w: 1, 2, 3, 4
  873. t: f16
  874. ret: #2#1
  875. arg: #2#1 a
  876. arg: #2#1 b
  877. end:
  878. function: fmin
  879. version: 9
  880. attrib: const
  881. w: 2, 3, 4
  882. t: f32
  883. ret: #2#1
  884. arg: #2#1 a
  885. arg: #2 b
  886. end:
  887. function: fmin
  888. version: 24
  889. attrib: const
  890. w: 2, 3, 4
  891. t: f16
  892. ret: #2#1
  893. arg: #2#1 a
  894. arg: #2 b
  895. end:
  896. function: fmod
  897. version: 9
  898. attrib: const
  899. w: 1, 2, 3, 4
  900. t: f32
  901. ret: #2#1
  902. arg: #2#1 numerator
  903. arg: #2#1 denominator
  904. summary: Modulo
  905. description:
  906. Returns the remainder of (numerator / denominator), where the quotient is rounded towards zero.
  907. The function @remainder() is similar but rounds toward the closest interger.
  908. For example, <code>fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
  909. while <code>@remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
  910. end:
  911. function: fmod
  912. version: 24
  913. attrib: const
  914. w: 1, 2, 3, 4
  915. t: f16
  916. ret: #2#1
  917. arg: #2#1 numerator
  918. arg: #2#1 denominator
  919. end:
  920. function: fract
  921. version: 9
  922. w: 1, 2, 3, 4
  923. t: f32
  924. ret: #2#1
  925. arg: #2#1 v, "Input value."
  926. arg: #2#1* floor, "If floor is not null, *floor will be set to the floor of v."
  927. summary: Positive fractional part
  928. description:
  929. Returns the positive fractional part of v, i.e. <code>v - floor(v)</code>.
  930. For example, <code>fract(1.3f, &amp;val)</code> returns 0.3f and sets val to 1.f.
  931. <code>fract(-1.3f, &amp;val)</code> returns 0.7f and sets val to -2.f.
  932. end:
  933. function: fract
  934. version: 9 23
  935. attrib: const
  936. w: 1, 2, 3, 4
  937. t: f32
  938. ret: #2#1
  939. arg: #2#1 v
  940. inline:
  941. #2#1 unused;
  942. return fract(v, &unused);
  943. end:
  944. function: fract
  945. version: 24
  946. w: 1, 2, 3, 4
  947. t: f32
  948. ret: #2#1
  949. arg: #2#1 v
  950. end:
  951. function: fract
  952. version: 24
  953. w: 1, 2, 3, 4
  954. t: f16
  955. ret: #2#1
  956. arg: #2#1 v
  957. arg: #2#1* floor
  958. end:
  959. function: fract
  960. version: 24
  961. w: 1, 2, 3, 4
  962. t: f16
  963. ret: #2#1
  964. arg: #2#1 v
  965. end:
  966. function: frexp
  967. version: 9
  968. w: 1, 2, 3, 4
  969. t: f32
  970. ret: #2#1
  971. arg: #2#1 v, "Input value."
  972. arg: int#1* exponent, "If exponent is not null, *exponent will be set to the exponent of v."
  973. summary: Binary mantissa and exponent
  974. description:
  975. Returns the binary mantissa and exponent of v, i.e. <code>v == mantissa * 2 ^ exponent</code>.
  976. The mantissa is always between 0.5 (inclusive) and 1.0 (exclusive).
  977. See @ldexp() for the reverse operation. See also @logb() and @ilogb().
  978. end:
  979. function: frexp
  980. version: 24
  981. w: 1, 2, 3, 4
  982. t: f16
  983. ret: #2#1
  984. arg: #2#1 v
  985. arg: int#1* exponent
  986. test: none
  987. end:
  988. function: half_recip
  989. version: 17
  990. attrib: const
  991. w: 1, 2, 3, 4
  992. t: f32
  993. ret: #2#1
  994. arg: #2#1 v
  995. summary: Reciprocal computed to 16 bit precision
  996. description:
  997. Returns the approximate reciprocal of a value.
  998. The precision is that of a 16 bit floating point value.
  999. See also @native_recip().
  1000. end:
  1001. function: half_rsqrt
  1002. version: 17
  1003. attrib: const
  1004. w: 1, 2, 3, 4
  1005. t: f32
  1006. ret: #2#1
  1007. arg: #2#1 v
  1008. summary: Reciprocal of a square root computed to 16 bit precision
  1009. description:
  1010. Returns the approximate value of <code>(1.f / sqrt(value))</code>.
  1011. The precision is that of a 16 bit floating point value.
  1012. See also @rsqrt(), @native_rsqrt().
  1013. end:
  1014. function: half_sqrt
  1015. version: 17
  1016. attrib: const
  1017. w: 1, 2, 3, 4
  1018. t: f32
  1019. ret: #2#1
  1020. arg: #2#1 v
  1021. summary: Square root computed to 16 bit precision
  1022. description:
  1023. Returns the approximate square root of a value.
  1024. The precision is that of a 16 bit floating point value.
  1025. See also @sqrt(), @native_sqrt().
  1026. end:
  1027. function: hypot
  1028. version: 9
  1029. attrib: const
  1030. w: 1, 2, 3, 4
  1031. t: f32
  1032. ret: #2#1
  1033. arg: #2#1 a
  1034. arg: #2#1 b
  1035. summary: Hypotenuse
  1036. description:
  1037. Returns the hypotenuse, i.e. <code>sqrt(a * a + b * b)</code>.
  1038. See also @native_hypot().
  1039. end:
  1040. function: hypot
  1041. version: 24
  1042. attrib: const
  1043. w: 1, 2, 3, 4
  1044. t: f16
  1045. ret: #2#1
  1046. arg: #2#1 a
  1047. arg: #2#1 b
  1048. end:
  1049. function: ilogb
  1050. version: 9
  1051. attrib: const
  1052. w: 1, 2, 3, 4
  1053. t: f32
  1054. ret: int#1
  1055. arg: float#1 v
  1056. summary: Base two exponent
  1057. description:
  1058. Returns the base two exponent of a value, where the mantissa is between
  1059. 1.f (inclusive) and 2.f (exclusive).
  1060. For example, <code>ilogb(8.5f)</code> returns 3.
  1061. Because of the difference in mantissa, this number is one less than is returned by @frexp().
  1062. @logb() is similar but returns a float.
  1063. test: custom
  1064. end:
  1065. function: ilogb
  1066. version: 24
  1067. attrib: const
  1068. w: 1, 2, 3, 4
  1069. t: f16
  1070. ret: int#1
  1071. arg: half#1 v
  1072. test: none
  1073. end:
  1074. function: ldexp
  1075. version: 9
  1076. attrib: const
  1077. w: 1, 2, 3, 4
  1078. ret: float#1
  1079. arg: float#1 mantissa, "Mantissa."
  1080. arg: int#1 exponent, "Exponent, a single component or matching vector."
  1081. summary: Creates a floating point from mantissa and exponent
  1082. description:
  1083. Returns the floating point created from the mantissa and exponent,
  1084. i.e. (mantissa * 2 ^ exponent).
  1085. See @frexp() for the reverse operation.
  1086. end:
  1087. function: ldexp
  1088. version: 24
  1089. attrib: const
  1090. w: 1, 2, 3, 4
  1091. ret: half#1
  1092. arg: half#1 mantissa
  1093. arg: int#1 exponent
  1094. test: none
  1095. end:
  1096. function: ldexp
  1097. version: 9
  1098. attrib: const
  1099. w: 2, 3, 4
  1100. ret: float#1
  1101. arg: float#1 mantissa
  1102. arg: int exponent
  1103. end:
  1104. function: ldexp
  1105. version: 24
  1106. attrib: const
  1107. w: 2, 3, 4
  1108. ret: half#1
  1109. arg: half#1 mantissa
  1110. arg: int exponent
  1111. test: none
  1112. end:
  1113. function: lgamma
  1114. version: 9
  1115. attrib: const
  1116. w: 1, 2, 3, 4
  1117. t: f32
  1118. ret: #2#1
  1119. arg: #2#1 v
  1120. summary: Natural logarithm of the gamma function
  1121. description:
  1122. Returns the natural logarithm of the absolute value of the gamma function,
  1123. i.e. <code>@log(@fabs(@tgamma(v)))</code>.
  1124. See also @tgamma().
  1125. end:
  1126. function: lgamma
  1127. version: 24
  1128. attrib: const
  1129. w: 1, 2, 3, 4
  1130. t: f16
  1131. ret: #2#1
  1132. arg: #2#1 v
  1133. test: none
  1134. end:
  1135. function: lgamma
  1136. version: 9
  1137. w: 1, 2, 3, 4
  1138. t: f32
  1139. ret: #2#1
  1140. arg: #2#1 v
  1141. arg: 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."
  1142. test: custom
  1143. #TODO Temporary until bionic & associated drivers are fixed
  1144. end:
  1145. function: lgamma
  1146. version: 24
  1147. w: 1, 2, 3, 4
  1148. t: f16
  1149. ret: #2#1
  1150. arg: #2#1 v
  1151. arg: int#1* sign_of_gamma
  1152. test: none
  1153. end:
  1154. function: log
  1155. version: 9
  1156. attrib: const
  1157. w: 1, 2, 3, 4
  1158. t: f32
  1159. ret: #2#1
  1160. arg: #2#1 v
  1161. summary: Natural logarithm
  1162. description:
  1163. Returns the natural logarithm.
  1164. See also @native_log().
  1165. end:
  1166. function: log
  1167. version: 24
  1168. attrib: const
  1169. w: 1, 2, 3, 4
  1170. t: f16
  1171. ret: #2#1
  1172. arg: #2#1 v
  1173. end:
  1174. function: log10
  1175. version: 9
  1176. attrib: const
  1177. w: 1, 2, 3, 4
  1178. t: f32
  1179. ret: #2#1
  1180. arg: #2#1 v
  1181. summary: Base 10 logarithm
  1182. description:
  1183. Returns the base 10 logarithm.
  1184. See also @native_log10().
  1185. end:
  1186. function: log10
  1187. version: 24
  1188. attrib: const
  1189. w: 1, 2, 3, 4
  1190. t: f16
  1191. ret: #2#1
  1192. arg: #2#1 v
  1193. end:
  1194. function: log1p
  1195. version: 9
  1196. attrib: const
  1197. w: 1, 2, 3, 4
  1198. t: f32
  1199. ret: #2#1
  1200. arg: #2#1 v
  1201. summary: Natural logarithm of a value plus 1
  1202. description:
  1203. Returns the natural logarithm of <code>(v + 1.f)</code>.
  1204. See also @native_log1p().
  1205. end:
  1206. function: log1p
  1207. version: 24
  1208. attrib: const
  1209. w: 1, 2, 3, 4
  1210. t: f16
  1211. ret: #2#1
  1212. arg: #2#1 v
  1213. end:
  1214. function: log2
  1215. version: 9
  1216. attrib: const
  1217. w: 1, 2, 3, 4
  1218. t: f32
  1219. ret: #2#1
  1220. arg: #2#1 v
  1221. summary: Base 2 logarithm
  1222. description:
  1223. Returns the base 2 logarithm.
  1224. See also @native_log2().
  1225. end:
  1226. function: log2
  1227. version: 24
  1228. attrib: const
  1229. w: 1, 2, 3, 4
  1230. t: f16
  1231. ret: #2#1
  1232. arg: #2#1 v
  1233. end:
  1234. function: logb
  1235. version: 9
  1236. attrib: const
  1237. w: 1, 2, 3, 4
  1238. t: f32
  1239. ret: #2#1
  1240. arg: #2#1 v
  1241. summary: Base two exponent
  1242. description:
  1243. Returns the base two exponent of a value, where the mantissa is between
  1244. 1.f (inclusive) and 2.f (exclusive).
  1245. For example, <code>logb(8.5f)</code> returns 3.f.
  1246. Because of the difference in mantissa, this number is one less than is returned by frexp().
  1247. @ilogb() is similar but returns an integer.
  1248. end:
  1249. function: logb
  1250. version: 24
  1251. attrib: const
  1252. w: 1, 2, 3, 4
  1253. t: f16
  1254. ret: #2#1
  1255. arg: #2#1 v
  1256. end:
  1257. function: mad
  1258. version: 9
  1259. attrib: const
  1260. w: 1, 2, 3, 4
  1261. t: f32
  1262. ret: #2#1
  1263. arg: #2#1 multiplicand1
  1264. arg: #2#1 multiplicand2
  1265. arg: #2#1 offset
  1266. summary: Multiply and add
  1267. description:
  1268. Multiply and add. Returns <code>(multiplicand1 * multiplicand2) + offset</code>.
  1269. This function is similar to @fma(). @fma() retains full precision of the multiplied result
  1270. and rounds only after the addition. mad() rounds after the multiplication and the addition.
  1271. In rs_fp_relaxed mode, mad() may not do the rounding after multiplicaiton.
  1272. end:
  1273. function: mad
  1274. version: 24
  1275. attrib: const
  1276. w: 1, 2, 3, 4
  1277. t: f16
  1278. ret: #2#1
  1279. arg: #2#1 multiplicand1
  1280. arg: #2#1 multiplicand2
  1281. arg: #2#1 offset
  1282. end:
  1283. function: max
  1284. version: 9
  1285. attrib: const
  1286. w: 1, 2, 3, 4
  1287. t: f32
  1288. ret: #2#1
  1289. arg: #2#1 a
  1290. arg: #2#1 b
  1291. summary: Maximum
  1292. description:
  1293. Returns the maximum value of two arguments.
  1294. end:
  1295. function: max
  1296. version:24
  1297. attrib: const
  1298. w: 1, 2, 3, 4
  1299. t: f16
  1300. ret: #2#1
  1301. arg: #2#1 a
  1302. arg: #2#1 b
  1303. end:
  1304. function: max
  1305. version: 9
  1306. attrib: const
  1307. w: 2, 3, 4
  1308. t: f32
  1309. ret: #2#1
  1310. arg: #2#1 a
  1311. arg: #2 b
  1312. end:
  1313. function: max
  1314. version: 24
  1315. attrib: const
  1316. w: 2, 3, 4
  1317. t: f16
  1318. ret: #2#1
  1319. arg: #2#1 a
  1320. arg: #2 b
  1321. end:
  1322. function: max
  1323. version: 9 20
  1324. attrib: const
  1325. w: 1
  1326. t: i8, i16, i32, u8, u16, u32
  1327. ret: #2#1
  1328. arg: #2#1 a
  1329. arg: #2#1 b
  1330. inline:
  1331. return (a > b ? a : b);
  1332. end:
  1333. function: max
  1334. version: 9 20
  1335. attrib: const
  1336. w: 2
  1337. t: i8, i16, i32, u8, u16, u32
  1338. ret: #2#1
  1339. arg: #2#1 a
  1340. arg: #2#1 b
  1341. inline:
  1342. #2#1 tmp;
  1343. tmp.x = (a.x > b.x ? a.x : b.x);
  1344. tmp.y = (a.y > b.y ? a.y : b.y);
  1345. return tmp;
  1346. end:
  1347. function: max
  1348. version: 9 20
  1349. attrib: const
  1350. w: 3
  1351. t: i8, i16, i32, u8, u16, u32
  1352. ret: #2#1
  1353. arg: #2#1 a
  1354. arg: #2#1 b
  1355. inline:
  1356. #2#1 tmp;
  1357. tmp.x = (a.x > b.x ? a.x : b.x);
  1358. tmp.y = (a.y > b.y ? a.y : b.y);
  1359. tmp.z = (a.z > b.z ? a.z : b.z);
  1360. return tmp;
  1361. end:
  1362. function: max
  1363. version: 9 20
  1364. attrib: const
  1365. w: 4
  1366. t: i8, i16, i32, u8, u16, u32
  1367. ret: #2#1
  1368. arg: #2#1 a
  1369. arg: #2#1 b
  1370. inline:
  1371. #2#1 tmp;
  1372. tmp.x = (a.x > b.x ? a.x : b.x);
  1373. tmp.y = (a.y > b.y ? a.y : b.y);
  1374. tmp.z = (a.z > b.z ? a.z : b.z);
  1375. tmp.w = (a.w > b.w ? a.w : b.w);
  1376. return tmp;
  1377. end:
  1378. function: max
  1379. version: 21
  1380. attrib: const
  1381. w: 1, 2, 3, 4
  1382. t: i8, i16, i32, i64, u8, u16, u32, u64
  1383. ret: #2#1
  1384. arg: #2#1 a
  1385. arg: #2#1 b
  1386. end:
  1387. function: min
  1388. version: 9
  1389. attrib: const
  1390. w: 1, 2, 3, 4
  1391. t: f32
  1392. ret: #2#1
  1393. arg: #2#1 a
  1394. arg: #2#1 b
  1395. summary: Minimum
  1396. description:
  1397. Returns the minimum value of two arguments.
  1398. end:
  1399. function: min
  1400. version: 24
  1401. attrib: const
  1402. w: 1, 2, 3, 4
  1403. t: f16
  1404. ret: #2#1
  1405. arg: #2#1 a
  1406. arg: #2#1 b
  1407. end:
  1408. function: min
  1409. version: 9
  1410. attrib: const
  1411. w: 2, 3, 4
  1412. t: f32
  1413. ret: #2#1
  1414. arg: #2#1 a
  1415. arg: #2 b
  1416. end:
  1417. function: min
  1418. version: 24
  1419. attrib: const
  1420. w: 2, 3, 4
  1421. t: f16
  1422. ret: #2#1
  1423. arg: #2#1 a
  1424. arg: #2 b
  1425. end:
  1426. function: min
  1427. version: 9 20
  1428. attrib: const
  1429. w: 1
  1430. t: i8, i16, i32, u8, u16, u32
  1431. ret: #2#1
  1432. arg: #2#1 a
  1433. arg: #2#1 b
  1434. inline:
  1435. return (a < b ? a : b);
  1436. end:
  1437. function: min
  1438. version: 9 20
  1439. attrib: const
  1440. w: 2
  1441. t: i8, i16, i32, u8, u16, u32
  1442. ret: #2#1
  1443. arg: #2#1 a
  1444. arg: #2#1 b
  1445. inline:
  1446. #2#1 tmp;
  1447. tmp.x = (a.x < b.x ? a.x : b.x);
  1448. tmp.y = (a.y < b.y ? a.y : b.y);
  1449. return tmp;
  1450. end:
  1451. function: min
  1452. version: 9 20
  1453. attrib: const
  1454. w: 3
  1455. t: i8, i16, i32, u8, u16, u32
  1456. ret: #2#1
  1457. arg: #2#1 a
  1458. arg: #2#1 b
  1459. inline:
  1460. #2#1 tmp;
  1461. tmp.x = (a.x < b.x ? a.x : b.x);
  1462. tmp.y = (a.y < b.y ? a.y : b.y);
  1463. tmp.z = (a.z < b.z ? a.z : b.z);
  1464. return tmp;
  1465. end:
  1466. function: min
  1467. version: 9 20
  1468. attrib: const
  1469. w: 4
  1470. t: i8, i16, i32, u8, u16, u32
  1471. ret: #2#1
  1472. arg: #2#1 a
  1473. arg: #2#1 b
  1474. inline:
  1475. #2#1 tmp;
  1476. tmp.x = (a.x < b.x ? a.x : b.x);
  1477. tmp.y = (a.y < b.y ? a.y : b.y);
  1478. tmp.z = (a.z < b.z ? a.z : b.z);
  1479. tmp.w = (a.w < b.w ? a.w : b.w);
  1480. return tmp;
  1481. end:
  1482. function: min
  1483. version: 21
  1484. attrib: const
  1485. w: 1, 2, 3, 4
  1486. t: i8, i16, i32, i64, u8, u16, u32, u64
  1487. ret: #2#1
  1488. arg: #2#1 a
  1489. arg: #2#1 b
  1490. end:
  1491. function: mix
  1492. version: 9
  1493. attrib: const
  1494. w: 1, 2, 3, 4
  1495. t: f32
  1496. ret: #2#1
  1497. arg: #2#1 start
  1498. arg: #2#1 stop
  1499. arg: #2#1 fraction
  1500. summary: Mixes two values
  1501. description:
  1502. Returns start + ((stop - start) * fraction).
  1503. This can be useful for mixing two values. For example, to create a new color that is
  1504. 40% color1 and 60% color2, use <code>mix(color1, color2, 0.6f)</code>.
  1505. end:
  1506. function: mix
  1507. version: 24
  1508. attrib: const
  1509. w: 1, 2, 3, 4
  1510. t: f16
  1511. ret: #2#1
  1512. arg: #2#1 start
  1513. arg: #2#1 stop
  1514. arg: #2#1 fraction
  1515. end:
  1516. function: mix
  1517. version: 9
  1518. attrib: const
  1519. w: 2, 3, 4
  1520. t: f32
  1521. ret: #2#1
  1522. arg: #2#1 start
  1523. arg: #2#1 stop
  1524. arg: #2 fraction
  1525. end:
  1526. function: mix
  1527. version: 24
  1528. attrib: const
  1529. w: 2, 3, 4
  1530. t: f16
  1531. ret: #2#1
  1532. arg: #2#1 start
  1533. arg: #2#1 stop
  1534. arg: #2 fraction
  1535. end:
  1536. function: modf
  1537. version: 9
  1538. w: 1, 2, 3, 4
  1539. t: f32
  1540. ret: #2#1, "Floating point portion of the value."
  1541. arg: #2#1 v, "Source value."
  1542. arg: #2#1* integral_part, "*integral_part will be set to the integral portion of the number."
  1543. summary: Integral and fractional components
  1544. description:
  1545. Returns the integral and fractional components of a number.
  1546. Both components will have the same sign as x. For example, for an input of -3.72f,
  1547. *integral_part will be set to -3.f and .72f will be returned.
  1548. end:
  1549. function: modf
  1550. version: 24
  1551. w: 1, 2, 3, 4
  1552. t: f16
  1553. ret: #2#1
  1554. arg: #2#1 v
  1555. arg: #2#1* integral_part
  1556. test: none
  1557. end:
  1558. function: nan
  1559. version: 9
  1560. attrib: const
  1561. w: 1
  1562. t: f32
  1563. ret: #2#1
  1564. arg: uint#1 v, "Not used."
  1565. #TODO We're not using the argument. Once we do, add this documentation line:
  1566. # The argument is embedded into the return value and can be used to distinguish various NaNs.
  1567. summary: Not a Number
  1568. description:
  1569. Returns a NaN value (Not a Number).
  1570. end:
  1571. function: nan_half
  1572. version: 24
  1573. attrib: const
  1574. t: f16
  1575. ret: #1
  1576. summary: Not a Number
  1577. description:
  1578. Returns a half-precision floating point NaN value (Not a Number).
  1579. end:
  1580. function: native_acos
  1581. version: 21
  1582. attrib: const
  1583. w: 1, 2, 3, 4
  1584. t: f32
  1585. ret: #2#1
  1586. arg: #2#1 v, range(-1,1)
  1587. summary: Approximate inverse cosine
  1588. description:
  1589. Returns the approximate inverse cosine, in radians.
  1590. This function yields undefined results from input values less than -1 or greater than 1.
  1591. See also @acos().
  1592. # TODO Temporary
  1593. test: limited(0.0005)
  1594. end:
  1595. function: native_acos
  1596. version: 24
  1597. attrib: const
  1598. w: 1, 2, 3, 4
  1599. t: f16
  1600. ret: #2#1
  1601. arg: #2#1 v, range(-1,1)
  1602. # Absolute error of 2^-11, i.e. 0.00048828125
  1603. test: limited(0.00048828125)
  1604. end:
  1605. function: native_acosh
  1606. version: 21
  1607. attrib: const
  1608. w: 1, 2, 3, 4
  1609. t: f32
  1610. ret: #2#1
  1611. arg: #2#1 v
  1612. summary: Approximate inverse hyperbolic cosine
  1613. description:
  1614. Returns the approximate inverse hyperbolic cosine, in radians.
  1615. See also @acosh().
  1616. # TODO Temporary
  1617. test: limited(0.0005)
  1618. end:
  1619. function: native_acosh
  1620. version: 24
  1621. attrib: const
  1622. w: 1, 2, 3, 4
  1623. t: f16
  1624. ret: #2#1
  1625. arg: #2#1 v
  1626. end:
  1627. function: native_acospi
  1628. version: 21
  1629. attrib: const
  1630. w: 1, 2, 3, 4
  1631. t: f32
  1632. ret: #2#1
  1633. arg: #2#1 v, range(-1,1)
  1634. summary: Approximate inverse cosine divided by pi
  1635. description:
  1636. Returns the approximate inverse cosine in radians, divided by pi.
  1637. To get an inverse cosine measured in degrees, use <code>acospi(a) * 180.f</code>.
  1638. This function yields undefined results from input values less than -1 or greater than 1.
  1639. See also @acospi().
  1640. # TODO Temporary
  1641. test: limited(0.0005)
  1642. end:
  1643. function: native_acospi
  1644. version: 24
  1645. attrib: const
  1646. w: 1, 2, 3, 4
  1647. t: f16
  1648. ret: #2#1
  1649. arg: #2#1 v, range(-1,1)
  1650. # Absolute error of 2^-11, i.e. 0.00048828125
  1651. test: limited(0.00048828125)
  1652. end:
  1653. function: native_asin
  1654. version: 21
  1655. attrib: const
  1656. w: 1, 2, 3, 4
  1657. t: f32
  1658. ret: #2#1
  1659. arg: #2#1 v, range(-1,1)
  1660. summary: Approximate inverse sine
  1661. description:
  1662. Returns the approximate inverse sine, in radians.
  1663. This function yields undefined results from input values less than -1 or greater than 1.
  1664. See also @asin().
  1665. # TODO Temporary
  1666. test: limited(0.0005)
  1667. end:
  1668. function: native_asin
  1669. version: 24
  1670. attrib: const
  1671. w: 1, 2, 3, 4
  1672. t: f16
  1673. ret: #2#1
  1674. arg: #2#1 v, range(-1,1)
  1675. # Absolute error of 2^-11, i.e. 0.00048828125
  1676. test: limited(0.00048828125)
  1677. end:
  1678. function: native_asinh
  1679. version: 21
  1680. attrib: const
  1681. w: 1, 2, 3, 4
  1682. t: f32
  1683. ret: #2#1
  1684. arg: #2#1 v
  1685. summary: Approximate inverse hyperbolic sine
  1686. description:
  1687. Returns the approximate inverse hyperbolic sine, in radians.
  1688. See also @asinh().
  1689. # TODO Temporary
  1690. test: limited(0.0005)
  1691. end:
  1692. function: native_asinh
  1693. version: 24
  1694. attrib: const
  1695. w: 1, 2, 3, 4
  1696. t: f16
  1697. ret: #2#1
  1698. arg: #2#1 v
  1699. end:
  1700. function: native_asinpi
  1701. version: 21
  1702. attrib: const
  1703. w: 1, 2, 3, 4
  1704. t: f32
  1705. ret: #2#1
  1706. arg: #2#1 v, range(-1,1)
  1707. summary: Approximate inverse sine divided by pi
  1708. description:
  1709. Returns the approximate inverse sine in radians, divided by pi.
  1710. To get an inverse sine measured in degrees, use <code>asinpi(a) * 180.f</code>.
  1711. This function yields undefined results from input values less than -1 or greater than 1.
  1712. See also @asinpi().
  1713. # TODO Temporary
  1714. test: limited(0.0005)
  1715. end:
  1716. function: native_asinpi
  1717. version: 24
  1718. attrib: const
  1719. w: 1, 2, 3, 4
  1720. t: f16
  1721. ret: #2#1
  1722. arg: #2#1 v, range(-1,1)
  1723. # Absolute error of 2^-11, i.e. 0.00048828125
  1724. test: limited(0.00048828125)
  1725. end:
  1726. function: native_atan
  1727. version: 21
  1728. attrib: const
  1729. w: 1, 2, 3, 4
  1730. t: f32
  1731. ret: #2#1
  1732. arg: #2#1 v, range(-1,1)
  1733. summary: Approximate inverse tangent
  1734. description:
  1735. Returns the approximate inverse tangent, in radians.
  1736. See also @atan().
  1737. # TODO Temporary
  1738. test: limited(0.0005)
  1739. end:
  1740. function: native_atan
  1741. version: 24
  1742. attrib: const
  1743. w: 1, 2, 3, 4
  1744. t: f16
  1745. ret: #2#1
  1746. arg: #2#1 v, range(-1, 1)
  1747. end:
  1748. function: native_atan2
  1749. version: 21
  1750. attrib: const
  1751. w: 1, 2, 3, 4
  1752. t: f32
  1753. ret: #2#1
  1754. arg: #2#1 numerator, "Numerator."
  1755. arg: #2#1 denominator, "Denominator. Can be 0."
  1756. summary: Approximate inverse tangent of a ratio
  1757. description:
  1758. Returns the approximate inverse tangent of <code>(numerator / denominator)</code>, in radians.
  1759. See also @atan2().
  1760. # TODO Temporary
  1761. test: limited(0.0005)
  1762. end:
  1763. function: native_atan2
  1764. version: 24
  1765. attrib: const
  1766. w: 1, 2, 3, 4
  1767. t: f16
  1768. ret: #2#1
  1769. arg: #2#1 numerator
  1770. arg: #2#1 denominator
  1771. end:
  1772. function: native_atan2pi
  1773. version: 21
  1774. attrib: const
  1775. w: 1, 2, 3, 4
  1776. t: f32
  1777. ret: #2#1
  1778. arg: #2#1 numerator, "Numerator."
  1779. arg: #2#1 denominator, "Denominator. Can be 0."
  1780. summary: Approximate inverse tangent of a ratio, divided by pi
  1781. description:
  1782. Returns the approximate inverse tangent of <code>(numerator / denominator)</code>,
  1783. in radians, divided by pi.
  1784. To get an inverse tangent measured in degrees, use <code>atan2pi(n, d) * 180.f</code>.
  1785. See also @atan2pi().
  1786. # TODO Temporary
  1787. test: limited(0.0005)
  1788. end:
  1789. function: native_atan2pi
  1790. version: 24
  1791. attrib: const
  1792. w: 1, 2, 3, 4
  1793. t: f16
  1794. ret: #2#1
  1795. arg: #2#1 numerator
  1796. arg: #2#1 denominator
  1797. end:
  1798. function: native_atanh
  1799. version: 21
  1800. attrib: const
  1801. w: 1, 2, 3, 4
  1802. t: f32
  1803. ret: #2#1
  1804. arg: #2#1 v, range(-1,1)
  1805. summary: Approximate inverse hyperbolic tangent
  1806. description:
  1807. Returns the approximate inverse hyperbolic tangent, in radians.
  1808. See also @atanh().
  1809. # TODO Temporary
  1810. test: limited(0.0005)
  1811. end:
  1812. function: native_atanh
  1813. version: 24
  1814. attrib: const
  1815. w: 1, 2, 3, 4
  1816. t: f16
  1817. ret: #2#1
  1818. arg: #2#1 v, range(-1,1)
  1819. end:
  1820. function: native_atanpi
  1821. version: 21
  1822. attrib: const
  1823. w: 1, 2, 3, 4
  1824. t: f32
  1825. ret: #2#1
  1826. arg: #2#1 v, range(-1,1)
  1827. summary: Approximate inverse tangent divided by pi
  1828. description:
  1829. Returns the approximate inverse tangent in radians, divided by pi.
  1830. To get an inverse tangent measured in degrees, use <code>atanpi(a) * 180.f</code>.
  1831. See also @atanpi().
  1832. # TODO Temporary
  1833. test: limited(0.0005)
  1834. end:
  1835. function: native_atanpi
  1836. version: 24
  1837. attrib: const
  1838. w: 1, 2, 3, 4
  1839. t: f16
  1840. ret: #2#1
  1841. arg: #2#1 v, range(-1,1)
  1842. end:
  1843. function: native_cbrt
  1844. version: 21
  1845. attrib: const
  1846. w: 1, 2, 3, 4
  1847. t: f32
  1848. ret: #2#1
  1849. arg: #2#1 v
  1850. summary: Approximate cube root
  1851. description:
  1852. Returns the approximate cubic root.
  1853. See also @cbrt().
  1854. end:
  1855. function: native_cbrt
  1856. version: 24
  1857. attrib: const
  1858. w: 1, 2, 3, 4
  1859. t: f16
  1860. ret: #2#1
  1861. arg: #2#1 v
  1862. end:
  1863. function: native_cos
  1864. version: 21
  1865. attrib: const
  1866. w: 1, 2, 3, 4
  1867. t: f32
  1868. ret: #2#1
  1869. arg: #2#1 v
  1870. summary: Approximate cosine
  1871. description:
  1872. Returns the approximate cosine of an angle measured in radians.
  1873. See also @cos().
  1874. end:
  1875. function: native_cos
  1876. version: 24
  1877. attrib: const
  1878. w: 1, 2, 3, 4
  1879. t: f16
  1880. ret: #2#1
  1881. arg: #2#1 v, range(-314,314)
  1882. # Absolute error of 2^-11, i.e. 0.00048828125
  1883. test: limited(0.00048828125)
  1884. end:
  1885. function: native_cosh
  1886. version: 21
  1887. attrib: const
  1888. w: 1, 2, 3, 4
  1889. t: f32
  1890. ret: #2#1
  1891. arg: #2#1 v
  1892. summary: Approximate hypebolic cosine
  1893. description:
  1894. Returns the approximate hypebolic cosine.
  1895. See also @cosh().
  1896. end:
  1897. function: native_cosh
  1898. version: 24
  1899. attrib: const
  1900. w: 1, 2, 3, 4
  1901. t: f16
  1902. ret: #2#1
  1903. arg: #2#1 v
  1904. end:
  1905. function: native_cospi
  1906. version: 21
  1907. attrib: const
  1908. w: 1, 2, 3, 4
  1909. t: f32
  1910. ret: #2#1
  1911. arg: #2#1 v
  1912. summary: Approximate cosine of a number multiplied by pi
  1913. description:
  1914. Returns the approximate cosine of (v * pi), where (v * pi) is measured in radians.
  1915. To get the cosine of a value measured in degrees, call <code>cospi(v / 180.f)</code>.
  1916. See also @cospi().
  1917. end:
  1918. function: native_cospi
  1919. version: 24
  1920. attrib: const
  1921. w: 1, 2, 3, 4
  1922. t: f16
  1923. ret: #2#1
  1924. arg: #2#1 v, range(-100,100)
  1925. # Absolute error of 2^-11, i.e. 0.00048828125
  1926. test: limited(0.00048828125)
  1927. end:
  1928. function: native_divide
  1929. version: 21
  1930. attrib: const
  1931. w: 1, 2, 3, 4
  1932. t: f32
  1933. ret: #2#1
  1934. arg: #2#1 left_vector
  1935. arg: #2#1 right_vector
  1936. summary: Approximate division
  1937. description:
  1938. Computes the approximate division of two values.
  1939. end:
  1940. function: native_divide
  1941. version: 24
  1942. attrib: const
  1943. w: 1, 2, 3, 4
  1944. t: f16
  1945. ret: #2#1
  1946. arg: #2#1 left_vector
  1947. arg: #2#1 right_vector
  1948. end:
  1949. function: native_exp
  1950. version: 18
  1951. attrib: const
  1952. w: 1, 2, 3, 4
  1953. t: f32
  1954. ret: #2#1
  1955. arg: #2#1 v, range(-86,86)
  1956. summary: Approximate e raised to a number
  1957. description:
  1958. Fast approximate exp.
  1959. It is valid for inputs from -86.f to 86.f. The precision is no worse than what would be
  1960. expected from using 16 bit floating point values.
  1961. See also @exp().
  1962. test: limited
  1963. end:
  1964. function: native_exp
  1965. version: 24
  1966. attrib: const
  1967. w: 1, 2, 3, 4
  1968. t: f16
  1969. ret: #2#1
  1970. arg: #2#1 v, range(-86,86)
  1971. end:
  1972. function: native_exp10
  1973. version: 18
  1974. attrib: const
  1975. w: 1, 2, 3, 4
  1976. t: f32
  1977. ret: #2#1
  1978. arg: #2#1 v, range(-37,37)
  1979. summary: Approximate 10 raised to a number
  1980. description:
  1981. Fast approximate exp10.
  1982. It is valid for inputs from -37.f to 37.f. The precision is no worse than what would be
  1983. expected from using 16 bit floating point values.
  1984. See also @exp10().
  1985. test: limited
  1986. end:
  1987. function: native_exp10
  1988. version: 24
  1989. attrib: const
  1990. w: 1, 2, 3, 4
  1991. t: f16
  1992. ret: #2#1
  1993. arg: #2#1 v, range(-37,37)
  1994. end:
  1995. function: native_exp2
  1996. version: 18
  1997. attrib: const
  1998. w: 1, 2, 3, 4
  1999. t: f32
  2000. ret: #2#1
  2001. arg: #2#1 v, range(-125,125)
  2002. summary: Approximate 2 raised to a number
  2003. description:
  2004. Fast approximate exp2.
  2005. It is valid for inputs from -125.f to 125.f. The precision is no worse than what would be
  2006. expected from using 16 bit floating point values.
  2007. See also @exp2().
  2008. test: limited
  2009. end:
  2010. function: native_exp2
  2011. version: 24
  2012. attrib: const
  2013. w: 1, 2, 3, 4
  2014. t: f16
  2015. ret: #2#1
  2016. arg: #2#1 v, range(-125,125)
  2017. end:
  2018. function: native_expm1
  2019. version: 21
  2020. attrib: const
  2021. w: 1, 2, 3, 4
  2022. t: f32
  2023. ret: #2#1
  2024. arg: #2#1 v
  2025. summary: Approximate e raised to a number minus one
  2026. description:
  2027. Returns the approximate (e ^ v) - 1.
  2028. See also @expm1().
  2029. end:
  2030. function: native_expm1
  2031. version: 24
  2032. attrib: const
  2033. w: 1, 2, 3, 4
  2034. t: f16
  2035. ret: #2#1
  2036. arg: #2#1 v
  2037. test: custom
  2038. end:
  2039. function: native_hypot
  2040. version: 21
  2041. attrib: const
  2042. w: 1, 2, 3, 4
  2043. t: f32
  2044. ret: #2#1
  2045. arg: #2#1 a
  2046. arg: #2#1 b
  2047. summary: Approximate hypotenuse
  2048. description:
  2049. Returns the approximate native_sqrt(a * a + b * b)
  2050. See also @hypot().
  2051. end:
  2052. function: native_hypot
  2053. version: 24
  2054. attrib: const
  2055. w: 1, 2, 3, 4
  2056. t: f16
  2057. ret: #2#1
  2058. arg: #2#1 a
  2059. arg: #2#1 b
  2060. end:
  2061. function: native_log
  2062. version: 18
  2063. attrib: const
  2064. w: 1, 2, 3, 4
  2065. t: f32
  2066. ret: #2#1
  2067. arg: #2#1 v, range(10e-10,10e10)
  2068. summary: Approximate natural logarithm
  2069. description:
  2070. Fast approximate log.
  2071. It is not accurate for values very close to zero.
  2072. See also @log().
  2073. test: limited
  2074. end:
  2075. function: native_log
  2076. version: 24
  2077. attrib: const
  2078. w: 1, 2, 3, 4
  2079. t: f16
  2080. ret: #2#1
  2081. arg: #2#1 v, range(10e-5,65504)
  2082. end:
  2083. function: native_log10
  2084. version: 18
  2085. attrib: const
  2086. w: 1, 2, 3, 4
  2087. t: f32
  2088. ret: #2#1
  2089. arg: #2#1 v, range(10e-10,10e10)
  2090. summary: Approximate base 10 logarithm
  2091. description:
  2092. Fast approximate log10.
  2093. It is not accurate for values very close to zero.
  2094. See also @log10().
  2095. test: limited
  2096. end:
  2097. function: native_log10
  2098. version: 24
  2099. attrib: const
  2100. w: 1, 2, 3, 4
  2101. t: f16
  2102. ret: #2#1
  2103. arg: #2#1 v, range(10e-5,65504)
  2104. end:
  2105. function: native_log1p
  2106. version: 21
  2107. attrib: const
  2108. w: 1, 2, 3, 4
  2109. t: f32
  2110. ret: #2#1
  2111. arg: #2#1 v
  2112. summary: Approximate natural logarithm of a value plus 1
  2113. description:
  2114. Returns the approximate natural logarithm of (v + 1.0f)
  2115. See also @log1p().
  2116. end:
  2117. function: native_log1p
  2118. version: 24
  2119. attrib: const
  2120. w: 1, 2, 3, 4
  2121. t: f16
  2122. ret: #2#1
  2123. arg: #2#1 v
  2124. end:
  2125. function: native_log2
  2126. version: 18
  2127. attrib: const
  2128. w: 1, 2, 3, 4
  2129. t: f32
  2130. ret: #2#1
  2131. arg: #2#1 v, range(10e-10,10e10)
  2132. summary: Approximate base 2 logarithm
  2133. description:
  2134. Fast approximate log2.
  2135. It is not accurate for values very close to zero.
  2136. See also @log2().
  2137. test: limited
  2138. end:
  2139. function: native_log2
  2140. version: 24
  2141. attrib: const
  2142. w: 1, 2, 3, 4
  2143. t: f16
  2144. ret: #2#1
  2145. arg: #2#1 v, range(10e-5,65504)
  2146. end:
  2147. function: native_powr
  2148. version: 18
  2149. attrib: const
  2150. w: 1, 2, 3, 4
  2151. t: f32
  2152. ret: #2#1
  2153. arg: #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."
  2154. arg: #2#1 exponent, range(-15,15), "Must be between -15.f and 15.f."
  2155. summary: Approximate positive base raised to an exponent
  2156. description:
  2157. Fast approximate (base ^ exponent).
  2158. See also @powr().
  2159. test: limited
  2160. end:
  2161. function: native_powr
  2162. version: 24
  2163. attrib: const
  2164. w: 1, 2, 3, 4
  2165. t: f16
  2166. ret: #2#1
  2167. arg: #2#1 base, range(0,256)
  2168. arg: #2#1 exponent, range(-15,15)
  2169. end:
  2170. function: native_recip
  2171. version: 21
  2172. attrib: const
  2173. w: 1, 2, 3, 4
  2174. t: f32
  2175. ret: #2#1
  2176. arg: #2#1 v
  2177. summary: Approximate reciprocal
  2178. description:
  2179. Returns the approximate approximate reciprocal of a value.
  2180. See also @half_recip().
  2181. end:
  2182. function: native_recip
  2183. version: 24
  2184. attrib: const
  2185. w: 1, 2, 3, 4
  2186. t: f16
  2187. ret: #2#1
  2188. arg: #2#1 v
  2189. end:
  2190. function: native_rootn
  2191. version: 21
  2192. attrib: const
  2193. w: 1, 2, 3, 4
  2194. t: f32
  2195. ret: #2#1
  2196. arg: #2#1 v
  2197. arg: int#1 n
  2198. summary: Approximate nth root
  2199. description:
  2200. Compute the approximate Nth root of a value.
  2201. See also @rootn().
  2202. end:
  2203. function: native_rootn
  2204. version: 24
  2205. attrib: const
  2206. w: 1, 2, 3, 4
  2207. t: f16
  2208. ret: #2#1
  2209. arg: #2#1 v
  2210. arg: int#1 n
  2211. test: none
  2212. end:
  2213. function: native_rsqrt
  2214. version: 21
  2215. attrib: const
  2216. w: 1, 2, 3, 4
  2217. t: f32
  2218. ret: #2#1
  2219. arg: #2#1 v
  2220. summary: Approximate reciprocal of a square root
  2221. description:
  2222. Returns approximate (1 / sqrt(v)).
  2223. See also @rsqrt(), @half_rsqrt().
  2224. end:
  2225. function: native_rsqrt
  2226. version: 24
  2227. attrib: const
  2228. w: 1, 2, 3, 4
  2229. t: f16
  2230. ret: #2#1
  2231. arg: #2#1 v
  2232. end:
  2233. function: native_sin
  2234. version: 21
  2235. attrib: const
  2236. w: 1, 2, 3, 4
  2237. t: f32
  2238. ret: #2#1
  2239. arg: #2#1 v
  2240. summary: Approximate sine
  2241. description:
  2242. Returns the approximate sine of an angle measured in radians.
  2243. See also @sin().
  2244. end:
  2245. function: native_sin
  2246. version: 24
  2247. attrib: const
  2248. w: 1, 2, 3, 4
  2249. t: f16
  2250. ret: #2#1
  2251. arg: #2#1 v, range(-314,314)
  2252. # Absolute error of 2^-11, i.e. 0.00048828125
  2253. test: limited(0.00048828125)
  2254. end:
  2255. function: native_sincos
  2256. version: 21
  2257. w: 1, 2, 3, 4
  2258. t: f32
  2259. ret: #2#1, "Sine."
  2260. arg: #2#1 v, "Incoming value in radians."
  2261. arg: #2#1* cos, "*cos will be set to the cosine value."
  2262. summary: Approximate sine and cosine
  2263. description:
  2264. Returns the approximate sine and cosine of a value.
  2265. See also @sincos().
  2266. # TODO Temporary
  2267. test: limited(0.0005)
  2268. end:
  2269. function: native_sincos
  2270. version: 24
  2271. w: 1, 2, 3, 4
  2272. t: f16
  2273. ret: #2#1
  2274. arg: #2#1 v
  2275. arg: #2#1* cos, range(-314,314)
  2276. # Absolute error of 2^-11, i.e. 0.00048828125
  2277. test: limited(0.00048828125)
  2278. end:
  2279. function: native_sinh
  2280. version: 21
  2281. attrib: const
  2282. w: 1, 2, 3, 4
  2283. t: f32
  2284. ret: #2#1
  2285. arg: #2#1 v
  2286. summary: Approximate hyperbolic sine
  2287. description:
  2288. Returns the approximate hyperbolic sine of a value specified in radians.
  2289. See also @sinh().
  2290. end:
  2291. function: native_sinh
  2292. version: 24
  2293. attrib: const
  2294. w: 1, 2, 3, 4
  2295. t: f16
  2296. ret: #2#1
  2297. arg: #2#1 v
  2298. end:
  2299. function: native_sinpi
  2300. version: 21
  2301. attrib: const
  2302. w: 1, 2, 3, 4
  2303. t: f32
  2304. ret: #2#1
  2305. arg: #2#1 v
  2306. summary: Approximate sine of a number multiplied by pi
  2307. description:
  2308. Returns the approximate sine of (v * pi), where (v * pi) is measured in radians.
  2309. To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
  2310. See also @sinpi().
  2311. end:
  2312. function: native_sinpi
  2313. version: 24
  2314. attrib: const
  2315. w: 1, 2, 3, 4
  2316. t: f16
  2317. ret: #2#1
  2318. arg: #2#1 v, range(-100,100)
  2319. # Absolute error of 2^-11, i.e. 0.00048828125
  2320. test: limited(0.00048828125)
  2321. end:
  2322. function: native_sqrt
  2323. version: 21
  2324. attrib: const
  2325. w: 1, 2, 3, 4
  2326. t: f32
  2327. ret: #2#1
  2328. arg: #2#1 v
  2329. summary: Approximate square root
  2330. description:
  2331. Returns the approximate sqrt(v).
  2332. See also @sqrt(), @half_sqrt().
  2333. end:
  2334. function: native_sqrt
  2335. version: 24
  2336. attrib: const
  2337. w: 1, 2, 3, 4
  2338. t: f16
  2339. ret: #2#1
  2340. arg: #2#1 v
  2341. end:
  2342. function: native_tan
  2343. version: 21
  2344. attrib: const
  2345. w: 1, 2, 3, 4
  2346. t: f32
  2347. ret: #2#1
  2348. arg: #2#1 v
  2349. summary: Approximate tangent
  2350. description:
  2351. Returns the approximate tangent of an angle measured in radians.
  2352. end:
  2353. function: native_tan
  2354. version: 24
  2355. attrib: const
  2356. w: 1, 2, 3, 4
  2357. t: f16
  2358. ret: #2#1
  2359. arg: #2#1 v, range(-314,314)
  2360. test: custom
  2361. end:
  2362. function: native_tanh
  2363. version: 21
  2364. attrib: const
  2365. w: 1, 2, 3, 4
  2366. t: f32
  2367. ret: #2#1
  2368. arg: #2#1 v
  2369. summary: Approximate hyperbolic tangent
  2370. description:
  2371. Returns the approximate hyperbolic tangent of a value.
  2372. See also @tanh().
  2373. end:
  2374. function: native_tanh
  2375. version: 24
  2376. attrib: const
  2377. w: 1, 2, 3, 4
  2378. t: f16
  2379. ret: #2#1
  2380. arg: #2#1 v
  2381. end:
  2382. function: native_tanpi
  2383. version: 21
  2384. attrib: const
  2385. w: 1, 2, 3, 4
  2386. t: f32
  2387. ret: #2#1
  2388. arg: #2#1 v
  2389. summary: Approximate tangent of a number multiplied by pi
  2390. description:
  2391. Returns the approximate tangent of (v * pi), where (v * pi) is measured in radians.
  2392. To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
  2393. See also @tanpi().
  2394. end:
  2395. function: native_tanpi
  2396. version: 24
  2397. attrib: const
  2398. w: 1, 2, 3, 4
  2399. t: f16
  2400. ret: #2#1
  2401. arg: #2#1 v, range(-100,100)
  2402. test: custom
  2403. end:
  2404. function: nextafter
  2405. version: 9
  2406. attrib: const
  2407. w: 1, 2, 3, 4
  2408. t: f32
  2409. ret: #2#1
  2410. arg: #2#1 v
  2411. arg: #2#1 target
  2412. summary: Next floating point number
  2413. description:
  2414. Returns the next representable floating point number from v towards target.
  2415. In rs_fp_relaxed mode, a denormalized input value may not yield the next denormalized
  2416. value, as support of denormalized values is optional in relaxed mode.
  2417. end:
  2418. function: nextafter
  2419. version: 24
  2420. attrib: const
  2421. w: 1, 2, 3, 4
  2422. t: f16
  2423. ret: #2#1
  2424. arg: #2#1 v
  2425. arg: #2#1 target
  2426. test: none
  2427. end:
  2428. function: pow
  2429. version: 9
  2430. attrib: const
  2431. w: 1, 2, 3, 4
  2432. t: f32
  2433. ret: #2#1
  2434. arg: #2#1 base
  2435. arg: #2#1 exponent
  2436. summary: Base raised to an exponent
  2437. description:
  2438. Returns base raised to the power exponent, i.e. base ^ exponent.
  2439. @pown() and @powr() are similar. @pown() takes an integer exponent. @powr() assumes the
  2440. base to be non-negative.
  2441. end:
  2442. function: pow
  2443. version: 24
  2444. attrib: const
  2445. w: 1, 2, 3, 4
  2446. t: f16
  2447. ret: #2#1
  2448. arg: #2#1 base
  2449. arg: #2#1 exponent
  2450. end:
  2451. function: pown
  2452. version: 9
  2453. attrib: const
  2454. w: 1, 2, 3, 4
  2455. t: f32
  2456. ret: #2#1
  2457. arg: #2#1 base
  2458. arg: int#1 exponent
  2459. summary: Base raised to an integer exponent
  2460. description:
  2461. Returns base raised to the power exponent, i.e. base ^ exponent.
  2462. @pow() and @powr() are similar. The both take a float exponent. @powr() also assumes the
  2463. base to be non-negative.
  2464. end:
  2465. function: pown
  2466. version: 24
  2467. attrib: const
  2468. w: 1, 2, 3, 4
  2469. t: f16
  2470. ret: #2#1
  2471. arg: #2#1 base
  2472. arg: int#1 exponent
  2473. end:
  2474. function: powr
  2475. version: 9
  2476. attrib: const
  2477. w: 1, 2, 3, 4
  2478. t: f32
  2479. ret: #2#1
  2480. arg: #2#1 base, range(0,3000)
  2481. arg: #2#1 exponent
  2482. summary: Positive base raised to an exponent
  2483. description:
  2484. Returns base raised to the power exponent, i.e. base ^ exponent. base must be &gt;= 0.
  2485. @pow() and @pown() are similar. They both make no assumptions about the base.
  2486. @pow() takes a float exponent while @pown() take an integer.
  2487. See also @native_powr().
  2488. end:
  2489. function: powr
  2490. version: 24
  2491. attrib: const
  2492. w: 1, 2, 3, 4
  2493. t: f16
  2494. ret: #2#1
  2495. arg: #2#1 base, range(0,300)
  2496. arg: #2#1 exponent
  2497. end:
  2498. function: radians
  2499. version: 9
  2500. attrib: const
  2501. w: 1, 2, 3, 4
  2502. t: f32
  2503. ret: #2#1
  2504. arg: #2#1 v
  2505. summary: Converts degrees into radians
  2506. description:
  2507. Converts from degrees to radians.
  2508. end:
  2509. function: radians
  2510. version: 24
  2511. attrib: const
  2512. w: 1, 2, 3, 4
  2513. t: f16
  2514. ret: #2#1
  2515. arg: #2#1 v
  2516. end:
  2517. function: remainder
  2518. version: 9
  2519. attrib: const
  2520. w: 1, 2, 3, 4
  2521. t: f32
  2522. ret: #2#1
  2523. arg: #2#1 numerator
  2524. arg: #2#1 denominator
  2525. summary: Remainder of a division
  2526. description:
  2527. Returns the remainder of (numerator / denominator), where the quotient is rounded towards
  2528. the nearest integer.
  2529. The function @fmod() is similar but rounds toward the closest interger.
  2530. For example, <code>@fmod(-3.8f, 2.f)</code> returns -1.8f (-3.8f - -1.f * 2.f)
  2531. while <code>remainder(-3.8f, 2.f)</code> returns 0.2f (-3.8f - -2.f * 2.f).
  2532. end:
  2533. function: remainder
  2534. version: 24
  2535. attrib: const
  2536. w: 1, 2, 3, 4
  2537. t: f16
  2538. ret: #2#1
  2539. arg: #2#1 numerator
  2540. arg: #2#1 denominator
  2541. end:
  2542. function: remquo
  2543. version: 9
  2544. w: 1, 2, 3, 4
  2545. t: f32
  2546. ret: #2#1, "Remainder, precise only for the low three bits."
  2547. arg: #2#1 numerator, "Numerator."
  2548. arg: #2#1 denominator, "Denominator."
  2549. arg: int#1* quotient, "*quotient will be set to the integer quotient."
  2550. summary: Remainder and quotient of a division
  2551. description:
  2552. Returns the quotient and the remainder of (numerator / denominator).
  2553. Only the sign and lowest three bits of the quotient are guaranteed to be accurate.
  2554. This function is useful for implementing periodic functions. The low three bits of the
  2555. quotient gives the quadrant and the remainder the distance within the quadrant.
  2556. For example, an implementation of @sin(x) could call <code>remquo(x, PI / 2.f, &amp;quadrant)</code>
  2557. to reduce very large value of x to something within a limited range.
  2558. Example: <code>remquo(-23.5f, 8.f, &amp;quot)</code> sets the lowest three bits of quot to 3
  2559. and the sign negative. It returns 0.5f.
  2560. test: custom
  2561. end:
  2562. function: remquo
  2563. version: 24
  2564. w: 1, 2, 3, 4
  2565. t: f16
  2566. ret: #2#1
  2567. arg: #2#1 numerator
  2568. arg: #2#1 denominator
  2569. arg: int#1* quotient
  2570. test: none
  2571. end:
  2572. function: rint
  2573. version: 9
  2574. attrib: const
  2575. w: 1, 2, 3, 4
  2576. t: f32
  2577. ret: #2#1
  2578. arg: #2#1 v
  2579. summary: Round to even
  2580. description:
  2581. Rounds to the nearest integral value.
  2582. rint() rounds half values to even. For example, <code>rint(0.5f)</code> returns 0.f and
  2583. <code>rint(1.5f)</code> returns 2.f. Similarly, <code>rint(-0.5f)</code> returns -0.f and
  2584. <code>rint(-1.5f)</code> returns -2.f.
  2585. @round() is similar but rounds away from zero. @trunc() truncates the decimal fraction.
  2586. end:
  2587. function: rint
  2588. version: 24
  2589. attrib: const
  2590. w: 1, 2, 3, 4
  2591. t: f16
  2592. ret: #2#1
  2593. arg: #2#1 v
  2594. end:
  2595. function: rootn
  2596. version: 9
  2597. attrib: const
  2598. w: 1, 2, 3, 4
  2599. t: f32
  2600. ret: #2#1
  2601. arg: #2#1 v
  2602. arg: int#1 n
  2603. summary: Nth root
  2604. description:
  2605. Compute the Nth root of a value.
  2606. See also @native_rootn().
  2607. end:
  2608. function: rootn
  2609. version: 24
  2610. attrib: const
  2611. w: 1, 2, 3, 4
  2612. t: f16
  2613. ret: #2#1
  2614. arg: #2#1 v
  2615. arg: int#1 n
  2616. test: none
  2617. end:
  2618. function: round
  2619. version: 9
  2620. attrib: const
  2621. w: 1, 2, 3, 4
  2622. t: f32
  2623. ret: #2#1
  2624. arg: #2#1 v
  2625. summary: Round away from zero
  2626. description:
  2627. Round to the nearest integral value.
  2628. round() rounds half values away from zero. For example, <code>round(0.5f)</code> returns 1.f
  2629. and <code>round(1.5f)</code> returns 2.f. Similarly, <code>round(-0.5f)</code> returns -1.f
  2630. and <code>round(-1.5f)</code> returns -2.f.
  2631. @rint() is similar but rounds half values toward even. @trunc() truncates the decimal fraction.
  2632. end:
  2633. function: round
  2634. version: 24
  2635. attrib: const
  2636. w: 1, 2, 3, 4
  2637. t: f16
  2638. ret: #2#1
  2639. arg: #2#1 v
  2640. end:
  2641. function: rsqrt
  2642. version: 9
  2643. attrib: const
  2644. w: 1, 2, 3, 4
  2645. t: f32
  2646. ret: #2#1
  2647. arg: #2#1 v
  2648. summary: Reciprocal of a square root
  2649. description:
  2650. Returns (1 / sqrt(v)).
  2651. See also @half_rsqrt(), @native_rsqrt().
  2652. end:
  2653. function: rsqrt
  2654. version: 24
  2655. attrib: const
  2656. w: 1, 2, 3, 4
  2657. t: f16
  2658. ret: #2#1
  2659. arg: #2#1 v
  2660. end:
  2661. function: sign
  2662. version: 9
  2663. attrib: const
  2664. w: 1, 2, 3, 4
  2665. t: f32
  2666. ret: #2#1
  2667. arg: #2#1 v
  2668. summary: Sign of a value
  2669. description:
  2670. Returns the sign of a value.
  2671. if (v &lt; 0) return -1.f;
  2672. else if (v &gt; 0) return 1.f;
  2673. else return 0.f;
  2674. end:
  2675. function: sign
  2676. version:24
  2677. attrib: const
  2678. w: 1, 2, 3, 4
  2679. t: f16
  2680. ret: #2#1
  2681. arg: #2#1 v
  2682. end:
  2683. function: sin
  2684. version: 9
  2685. attrib: const
  2686. w: 1, 2, 3, 4
  2687. t: f32
  2688. ret: #2#1
  2689. arg: #2#1 v
  2690. summary: Sine
  2691. description:
  2692. Returns the sine of an angle measured in radians.
  2693. See also @native_sin().
  2694. end:
  2695. function: sin
  2696. version: 24
  2697. attrib: const
  2698. w: 1, 2, 3, 4
  2699. t: f16
  2700. ret: #2#1
  2701. arg: #2#1 v
  2702. end:
  2703. function: sincos
  2704. version: 9
  2705. w: 1, 2, 3, 4
  2706. t: f32
  2707. ret: #2#1, "Sine of v."
  2708. arg: #2#1 v, "Incoming value in radians."
  2709. arg: #2#1* cos, "*cos will be set to the cosine value."
  2710. summary: Sine and cosine
  2711. description:
  2712. Returns the sine and cosine of a value.
  2713. See also @native_sincos().
  2714. end:
  2715. function: sincos
  2716. version: 24
  2717. w: 1, 2, 3, 4
  2718. t: f16
  2719. ret: #2#1
  2720. arg: #2#1 v
  2721. arg: #2#1* cos
  2722. end:
  2723. function: sinh
  2724. version: 9
  2725. attrib: const
  2726. w: 1, 2, 3, 4
  2727. t: f32
  2728. ret: #2#1
  2729. arg: #2#1 v
  2730. summary: Hyperbolic sine
  2731. description:
  2732. Returns the hyperbolic sine of v, where v is measured in radians.
  2733. See also @native_sinh().
  2734. end:
  2735. function: sinh
  2736. version: 24
  2737. attrib: const
  2738. w: 1, 2, 3, 4
  2739. t: f16
  2740. ret: #2#1
  2741. arg: #2#1 v
  2742. end:
  2743. function: sinpi
  2744. version: 9
  2745. attrib: const
  2746. w: 1, 2, 3, 4
  2747. t: f32
  2748. ret: #2#1
  2749. arg: #2#1 v
  2750. summary: Sine of a number multiplied by pi
  2751. description:
  2752. Returns the sine of (v * pi), where (v * pi) is measured in radians.
  2753. To get the sine of a value measured in degrees, call <code>sinpi(v / 180.f)</code>.
  2754. See also @native_sinpi().
  2755. end:
  2756. function: sinpi
  2757. version: 24
  2758. attrib: const
  2759. w: 1, 2, 3, 4
  2760. t: f16
  2761. ret: #2#1
  2762. arg: #2#1 v
  2763. end:
  2764. function: sqrt
  2765. version: 9
  2766. attrib: const
  2767. w: 1, 2, 3, 4
  2768. t: f32
  2769. ret: #2#1
  2770. arg: #2#1 v
  2771. summary: Square root
  2772. description:
  2773. Returns the square root of a value.
  2774. See also @half_sqrt(), @native_sqrt().
  2775. end:
  2776. function: sqrt
  2777. version: 24
  2778. attrib: const
  2779. w: 1, 2, 3, 4
  2780. t: f16
  2781. ret: #2#1
  2782. arg: #2#1 v
  2783. end:
  2784. function: step
  2785. version: 9
  2786. attrib: const
  2787. w: 1, 2, 3, 4
  2788. t: f32
  2789. ret: #2#1
  2790. arg: #2#1 edge
  2791. arg: #2#1 v
  2792. summary: 0 if less than a value, 0 otherwise
  2793. description:
  2794. Returns 0.f if v &lt; edge, 1.f otherwise.
  2795. This can be useful to create conditional computations without using loops and branching
  2796. instructions. For example, instead of computing <code>(a[i] &lt; b[i]) ? 0.f : @atan2(a[i], b[i])</code>
  2797. for the corresponding elements of a vector, you could instead use <code>step(a, b) * @atan2(a, b)</code>.
  2798. end:
  2799. function: step
  2800. version: 24
  2801. attrib: const
  2802. w: 1, 2, 3, 4
  2803. t: f16
  2804. ret: #2#1
  2805. arg: #2#1 edge
  2806. arg: #2#1 v
  2807. end:
  2808. function: step
  2809. version: 9
  2810. attrib: const
  2811. w: 2, 3, 4
  2812. t: f32
  2813. ret: #2#1
  2814. arg: #2#1 edge
  2815. arg: #2 v
  2816. end:
  2817. function: step
  2818. version: 24
  2819. attrib: const
  2820. w: 2, 3, 4
  2821. t: f16
  2822. ret: #2#1
  2823. arg: #2#1 edge
  2824. arg: #2 v
  2825. end:
  2826. function: step
  2827. version: 21
  2828. attrib: const
  2829. w: 2, 3, 4
  2830. t: f32
  2831. ret: #2#1
  2832. arg: #2 edge
  2833. arg: #2#1 v
  2834. end:
  2835. function: step
  2836. version: 24
  2837. attrib: const
  2838. w: 2, 3, 4
  2839. t: f16
  2840. ret: #2#1
  2841. arg: #2 edge
  2842. arg: #2#1 v
  2843. end:
  2844. function: tan
  2845. version: 9
  2846. attrib: const
  2847. w: 1, 2, 3, 4
  2848. t: f32
  2849. ret: #2#1
  2850. arg: #2#1 v
  2851. summary: Tangent
  2852. description:
  2853. Returns the tangent of an angle measured in radians.
  2854. See also @native_tan().
  2855. end:
  2856. function: tan
  2857. version: 24
  2858. attrib: const
  2859. w: 1, 2, 3, 4
  2860. t: f16
  2861. ret: #2#1
  2862. arg: #2#1 v
  2863. end:
  2864. function: tanh
  2865. version: 9
  2866. attrib: const
  2867. w: 1, 2, 3, 4
  2868. t: f32
  2869. ret: #2#1
  2870. arg: #2#1 v
  2871. summary: Hyperbolic tangent
  2872. description:
  2873. Returns the hyperbolic tangent of a value.
  2874. See also @native_tanh().
  2875. end:
  2876. function: tanh
  2877. version: 24
  2878. attrib: const
  2879. w: 1, 2, 3, 4
  2880. t: f16
  2881. ret: #2#1
  2882. arg: #2#1 v
  2883. end:
  2884. function: tanpi
  2885. version: 9
  2886. attrib: const
  2887. w: 1, 2, 3, 4
  2888. t: f32
  2889. ret: #2#1
  2890. arg: #2#1 v
  2891. summary: Tangent of a number multiplied by pi
  2892. description:
  2893. Returns the tangent of (v * pi), where (v * pi) is measured in radians.
  2894. To get the tangent of a value measured in degrees, call <code>tanpi(v / 180.f)</code>.
  2895. See also @native_tanpi().
  2896. end:
  2897. function: tanpi
  2898. version: 24
  2899. attrib: const
  2900. w: 1, 2, 3, 4
  2901. t: f16
  2902. ret: #2#1
  2903. arg: #2#1 v
  2904. end:
  2905. function: tgamma
  2906. version: 9
  2907. attrib: const
  2908. w: 1, 2, 3, 4
  2909. t: f32
  2910. ret: #2#1
  2911. arg: #2#1 v
  2912. summary: Gamma function
  2913. description:
  2914. Returns the gamma function of a value.
  2915. See also @lgamma().
  2916. end:
  2917. function: tgamma
  2918. version: 24
  2919. attrib: const
  2920. w: 1, 2, 3, 4
  2921. t: f16
  2922. ret: #2#1
  2923. arg: #2#1 v
  2924. end:
  2925. function: trunc
  2926. version: 9
  2927. attrib: const
  2928. w: 1, 2, 3, 4
  2929. t: f32
  2930. ret: #2#1
  2931. arg: #2#1 v
  2932. summary: Truncates a floating point
  2933. description:
  2934. Rounds to integral using truncation.
  2935. For example, <code>trunc(1.7f)</code> returns 1.f and <code>trunc(-1.7f)</code> returns -1.f.
  2936. See @rint() and @round() for other rounding options.
  2937. end:
  2938. function: trunc
  2939. version: 24
  2940. attrib: const
  2941. w: 1, 2, 3, 4
  2942. t: f16
  2943. ret: #2#1
  2944. arg: #2#1 v
  2945. end:
  2946. function: rsClamp
  2947. attrib: const
  2948. t: i8, i16, i32, u8, u16, u32
  2949. ret: #1
  2950. arg: #1 amount, "Value to clamp."
  2951. arg: #1 low, "Lower bound."
  2952. arg: #1 high, "Upper bound."
  2953. deprecated: 22, Use @clamp() instead.
  2954. summary: Restrain a value to a range
  2955. description:
  2956. Clamp a value between low and high.
  2957. test: none
  2958. end:
  2959. function: rsFrac
  2960. attrib: const
  2961. ret: float
  2962. arg: float v
  2963. deprecated: 22, Use @fract() instead.
  2964. summary: Returns the fractional part of a float
  2965. description:
  2966. Returns the fractional part of a float
  2967. test: none
  2968. end:
  2969. function: rsRand
  2970. ret: int
  2971. arg: int max_value
  2972. summary: Pseudo-random number
  2973. description:
  2974. Return a random value between 0 (or min_value) and max_malue.
  2975. test: none
  2976. end:
  2977. function: rsRand
  2978. ret: int
  2979. arg: int min_value
  2980. arg: int max_value
  2981. test: none
  2982. end:
  2983. function: rsRand
  2984. ret: float
  2985. arg: float max_value
  2986. test: none
  2987. end:
  2988. function: rsRand
  2989. ret: float
  2990. arg: float min_value
  2991. arg: float max_value
  2992. test: none
  2993. end: