1 /*
2     Qalculate (library)
3 
4     Copyright (C) 2003-2007, 2008, 2016  Hanna Knutsson (hanna.knutsson@protonmail.com)
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10 */
11 
12 #ifndef BUILTIN_FUNCTIONS_H
13 #define BUILTIN_FUNCTIONS_H
14 
15 #include <libqalculate/Function.h>
16 #include <libqalculate/includes.h>
17 
18 #define DECLARE_BUILTIN_FUNCTION(x, i)	class x : public MathFunction { \
19 					  public: \
20 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
21 						x(); \
22 						x(const x *function) {set(function);} \
23 						ExpressionItem *copy() const {return new x(this);} \
24 						int id() const {return i;}\
25 					};
26 
27 #define DECLARE_BUILTIN_FUNCTION_B(x, i)	class x : public MathFunction { \
28 					  public: \
29 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
30 						x(); \
31 						x(const x *function) {set(function);} \
32 						ExpressionItem *copy() const {return new x(this);} \
33 						bool representsBoolean(const MathStructure&) const {return true;}\
34 						int id() const {return i;}\
35 					};
36 
37 #define DECLARE_BUILTIN_FUNCTION_PI(x, i)	class x : public MathFunction { \
38 					  public: \
39 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
40 						x(); \
41 						x(const x *function) {set(function);} \
42 						ExpressionItem *copy() const {return new x(this);} \
43 						bool representsInteger(const MathStructure&, bool) const {return true;}\
44 						bool representsPositive(const MathStructure&, bool) const {return true;}\
45 						int id() const {return i;}\
46 					};
47 
48 #define DECLARE_BUILTIN_FUNCTION_RPI(x, i)	class x : public MathFunction { \
49 					  public: \
50 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
51 						x(); \
52 						x(const x *function) {set(function);} \
53 						ExpressionItem *copy() const {return new x(this);} \
54 						bool representsReal(const MathStructure&, bool) const;\
55 						bool representsInteger(const MathStructure&, bool) const;\
56 						bool representsNonNegative(const MathStructure&, bool) const;\
57 						int id() const {return i;}\
58 					};
59 
60 #define DECLARE_BUILTIN_FUNCTION_R(x, i)	class x : public MathFunction { \
61 					  public: \
62 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
63 						x(); \
64 						x(const x *function) {set(function);} \
65 						ExpressionItem *copy() const {return new x(this);} \
66 						bool representsPositive(const MathStructure &vargs, bool allow_units = false) const;\
67 						bool representsNegative(const MathStructure &vargs, bool allow_units = false) const;\
68 						bool representsNonNegative(const MathStructure &vargs, bool allow_units = false) const;\
69 						bool representsNonPositive(const MathStructure &vargs, bool allow_units = false) const;\
70 						bool representsInteger(const MathStructure &vargs, bool allow_units = false) const;\
71 						bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\
72 						bool representsRational(const MathStructure &vargs, bool allow_units = false) const;\
73 						bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\
74 						bool representsNonComplex(const MathStructure &vargs, bool allow_units = false) const;\
75 						bool representsComplex(const MathStructure &vargs, bool allow_units = false) const;\
76 						bool representsNonZero(const MathStructure &vargs, bool allow_units = false) const;\
77 						bool representsEven(const MathStructure &vargs, bool allow_units = false) const;\
78 						bool representsOdd(const MathStructure &vargs, bool allow_units = false) const;\
79 						bool representsUndefined(const MathStructure &vargs) const;\
80 						int id() const {return i;}\
81 					};
82 
83 #define DECLARE_BUILTIN_FUNCTION_R2(x, i)	class x : public MathFunction { \
84 					  public: \
85 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
86 						x(); \
87 						x(const x *function) {set(function);} \
88 						ExpressionItem *copy() const {return new x(this);} \
89 						bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\
90 						bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\
91 						bool representsNonComplex(const MathStructure &vargs, bool allow_units = false) const;\
92 						int id() const {return i;}\
93 					};
94 
95 #define DECLARE_BUILTIN_FUNCTION_R3(x, i)	class x : public MathFunction { \
96 					  public: \
97 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
98 						x(); \
99 						x(const x *function) {set(function);} \
100 						ExpressionItem *copy() const {return new x(this);} \
101 						bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\
102 						bool representsReal(const MathStructure &vargs, bool allow_units = false) const;\
103 						bool representsNonComplex(const MathStructure &vargs, bool allow_units = false) const;\
104 						bool representsComplex(const MathStructure &vargs, bool allow_units = false) const;\
105 						bool representsNonZero(const MathStructure &vargs, bool allow_units = false) const;\
106 						int id() const {return i;}\
107 					};
108 
109 #define DECLARE_BUILTIN_FUNCTION_R1(x, i)	class x : public MathFunction { \
110 					  public: \
111 						int calculate(MathStructure &mstruct, const MathStructure &vargs, const EvaluationOptions &eo);  \
112 						x(); \
113 						x(const x *function) {set(function);} \
114 						ExpressionItem *copy() const {return new x(this);} \
115 						bool representsNumber(const MathStructure &vargs, bool allow_units = false) const;\
116 						int id() const {return i;}\
117 					};
118 
119 
120 enum {
121 	FUNCTION_ID_VECTOR = 1100,
122 	FUNCTION_ID_LIMITS = 1101,
123 	FUNCTION_ID_RANK = 1102,
124 	FUNCTION_ID_SORT = 1103,
125 	FUNCTION_ID_COMPONENT = 1104,
126 	FUNCTION_ID_DIMENSION = 1105,
127 	FUNCTION_ID_MATRIX = 1106,
128 	FUNCTION_ID_MERGE_VECTORS = 1107,
129 	FUNCTION_ID_MATRIX_TO_VECTOR = 1108,
130 	FUNCTION_ID_AREA = 1109,
131 	FUNCTION_ID_ROWS = 1110,
132 	FUNCTION_ID_COLUMNS = 1111,
133 	FUNCTION_ID_ROW = 1112,
134 	FUNCTION_ID_COLUMN = 1113,
135 	FUNCTION_ID_ELEMENTS = 1114,
136 	FUNCTION_ID_ELEMENT = 1115,
137 	FUNCTION_ID_TRANSPOSE = 1116,
138 	FUNCTION_ID_IDENTITY = 1117,
139 	FUNCTION_ID_DETERMINANT = 1118,
140 	FUNCTION_ID_PERMANENT = 1119,
141 	FUNCTION_ID_ADJOINT = 1120,
142 	FUNCTION_ID_COFACTOR = 1121,
143 	FUNCTION_ID_INVERSE = 1122,
144 	FUNCTION_ID_MAGNITUDE = 1123,
145 	FUNCTION_ID_HADAMARD = 1124,
146 	FUNCTION_ID_ENTRYWISE = 1125,
147 	FUNCTION_ID_LOAD = 1126,
148 	FUNCTION_ID_EXPORT = 1127,
149 	FUNCTION_ID_GENERATE_VECTOR = 1128,
150 	FUNCTION_ID_SELECT = 1129,
151 	FUNCTION_ID_PROCESS = 1130,
152 	FUNCTION_ID_PROCESS_MATRIX = 1131,
153 	FUNCTION_ID_RREF = 1132,
154 	FUNCTION_ID_MATRIX_RANK = 1133,
155 	FUNCTION_ID_SQRT = 1200,
156 	FUNCTION_ID_CBRT = 1201,
157 	FUNCTION_ID_ROOT = 1202,
158 	FUNCTION_ID_SQUARE = 1203,
159 	FUNCTION_ID_EXP = 1204,
160 	FUNCTION_ID_LOG = 1205,
161 	FUNCTION_ID_LOGN = 1206,
162 	FUNCTION_ID_LAMBERT_W = 1207,
163 	FUNCTION_ID_CIS = 1208,
164 	FUNCTION_ID_SIN = 1300,
165 	FUNCTION_ID_COS = 1301,
166 	FUNCTION_ID_TAN = 1302,
167 	FUNCTION_ID_ASIN = 1303,
168 	FUNCTION_ID_ACOS = 1304,
169 	FUNCTION_ID_ATAN = 1305,
170 	FUNCTION_ID_SINH = 1306,
171 	FUNCTION_ID_COSH = 1307,
172 	FUNCTION_ID_TANH = 1308,
173 	FUNCTION_ID_ASINH = 1309,
174 	FUNCTION_ID_ACOSH = 1310,
175 	FUNCTION_ID_ATANH = 1311,
176 	FUNCTION_ID_SINC = 1312,
177 	FUNCTION_ID_ATAN2 = 1313,
178 	FUNCTION_ID_RADIANS_TO_DEFAULT_ANGLE_UNIT = 1314,
179 	FUNCTION_ID_ZETA = 1400,
180 	FUNCTION_ID_GAMMA = 1401,
181 	FUNCTION_ID_DIGAMMA = 1402,
182 	FUNCTION_ID_BETA = 1403,
183 	FUNCTION_ID_AIRY = 1404,
184 	FUNCTION_ID_BESSELJ = 1405,
185 	FUNCTION_ID_BESSELY = 1406,
186 	FUNCTION_ID_ERF = 1407,
187 	FUNCTION_ID_ERFI = 1408,
188 	FUNCTION_ID_ERFC = 1409,
189 	FUNCTION_ID_POLYLOG = 1410,
190 	FUNCTION_ID_HEAVISIDE = 1411,
191 	FUNCTION_ID_DIRAC = 1412,
192 	FUNCTION_ID_FACTORIAL = 1500,
193 	FUNCTION_ID_DOUBLE_FACTORIAL = 1501,
194 	FUNCTION_ID_MULTI_FACTORIAL = 1502,
195 	FUNCTION_ID_BINOMIAL = 1503,
196 	FUNCTION_ID_LOGINT = 1600,
197 	FUNCTION_ID_FRESNEL_S = 1601,
198 	FUNCTION_ID_FRESNEL_C = 1602,
199 	FUNCTION_ID_EXPINT = 1603,
200 	FUNCTION_ID_SININT = 1604,
201 	FUNCTION_ID_COSINT = 1605,
202 	FUNCTION_ID_SINHINT = 1606,
203 	FUNCTION_ID_COSHINT = 1607,
204 	FUNCTION_ID_I_GAMMA = 1608,
205 	FUNCTION_ID_ABS = 1700,
206 	FUNCTION_ID_GCD = 1701,
207 	FUNCTION_ID_LCM = 1702,
208 	FUNCTION_ID_SIGNUM = 1710,
209 	FUNCTION_ID_ROUND = 1720,
210 	FUNCTION_ID_FLOOR = 1721,
211 	FUNCTION_ID_CEIL = 1722,
212 	FUNCTION_ID_TRUNC = 1723,
213 	FUNCTION_ID_NUMERATOR = 1730,
214 	FUNCTION_ID_DENOMINATOR = 1731,
215 	FUNCTION_ID_INT = 1732,
216 	FUNCTION_ID_FRAC = 1733,
217 	FUNCTION_ID_REM = 1734,
218 	FUNCTION_ID_MOD = 1735,
219 	FUNCTION_ID_BERNOULLI = 1740,
220 	FUNCTION_ID_TOTIENT = 1745,
221 	FUNCTION_ID_RE = 1750,
222 	FUNCTION_ID_IM = 1751,
223 	FUNCTION_ID_ARG = 1752,
224 	FUNCTION_ID_DIFFERENTIATE = 1800,
225 	FUNCTION_ID_LIMIT = 1810,
226 	FUNCTION_ID_INTEGRATE = 1820,
227 	FUNCTION_ID_MONTE_CARLO = 1821,
228 	FUNCTION_ID_ROMBERG = 1822,
229 	FUNCTION_ID_SUM = 1830,
230 	FUNCTION_ID_PRODUCT = 1831,
231 	FUNCTION_ID_SOLVE = 1840,
232 	FUNCTION_ID_SOLVE_MULTIPLE = 1841,
233 	FUNCTION_ID_D_SOLVE = 1842,
234 	FUNCTION_ID_BIN = 1900,
235 	FUNCTION_ID_OCT = 1901,
236 	FUNCTION_ID_DEC = 1902,
237 	FUNCTION_ID_HEX = 1903,
238 	FUNCTION_ID_BASE = 1904,
239 	FUNCTION_ID_ROMAN = 1905,
240 	FUNCTION_ID_BIJECTIVE = 1906,
241 	FUNCTION_ID_IEEE754_FLOAT = 1910,
242 	FUNCTION_ID_IEEE754_FLOAT_BITS = 1911,
243 	FUNCTION_ID_IEEE754_FLOAT_COMPONENTS = 1912,
244 	FUNCTION_ID_IEEE754_FLOAT_VALUE = 1913,
245 	FUNCTION_ID_IEEE754_FLOAT_ERROR = 1914,
246 	FUNCTION_ID_IS_NUMBER = 1920,
247 	FUNCTION_ID_IS_REAL = 1921,
248 	FUNCTION_ID_IS_RATIONAL = 1922,
249 	FUNCTION_ID_IS_INTEGER = 1923,
250 	FUNCTION_ID_ODD = 1924,
251 	FUNCTION_ID_EVEN = 1925,
252 	FUNCTION_ID_POLYNOMIAL_UNIT = 2000,
253 	FUNCTION_ID_POLYNOMIAL_PRIMPART = 2001,
254 	FUNCTION_ID_POLYNOMIAL_CONTENT = 2002,
255 	FUNCTION_ID_COEFF = 2003,
256 	FUNCTION_ID_L_COEFF = 2004,
257 	FUNCTION_ID_T_COEFF = 2005,
258 	FUNCTION_ID_DEGREE = 2006,
259 	FUNCTION_ID_L_DEGREE = 2007,
260 	FUNCTION_ID_BIT_XOR = 2100,
261 	FUNCTION_ID_XOR = 2101,
262 	FUNCTION_ID_BIT_CMP = 2102,
263 	FUNCTION_ID_SHIFT = 2103,
264 	FUNCTION_ID_CIRCULAR_SHIFT = 2104,
265 	FUNCTION_ID_FOR = 2150,
266 	FUNCTION_ID_IF = 2151,
267 	FUNCTION_ID_TOTAL = 2200,
268 	FUNCTION_ID_PERCENTILE = 2201,
269 	FUNCTION_ID_MIN = 2202,
270 	FUNCTION_ID_MAX = 2203,
271 	FUNCTION_ID_MODE = 2204,
272 	FUNCTION_ID_RAND = 2220,
273 	FUNCTION_ID_RANDN = 2221,
274 	FUNCTION_ID_RAND_POISSON = 2222,
275 	FUNCTION_ID_DATE = 2300,
276 	FUNCTION_ID_DATE_TIME = 2301,
277 	FUNCTION_ID_TIME_VALUE = 2302,
278 	FUNCTION_ID_TIMESTAMP = 2303,
279 	FUNCTION_ID_TIMESTAMP_TO_DATE = 2304,
280 	FUNCTION_ID_DAYS = 2305,
281 	FUNCTION_ID_YEAR_FRAC = 2306,
282 	FUNCTION_ID_WEEK = 2307,
283 	FUNCTION_ID_WEEKDAY = 2308,
284 	FUNCTION_ID_MONTH = 2309,
285 	FUNCTION_ID_DAY = 2310,
286 	FUNCTION_ID_YEAR = 2311,
287 	FUNCTION_ID_YEARDAY = 2312,
288 	FUNCTION_ID_TIME = 2313,
289 	FUNCTION_ID_ADD_DAYS = 2320,
290 	FUNCTION_ID_ADD_MONTHS = 2321,
291 	FUNCTION_ID_ADD_YEARS = 2322,
292 	FUNCTION_ID_LUNAR_PHASE = 2350,
293 	FUNCTION_ID_NEXT_LUNAR_PHASE = 2351,
294 	FUNCTION_ID_INTERVAL = 2400,
295 	FUNCTION_ID_UNCERTAINTY = 2401,
296 	FUNCTION_ID_ASCII = 2500,
297 	FUNCTION_ID_CHAR = 2501,
298 	FUNCTION_ID_LENGTH = 2502,
299 	FUNCTION_ID_CONCATENATE = 2503,
300 	FUNCTION_ID_REPRESENTS_NUMBER = 2600,
301 	FUNCTION_ID_REPRESENTS_REAL = 2601,
302 	FUNCTION_ID_REPRESENTS_RATIONAL = 2602,
303 	FUNCTION_ID_REPRESENTS_INTEGER = 2603,
304 	FUNCTION_ID_REPLACE = 2610,
305 	FUNCTION_ID_STRIP_UNITS = 2620,
306 	FUNCTION_ID_CUSTOM_SUM = 2630,
307 	FUNCTION_ID_FUNCTION = 2640,
308 	FUNCTION_ID_TITLE = 2650,
309 	FUNCTION_ID_ERROR = 2660,
310 	FUNCTION_ID_WARNING = 2661,
311 	FUNCTION_ID_MESSAGE = 2662,
312 	FUNCTION_ID_SAVE = 2670,
313 	FUNCTION_ID_REGISTER = 2680,
314 	FUNCTION_ID_STACK = 2681,
315 	FUNCTION_ID_PLOT = 2690
316 };
317 
318 DECLARE_BUILTIN_FUNCTION(VectorFunction, FUNCTION_ID_VECTOR)
319 DECLARE_BUILTIN_FUNCTION(LimitsFunction, FUNCTION_ID_LIMITS)
320 DECLARE_BUILTIN_FUNCTION(RankFunction, FUNCTION_ID_RANK)
321 DECLARE_BUILTIN_FUNCTION(SortFunction, FUNCTION_ID_SORT)
322 DECLARE_BUILTIN_FUNCTION(ComponentFunction, FUNCTION_ID_COMPONENT)
323 DECLARE_BUILTIN_FUNCTION_PI(DimensionFunction, FUNCTION_ID_DIMENSION)
324 DECLARE_BUILTIN_FUNCTION(MatrixFunction, FUNCTION_ID_MATRIX)
325 DECLARE_BUILTIN_FUNCTION(MergeVectorsFunction, FUNCTION_ID_MERGE_VECTORS)
326 DECLARE_BUILTIN_FUNCTION(MatrixToVectorFunction, FUNCTION_ID_MATRIX_TO_VECTOR)
327 DECLARE_BUILTIN_FUNCTION(AreaFunction, FUNCTION_ID_AREA)
328 DECLARE_BUILTIN_FUNCTION_PI(RowsFunction, FUNCTION_ID_ROWS)
329 DECLARE_BUILTIN_FUNCTION_PI(ColumnsFunction, FUNCTION_ID_COLUMNS)
330 DECLARE_BUILTIN_FUNCTION(RowFunction, FUNCTION_ID_ROW)
331 DECLARE_BUILTIN_FUNCTION(ColumnFunction, FUNCTION_ID_COLUMN)
332 DECLARE_BUILTIN_FUNCTION_PI(ElementsFunction, FUNCTION_ID_ELEMENTS)
333 DECLARE_BUILTIN_FUNCTION(ElementFunction, FUNCTION_ID_ELEMENT)
334 DECLARE_BUILTIN_FUNCTION(TransposeFunction, FUNCTION_ID_TRANSPOSE)
335 DECLARE_BUILTIN_FUNCTION(IdentityMatrixFunction, FUNCTION_ID_IDENTITY)
336 DECLARE_BUILTIN_FUNCTION(DeterminantFunction, FUNCTION_ID_DETERMINANT)
337 DECLARE_BUILTIN_FUNCTION(PermanentFunction, FUNCTION_ID_PERMANENT)
338 DECLARE_BUILTIN_FUNCTION(AdjointFunction, FUNCTION_ID_ADJOINT)
339 DECLARE_BUILTIN_FUNCTION(CofactorFunction, FUNCTION_ID_COFACTOR)
340 DECLARE_BUILTIN_FUNCTION(InverseFunction, FUNCTION_ID_INVERSE)
341 DECLARE_BUILTIN_FUNCTION(MagnitudeFunction, FUNCTION_ID_MAGNITUDE)
342 DECLARE_BUILTIN_FUNCTION(HadamardFunction, FUNCTION_ID_HADAMARD)
343 DECLARE_BUILTIN_FUNCTION(EntrywiseFunction, FUNCTION_ID_ENTRYWISE)
344 DECLARE_BUILTIN_FUNCTION(LoadFunction, FUNCTION_ID_LOAD)
345 DECLARE_BUILTIN_FUNCTION(ExportFunction, FUNCTION_ID_EXPORT)
346 DECLARE_BUILTIN_FUNCTION(GenerateVectorFunction, FUNCTION_ID_GENERATE_VECTOR)
347 DECLARE_BUILTIN_FUNCTION(SelectFunction, FUNCTION_ID_SELECT)
348 DECLARE_BUILTIN_FUNCTION(ProcessFunction, FUNCTION_ID_PROCESS)
349 DECLARE_BUILTIN_FUNCTION(ProcessMatrixFunction, FUNCTION_ID_PROCESS_MATRIX)
350 DECLARE_BUILTIN_FUNCTION(RRefFunction, FUNCTION_ID_RREF)
351 DECLARE_BUILTIN_FUNCTION(MatrixRankFunction, FUNCTION_ID_MATRIX_RANK)
352 
353 DECLARE_BUILTIN_FUNCTION_R(SqrtFunction, FUNCTION_ID_SQRT)
354 DECLARE_BUILTIN_FUNCTION(CbrtFunction, FUNCTION_ID_CBRT)
355 DECLARE_BUILTIN_FUNCTION_R(RootFunction, FUNCTION_ID_ROOT)
356 DECLARE_BUILTIN_FUNCTION(SquareFunction, FUNCTION_ID_SQUARE)
357 DECLARE_BUILTIN_FUNCTION(ExpFunction, FUNCTION_ID_EXP)
358 DECLARE_BUILTIN_FUNCTION_R(LogFunction, FUNCTION_ID_LOG)
359 DECLARE_BUILTIN_FUNCTION(LognFunction, FUNCTION_ID_LOGN)
360 DECLARE_BUILTIN_FUNCTION_R3(LambertWFunction, FUNCTION_ID_LAMBERT_W)
361 DECLARE_BUILTIN_FUNCTION(CisFunction, FUNCTION_ID_CIS)
362 
363 DECLARE_BUILTIN_FUNCTION_R2(SinFunction, FUNCTION_ID_SIN)
364 DECLARE_BUILTIN_FUNCTION_R2(CosFunction, FUNCTION_ID_COS)
365 DECLARE_BUILTIN_FUNCTION_R2(TanFunction, FUNCTION_ID_TAN)
366 DECLARE_BUILTIN_FUNCTION_R1(AsinFunction, FUNCTION_ID_ASIN)
367 DECLARE_BUILTIN_FUNCTION_R1(AcosFunction, FUNCTION_ID_ACOS)
368 DECLARE_BUILTIN_FUNCTION_R2(AtanFunction, FUNCTION_ID_ATAN)
369 DECLARE_BUILTIN_FUNCTION_R2(SinhFunction, FUNCTION_ID_SINH)
370 DECLARE_BUILTIN_FUNCTION_R2(CoshFunction, FUNCTION_ID_COSH)
371 DECLARE_BUILTIN_FUNCTION_R2(TanhFunction, FUNCTION_ID_TANH)
372 DECLARE_BUILTIN_FUNCTION_R2(AsinhFunction, FUNCTION_ID_ASINH)
373 DECLARE_BUILTIN_FUNCTION_R1(AcoshFunction, FUNCTION_ID_ACOSH)
374 DECLARE_BUILTIN_FUNCTION(AtanhFunction, FUNCTION_ID_ATANH)
375 DECLARE_BUILTIN_FUNCTION_R2(SincFunction, FUNCTION_ID_SINC)
376 DECLARE_BUILTIN_FUNCTION_R1(Atan2Function, FUNCTION_ID_ATAN2)
377 DECLARE_BUILTIN_FUNCTION(RadiansToDefaultAngleUnitFunction, FUNCTION_ID_RADIANS_TO_DEFAULT_ANGLE_UNIT)
378 
379 DECLARE_BUILTIN_FUNCTION(ZetaFunction, FUNCTION_ID_ZETA)
380 DECLARE_BUILTIN_FUNCTION(GammaFunction, FUNCTION_ID_GAMMA)
381 DECLARE_BUILTIN_FUNCTION(DigammaFunction, FUNCTION_ID_DIGAMMA)
382 DECLARE_BUILTIN_FUNCTION(BetaFunction, FUNCTION_ID_BETA)
383 DECLARE_BUILTIN_FUNCTION(AiryFunction, FUNCTION_ID_AIRY)
384 DECLARE_BUILTIN_FUNCTION(BesseljFunction, FUNCTION_ID_BESSELJ)
385 DECLARE_BUILTIN_FUNCTION(BesselyFunction, FUNCTION_ID_BESSELY)
386 DECLARE_BUILTIN_FUNCTION_R(ErfFunction, FUNCTION_ID_ERF)
387 DECLARE_BUILTIN_FUNCTION_R(ErfiFunction, FUNCTION_ID_ERFI)
388 DECLARE_BUILTIN_FUNCTION_R(ErfcFunction, FUNCTION_ID_ERFC)
389 DECLARE_BUILTIN_FUNCTION_R2(LiFunction, FUNCTION_ID_POLYLOG)
390 
391 DECLARE_BUILTIN_FUNCTION_R(HeavisideFunction, FUNCTION_ID_HEAVISIDE)
392 DECLARE_BUILTIN_FUNCTION_R(DiracFunction, FUNCTION_ID_DIRAC)
393 
394 DECLARE_BUILTIN_FUNCTION_R2(liFunction, FUNCTION_ID_LOGINT)
395 DECLARE_BUILTIN_FUNCTION_R(FresnelSFunction, FUNCTION_ID_FRESNEL_S)
396 DECLARE_BUILTIN_FUNCTION_R(FresnelCFunction, FUNCTION_ID_FRESNEL_C)
397 DECLARE_BUILTIN_FUNCTION_R2(EiFunction, FUNCTION_ID_EXPINT)
398 DECLARE_BUILTIN_FUNCTION_R2(SiFunction, FUNCTION_ID_SININT)
399 DECLARE_BUILTIN_FUNCTION_R2(CiFunction, FUNCTION_ID_COSINT)
400 DECLARE_BUILTIN_FUNCTION_R2(ShiFunction, FUNCTION_ID_SINHINT)
401 DECLARE_BUILTIN_FUNCTION_R2(ChiFunction, FUNCTION_ID_COSHINT)
402 DECLARE_BUILTIN_FUNCTION_R2(IGammaFunction, FUNCTION_ID_I_GAMMA)
403 
404 DECLARE_BUILTIN_FUNCTION(DeriveFunction, FUNCTION_ID_DIFFERENTIATE)
405 DECLARE_BUILTIN_FUNCTION(IntegrateFunction, FUNCTION_ID_INTEGRATE)
406 DECLARE_BUILTIN_FUNCTION(LimitFunction, FUNCTION_ID_LIMIT)
407 DECLARE_BUILTIN_FUNCTION(MonteCarloFunction, FUNCTION_ID_MONTE_CARLO)
408 DECLARE_BUILTIN_FUNCTION(RombergFunction, FUNCTION_ID_ROMBERG)
409 
410 DECLARE_BUILTIN_FUNCTION(SumFunction, FUNCTION_ID_SUM)
411 DECLARE_BUILTIN_FUNCTION(ProductFunction, FUNCTION_ID_PRODUCT)
412 DECLARE_BUILTIN_FUNCTION(SolveFunction, FUNCTION_ID_SOLVE)
413 DECLARE_BUILTIN_FUNCTION(SolveMultipleFunction, FUNCTION_ID_SOLVE_MULTIPLE)
414 DECLARE_BUILTIN_FUNCTION(DSolveFunction, FUNCTION_ID_D_SOLVE)
415 
416 DECLARE_BUILTIN_FUNCTION_R(FactorialFunction, FUNCTION_ID_FACTORIAL)
417 DECLARE_BUILTIN_FUNCTION_R(DoubleFactorialFunction, FUNCTION_ID_DOUBLE_FACTORIAL)
418 DECLARE_BUILTIN_FUNCTION_R(MultiFactorialFunction, FUNCTION_ID_MULTI_FACTORIAL)
419 DECLARE_BUILTIN_FUNCTION(BinomialFunction, FUNCTION_ID_BINOMIAL)
420 
421 DECLARE_BUILTIN_FUNCTION_R(ReFunction, FUNCTION_ID_RE)
422 DECLARE_BUILTIN_FUNCTION_R(ImFunction, FUNCTION_ID_IM)
423 DECLARE_BUILTIN_FUNCTION_R2(ArgFunction, FUNCTION_ID_ARG)
424 
425 DECLARE_BUILTIN_FUNCTION_R(AbsFunction, FUNCTION_ID_ABS)
426 DECLARE_BUILTIN_FUNCTION(GcdFunction, FUNCTION_ID_GCD)
427 DECLARE_BUILTIN_FUNCTION(LcmFunction, FUNCTION_ID_LCM)
428 DECLARE_BUILTIN_FUNCTION_R(SignumFunction, FUNCTION_ID_SIGNUM)
429 DECLARE_BUILTIN_FUNCTION_R(RoundFunction, FUNCTION_ID_ROUND)
430 DECLARE_BUILTIN_FUNCTION_R(FloorFunction, FUNCTION_ID_FLOOR)
431 DECLARE_BUILTIN_FUNCTION_R(CeilFunction, FUNCTION_ID_CEIL)
432 DECLARE_BUILTIN_FUNCTION_R(TruncFunction, FUNCTION_ID_TRUNC)
433 DECLARE_BUILTIN_FUNCTION(NumeratorFunction, FUNCTION_ID_NUMERATOR)
434 DECLARE_BUILTIN_FUNCTION(DenominatorFunction, FUNCTION_ID_DENOMINATOR)
435 DECLARE_BUILTIN_FUNCTION(IntFunction, FUNCTION_ID_INT)
436 DECLARE_BUILTIN_FUNCTION(FracFunction, FUNCTION_ID_FRAC)
437 DECLARE_BUILTIN_FUNCTION(RemFunction, FUNCTION_ID_REM)
438 DECLARE_BUILTIN_FUNCTION(ModFunction, FUNCTION_ID_MOD)
439 DECLARE_BUILTIN_FUNCTION(BernoulliFunction, FUNCTION_ID_BERNOULLI)
440 DECLARE_BUILTIN_FUNCTION(TotientFunction, FUNCTION_ID_TOTIENT)
441 
442 DECLARE_BUILTIN_FUNCTION(BinFunction, FUNCTION_ID_BIN)
443 DECLARE_BUILTIN_FUNCTION(OctFunction, FUNCTION_ID_OCT)
444 DECLARE_BUILTIN_FUNCTION(DecFunction, FUNCTION_ID_DEC)
445 DECLARE_BUILTIN_FUNCTION(HexFunction, FUNCTION_ID_HEX)
446 DECLARE_BUILTIN_FUNCTION(BaseFunction, FUNCTION_ID_BASE)
447 DECLARE_BUILTIN_FUNCTION(RomanFunction, FUNCTION_ID_ROMAN)
448 DECLARE_BUILTIN_FUNCTION(BijectiveFunction, FUNCTION_ID_BIJECTIVE)
449 
450 DECLARE_BUILTIN_FUNCTION(IEEE754FloatFunction, FUNCTION_ID_IEEE754_FLOAT)
451 DECLARE_BUILTIN_FUNCTION(IEEE754FloatBitsFunction, FUNCTION_ID_IEEE754_FLOAT_BITS)
452 DECLARE_BUILTIN_FUNCTION(IEEE754FloatComponentsFunction, FUNCTION_ID_IEEE754_FLOAT_COMPONENTS)
453 DECLARE_BUILTIN_FUNCTION(IEEE754FloatValueFunction, FUNCTION_ID_IEEE754_FLOAT_VALUE)
454 DECLARE_BUILTIN_FUNCTION(IEEE754FloatErrorFunction, FUNCTION_ID_IEEE754_FLOAT_ERROR)
455 
456 DECLARE_BUILTIN_FUNCTION(IsNumberFunction, FUNCTION_ID_IS_NUMBER)
457 DECLARE_BUILTIN_FUNCTION(IsRealFunction, FUNCTION_ID_IS_REAL)
458 DECLARE_BUILTIN_FUNCTION(IsRationalFunction, FUNCTION_ID_IS_RATIONAL)
459 DECLARE_BUILTIN_FUNCTION(IsIntegerFunction, FUNCTION_ID_IS_INTEGER)
460 DECLARE_BUILTIN_FUNCTION_B(OddFunction, FUNCTION_ID_ODD)
461 DECLARE_BUILTIN_FUNCTION_B(EvenFunction, FUNCTION_ID_EVEN)
462 
463 DECLARE_BUILTIN_FUNCTION(PolynomialUnitFunction, FUNCTION_ID_POLYNOMIAL_UNIT)
464 DECLARE_BUILTIN_FUNCTION(PolynomialPrimpartFunction, FUNCTION_ID_POLYNOMIAL_PRIMPART)
465 DECLARE_BUILTIN_FUNCTION(PolynomialContentFunction, FUNCTION_ID_POLYNOMIAL_CONTENT)
466 DECLARE_BUILTIN_FUNCTION(CoeffFunction, FUNCTION_ID_COEFF)
467 DECLARE_BUILTIN_FUNCTION(LCoeffFunction, FUNCTION_ID_L_COEFF)
468 DECLARE_BUILTIN_FUNCTION(TCoeffFunction, FUNCTION_ID_T_COEFF)
469 DECLARE_BUILTIN_FUNCTION(DegreeFunction, FUNCTION_ID_DEGREE)
470 DECLARE_BUILTIN_FUNCTION(LDegreeFunction, FUNCTION_ID_L_DEGREE)
471 
472 DECLARE_BUILTIN_FUNCTION(BitXorFunction, FUNCTION_ID_BIT_XOR)
473 DECLARE_BUILTIN_FUNCTION_B(XorFunction, FUNCTION_ID_XOR)
474 DECLARE_BUILTIN_FUNCTION(BitCmpFunction, FUNCTION_ID_BIT_CMP)
475 DECLARE_BUILTIN_FUNCTION(ShiftFunction, FUNCTION_ID_SHIFT)
476 DECLARE_BUILTIN_FUNCTION(CircularShiftFunction, FUNCTION_ID_CIRCULAR_SHIFT)
477 
478 DECLARE_BUILTIN_FUNCTION(ForFunction, FUNCTION_ID_FOR)
479 DECLARE_BUILTIN_FUNCTION(IFFunction, FUNCTION_ID_IF)
480 
481 DECLARE_BUILTIN_FUNCTION(TotalFunction, FUNCTION_ID_TOTAL)
482 DECLARE_BUILTIN_FUNCTION(PercentileFunction, FUNCTION_ID_PERCENTILE)
483 DECLARE_BUILTIN_FUNCTION(MinFunction, FUNCTION_ID_MIN)
484 DECLARE_BUILTIN_FUNCTION(MaxFunction, FUNCTION_ID_MAX)
485 DECLARE_BUILTIN_FUNCTION(ModeFunction, FUNCTION_ID_MODE)
486 DECLARE_BUILTIN_FUNCTION_RPI(RandFunction, FUNCTION_ID_RAND)
487 DECLARE_BUILTIN_FUNCTION_R2(RandnFunction, FUNCTION_ID_RANDN)
488 DECLARE_BUILTIN_FUNCTION_RPI(RandPoissonFunction, FUNCTION_ID_RAND_POISSON)
489 
490 DECLARE_BUILTIN_FUNCTION(DateFunction, FUNCTION_ID_DATE)
491 DECLARE_BUILTIN_FUNCTION(DateTimeFunction, FUNCTION_ID_DATE_TIME)
492 DECLARE_BUILTIN_FUNCTION(TimeValueFunction, FUNCTION_ID_TIME_VALUE)
493 DECLARE_BUILTIN_FUNCTION(TimestampFunction, FUNCTION_ID_TIMESTAMP)
494 DECLARE_BUILTIN_FUNCTION(TimestampToDateFunction, FUNCTION_ID_TIMESTAMP_TO_DATE)
495 DECLARE_BUILTIN_FUNCTION(DaysFunction, FUNCTION_ID_DAYS)
496 DECLARE_BUILTIN_FUNCTION(YearFracFunction, FUNCTION_ID_YEAR_FRAC)
497 DECLARE_BUILTIN_FUNCTION(WeekFunction, FUNCTION_ID_WEEK)
498 DECLARE_BUILTIN_FUNCTION(WeekdayFunction, FUNCTION_ID_WEEKDAY)
499 DECLARE_BUILTIN_FUNCTION(MonthFunction, FUNCTION_ID_MONTH)
500 DECLARE_BUILTIN_FUNCTION(DayFunction, FUNCTION_ID_DAY)
501 DECLARE_BUILTIN_FUNCTION(YearFunction, FUNCTION_ID_YEAR)
502 DECLARE_BUILTIN_FUNCTION(YeardayFunction, FUNCTION_ID_YEARDAY)
503 DECLARE_BUILTIN_FUNCTION(TimeFunction, FUNCTION_ID_TIME)
504 DECLARE_BUILTIN_FUNCTION(AddDaysFunction, FUNCTION_ID_ADD_DAYS)
505 DECLARE_BUILTIN_FUNCTION(AddMonthsFunction, FUNCTION_ID_ADD_MONTHS)
506 DECLARE_BUILTIN_FUNCTION(AddYearsFunction, FUNCTION_ID_ADD_YEARS)
507 DECLARE_BUILTIN_FUNCTION(LunarPhaseFunction, FUNCTION_ID_LUNAR_PHASE)
508 DECLARE_BUILTIN_FUNCTION(NextLunarPhaseFunction, FUNCTION_ID_NEXT_LUNAR_PHASE)
509 
510 DECLARE_BUILTIN_FUNCTION_PI(AsciiFunction, FUNCTION_ID_ASCII)
511 DECLARE_BUILTIN_FUNCTION(CharFunction, FUNCTION_ID_CHAR)
512 DECLARE_BUILTIN_FUNCTION_PI(LengthFunction, FUNCTION_ID_LENGTH)
513 DECLARE_BUILTIN_FUNCTION(ConcatenateFunction, FUNCTION_ID_CONCATENATE)
514 DECLARE_BUILTIN_FUNCTION(ReplaceFunction, FUNCTION_ID_REPLACE)
515 DECLARE_BUILTIN_FUNCTION(StripUnitsFunction, FUNCTION_ID_STRIP_UNITS)
516 DECLARE_BUILTIN_FUNCTION(CustomSumFunction, FUNCTION_ID_CUSTOM_SUM)
517 DECLARE_BUILTIN_FUNCTION(FunctionFunction, FUNCTION_ID_FUNCTION)
518 DECLARE_BUILTIN_FUNCTION(TitleFunction, FUNCTION_ID_TITLE)
519 DECLARE_BUILTIN_FUNCTION(RepresentsNumberFunction, FUNCTION_ID_REPRESENTS_NUMBER)
520 DECLARE_BUILTIN_FUNCTION(RepresentsRealFunction, FUNCTION_ID_REPRESENTS_REAL)
521 DECLARE_BUILTIN_FUNCTION(RepresentsRationalFunction, FUNCTION_ID_REPRESENTS_RATIONAL)
522 DECLARE_BUILTIN_FUNCTION(RepresentsIntegerFunction, FUNCTION_ID_REPRESENTS_INTEGER)
523 DECLARE_BUILTIN_FUNCTION(ErrorFunction, FUNCTION_ID_ERROR)
524 DECLARE_BUILTIN_FUNCTION(WarningFunction, FUNCTION_ID_WARNING)
525 DECLARE_BUILTIN_FUNCTION(MessageFunction, FUNCTION_ID_MESSAGE)
526 DECLARE_BUILTIN_FUNCTION(SaveFunction, FUNCTION_ID_SAVE)
527 DECLARE_BUILTIN_FUNCTION(RegisterFunction, FUNCTION_ID_REGISTER)
528 DECLARE_BUILTIN_FUNCTION(StackFunction, FUNCTION_ID_STACK)
529 DECLARE_BUILTIN_FUNCTION(PlotFunction, FUNCTION_ID_PLOT)
530 DECLARE_BUILTIN_FUNCTION_R(IntervalFunction, FUNCTION_ID_INTERVAL)
531 DECLARE_BUILTIN_FUNCTION(UncertaintyFunction, FUNCTION_ID_UNCERTAINTY)
532 
533 #endif
534