Geometrize  1.0
An application for geometrizing images into geometric primitives
chaiscriptmathextras.h
Go to the documentation of this file.
1 // Additional bindings for ChaiScript from: https://github.com/ChaiScript/ChaiScript_Extras
2 //
3 // Copyright 2015 Jason Turner
4 // Modifications 2021 Sam Twidale (https://samcodes.co.uk/)
5 //
6 // All Rights Reserved.
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions are
9 // met:
10 //
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following
15 // disclaimer in the documentation and/or other materials provided
16 // with the distribution.
17 // * Neither the name of Jason Turner nor the
18 // name of contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
33 
34 #include <cmath>
35 #include <memory>
36 
37 #include <chaiscript/chaiscript.hpp>
38 
39 namespace chaiscript
40 {
41 
42 namespace extras
43 {
44 
45 namespace math
46 {
47 
48 // TRIG FUNCTIONS
49 template<typename Ret, typename Param>
50 ModulePtr cos(ModulePtr m = std::make_shared<Module>())
51 {
52  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::cos)), "cos");
53  return m;
54 }
55 
56 template<typename Ret, typename Param>
57 ModulePtr sin(ModulePtr m = std::make_shared<Module>())
58 {
59  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::sin)), "sin");
60  return m;
61 }
62 
63 template<typename Ret, typename Param>
64 ModulePtr tan(ModulePtr m = std::make_shared<Module>())
65 {
66  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::tan)), "tan");
67  return m;
68 }
69 
70 template<typename Ret, typename Param>
71 ModulePtr acos(ModulePtr m = std::make_shared<Module>())
72 {
73  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::acos)), "acos");
74  return m;
75 }
76 
77 template<typename Ret, typename Param>
78 ModulePtr asin(ModulePtr m = std::make_shared<Module>())
79 {
80  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::asin)), "asin");
81  return m;
82 }
83 
84 template<typename Ret, typename Param>
85 ModulePtr atan(ModulePtr m = std::make_shared<Module>())
86 {
87  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::atan)), "atan");
88  return m;
89 }
90 
91 template<typename Ret, typename Param1, typename Param2>
92 ModulePtr atan2(ModulePtr m = std::make_shared<Module>())
93 {
94  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::atan2)), "atan2");
95  return m;
96 }
97 
98 // HYPERBOLIC FUNCTIONS
99 template<typename Ret, typename Param>
100 ModulePtr cosh(ModulePtr m = std::make_shared<Module>())
101 {
102  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::cosh)), "cosh");
103  return m;
104 }
105 
106 template<typename Ret, typename Param>
107 ModulePtr sinh(ModulePtr m = std::make_shared<Module>())
108 {
109  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::sinh)), "sinh");
110  return m;
111 }
112 
113 template<typename Ret, typename Param>
114 ModulePtr tanh(ModulePtr m = std::make_shared<Module>())
115 {
116  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::tanh)), "tanh");
117  return m;
118 }
119 
120 template<typename Ret, typename Param>
121 ModulePtr acosh(ModulePtr m = std::make_shared<Module>())
122 {
123  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::acosh)), "acosh");
124  return m;
125 }
126 
127 template<typename Ret, typename Param>
128 ModulePtr asinh(ModulePtr m = std::make_shared<Module>())
129 {
130  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::asinh)), "asinh");
131  return m;
132 }
133 
134 template<typename Ret, typename Param>
135 ModulePtr atanh(ModulePtr m = std::make_shared<Module>())
136 {
137  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::atanh)), "atanh");
138  return m;
139 }
140 
141 // EXPONENTIAL AND LOGARITHMIC FUNCTIONS
142 template<typename Ret, typename Param>
143 ModulePtr exp(ModulePtr m = std::make_shared<Module>())
144 {
145  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::exp)), "exp");
146  return m;
147 }
148 
149 template<typename Ret, typename Param1, typename Param2>
150 ModulePtr frexp(ModulePtr m = std::make_shared<Module>())
151 {
152  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::frexp)), "frexp");
153  return m;
154 }
155 
156 template<typename Ret, typename Param1, typename Param2>
157 ModulePtr ldexp(ModulePtr m = std::make_shared<Module>())
158 {
159  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::ldexp)), "ldexp");
160  return m;
161 }
162 
163 template<typename Ret, typename Param>
164 ModulePtr log(ModulePtr m = std::make_shared<Module>())
165 {
166  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::log)), "log");
167  return m;
168 }
169 
170 template<typename Ret, typename Param>
171 ModulePtr log10(ModulePtr m = std::make_shared<Module>())
172 {
173  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::log10)), "log10");
174  return m;
175 }
176 
177 template<typename Ret, typename Param1, typename Param2>
178 ModulePtr modf(ModulePtr m = std::make_shared<Module>())
179 {
180  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::modf)), "modf");
181  return m;
182 }
183 template<typename Ret, typename Param>
184 ModulePtr exp2(ModulePtr m = std::make_shared<Module>())
185 {
186  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::exp2)), "exp2");
187  return m;
188 }
189 
190 template<typename Ret, typename Param>
191 ModulePtr expm1(ModulePtr m = std::make_shared<Module>())
192 {
193  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::expm1)), "expm1");
194  return m;
195 }
196 
197 template<typename Ret, typename Param>
198 ModulePtr ilogb(ModulePtr m = std::make_shared<Module>())
199 {
200  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::ilogb)), "ilogb");
201  return m;
202 }
203 
204 template<typename Ret, typename Param>
205 ModulePtr log1p(ModulePtr m = std::make_shared<Module>())
206 {
207  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::log1p)), "log1p");
208  return m;
209 }
210 
211 template<typename Ret, typename Param>
212 ModulePtr log2(ModulePtr m = std::make_shared<Module>())
213 {
214  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::log2)), "log2");
215  return m;
216 }
217 
218 template<typename Ret, typename Param>
219 ModulePtr logb(ModulePtr m = std::make_shared<Module>())
220 {
221  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::logb)), "logb");
222  return m;
223 }
224 
225 template<typename Ret, typename Param1, typename Param2>
226 ModulePtr scalbn(ModulePtr m = std::make_shared<Module>())
227 {
228  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::scalbn)), "scalbn");
229  return m;
230 }
231 
232 template<typename Ret, typename Param1, typename Param2>
233 ModulePtr scalbln(ModulePtr m = std::make_shared<Module>())
234 {
235  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::scalbln)), "scalbln");
236  return m;
237 }
238 
239 // POWER FUNCTIONS
240 template<typename Ret, typename Param1, typename Param2>
241 ModulePtr pow(ModulePtr m = std::make_shared<Module>())
242 {
243  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::pow)), "pow");
244  return m;
245 }
246 
247 template<typename Ret, typename Param>
248 ModulePtr sqrt(ModulePtr m = std::make_shared<Module>())
249 {
250  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::sqrt)), "sqrt");
251  return m;
252 }
253 
254 template<typename Ret, typename Param>
255 ModulePtr cbrt(ModulePtr m = std::make_shared<Module>())
256 {
257  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::cbrt)), "cbrt");
258  return m;
259 }
260 
261 template<typename Ret, typename Param1, typename Param2>
262 ModulePtr hypot(ModulePtr m = std::make_shared<Module>())
263 {
264  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::hypot)), "hypot");
265  return m;
266 }
267 
268 // ERROR AND GAMMA FUNCTIONS
269 template<typename Ret, typename Param>
270 ModulePtr erf(ModulePtr m = std::make_shared<Module>())
271 {
272  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::erf)), "erf");
273  return m;
274 }
275 
276 template<typename Ret, typename Param>
277 ModulePtr erfc(ModulePtr m = std::make_shared<Module>())
278 {
279  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::erfc)), "erfc");
280  return m;
281 }
282 
283 template<typename Ret, typename Param>
284 ModulePtr tgamma(ModulePtr m = std::make_shared<Module>())
285 {
286  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::tgamma)), "tgamma");
287  return m;
288 }
289 
290 template<typename Ret, typename Param>
291 ModulePtr lgamma(ModulePtr m = std::make_shared<Module>())
292 {
293  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::lgamma)), "lgamma");
294  return m;
295 }
296 
297 // ROUNDING AND REMAINDER FUNCTIONS
298 template<typename Ret, typename Param>
299 ModulePtr ceil(ModulePtr m = std::make_shared<Module>())
300 {
301  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::ceil)), "ceil");
302  return m;
303 }
304 
305 template<typename Ret, typename Param>
306 ModulePtr floor(ModulePtr m = std::make_shared<Module>())
307 {
308  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::floor)), "floor");
309  return m;
310 }
311 
312 template<typename Ret, typename Param1, typename Param2>
313 ModulePtr fmod(ModulePtr m = std::make_shared<Module>())
314 {
315  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::fmod)), "fmod");
316  return m;
317 }
318 
319 template<typename Ret, typename Param>
320 ModulePtr trunc(ModulePtr m = std::make_shared<Module>())
321 {
322  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::trunc)), "trunc");
323  return m;
324 }
325 
326 template<typename Ret, typename Param>
327 ModulePtr round(ModulePtr m = std::make_shared<Module>())
328 {
329  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::round)), "round");
330  return m;
331 }
332 
333 template<typename Ret, typename Param>
334 ModulePtr lround(ModulePtr m = std::make_shared<Module>())
335 {
336  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::lround)), "lround");
337  return m;
338 }
339 
340 // long long ints do not work
341 template<typename Ret, typename Param>
342 ModulePtr llround(ModulePtr m = std::make_shared<Module>())
343 {
344  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::llround)), "llround");
345  return m;
346 }
347 
348 template<typename Ret, typename Param>
349 ModulePtr rint(ModulePtr m = std::make_shared<Module>())
350 {
351  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::rint)), "rint");
352  return m;
353 }
354 
355 template<typename Ret, typename Param>
356 ModulePtr lrint(ModulePtr m = std::make_shared<Module>())
357 {
358  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::lrint)), "lrint");
359  return m;
360 }
361 
362 // long long ints do not work
363 template<typename Ret, typename Param>
364 ModulePtr llrint(ModulePtr m = std::make_shared<Module>())
365 {
366  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::llrint)), "llrint");
367  return m;
368 }
369 
370 template<typename Ret, typename Param>
371 ModulePtr nearbyint(ModulePtr m = std::make_shared<Module>())
372 {
373  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::nearbyint)), "nearbyint");
374  return m;
375 }
376 
377 template<typename Ret, typename Param1, typename Param2>
378 ModulePtr remainder(ModulePtr m = std::make_shared<Module>())
379 {
380  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::remainder)), "remainder");
381  return m;
382 }
383 
384 template<typename Ret, typename Param1, typename Param2, typename Param3>
385 ModulePtr remquo(ModulePtr m = std::make_shared<Module>())
386 {
387  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2, Param3)>(&std::remquo)), "remquo");
388  return m;
389 }
390 
391 // FLOATING-POINT MANIPULATION FUNCTIONS
392 template<typename Ret, typename Param1, typename Param2>
393 ModulePtr copysign(ModulePtr m = std::make_shared<Module>())
394 {
395  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::copysign)), "copysign");
396  return m;
397 }
398 
399 template<typename Ret, typename Param>
400 ModulePtr nan(ModulePtr m = std::make_shared<Module>())
401 {
402  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::nan)), "nan");
403  return m;
404 }
405 
406 template<typename Ret, typename Param1, typename Param2>
407 ModulePtr nextafter(ModulePtr m = std::make_shared<Module>())
408 {
409  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::nextafter)), "nextafter");
410  return m;
411 }
412 
413 template<typename Ret, typename Param1, typename Param2>
414 ModulePtr nexttoward(ModulePtr m = std::make_shared<Module>())
415 {
416  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::nexttoward)), "nexttoward");
417  return m;
418 }
419 
420 // MINIMUM, MAXIMUM, DIFFERENCE FUNCTIONS
421 template<typename Ret, typename Param1, typename Param2>
422 ModulePtr fdim(ModulePtr m = std::make_shared<Module>())
423 {
424  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::fdim)), "fdim");
425  return m;
426 }
427 
428 template<typename Ret, typename Param1, typename Param2>
429 ModulePtr fmax(ModulePtr m = std::make_shared<Module>())
430 {
431  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::fmax)), "fmax");
432  return m;
433 }
434 
435 template<typename Ret, typename Param1, typename Param2>
436 ModulePtr fmin(ModulePtr m = std::make_shared<Module>())
437 {
438  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::fmin)), "fmin");
439  return m;
440 }
441 
442 // OTHER FUNCTIONS
443 template<typename Ret, typename Param>
444 ModulePtr fabs(ModulePtr m = std::make_shared<Module>())
445 {
446  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::fabs)), "fabs");
447  return m;
448 }
449 
450 template<typename Ret, typename Param>
451 ModulePtr abs(ModulePtr m = std::make_shared<Module>())
452 {
453  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::abs)), "abs");
454  return m;
455 }
456 
457 template<typename Ret, typename Param1, typename Param2, typename Param3>
458 ModulePtr fma(ModulePtr m = std::make_shared<Module>())
459 {
460  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2, Param3)>(&std::fma)), "fma");
461  return m;
462 }
463 
464 // CLASSIFICATION FUNCTIONS
465 template<typename Ret, typename Param>
466 ModulePtr fpclassify(ModulePtr m = std::make_shared<Module>())
467 {
468  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::fpclassify)), "fpclassify");
469  return m;
470 }
471 
472 template<typename Ret, typename Param>
473 ModulePtr isfinite(ModulePtr m = std::make_shared<Module>())
474 {
475  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::isfinite)), "isfinite");
476  return m;
477 }
478 
479 template<typename Ret, typename Param>
480 ModulePtr isinf(ModulePtr m = std::make_shared<Module>())
481 {
482  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::isinf)), "isinf");
483  return m;
484 }
485 
486 template<typename Ret, typename Param>
487 ModulePtr isnan(ModulePtr m = std::make_shared<Module>())
488 {
489  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::isnan)), "isnan");
490  return m;
491 }
492 
493 template<typename Ret, typename Param>
494 ModulePtr isnormal(ModulePtr m = std::make_shared<Module>())
495 {
496  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::isnormal)), "isnormal");
497  return m;
498 }
499 
500 template<typename Ret, typename Param>
501 ModulePtr signbit(ModulePtr m = std::make_shared<Module>())
502 {
503  m->add(chaiscript::fun(static_cast<Ret (*)(Param)>(&std::signbit)), "signbit");
504  return m;
505 }
506 
507 // COMPARISON FUNCTIONS
508 template<typename Ret, typename Param1, typename Param2>
509 ModulePtr isgreater(ModulePtr m = std::make_shared<Module>())
510 {
511  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::isgreater)), "isgreater");
512  return m;
513 }
514 
515 template<typename Ret, typename Param1, typename Param2>
516 ModulePtr isgreaterequal(ModulePtr m = std::make_shared<Module>())
517 {
518  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::isgreaterequal)), "isgreaterequal");
519  return m;
520 }
521 
522 template<typename Ret, typename Param1, typename Param2>
523 ModulePtr isless(ModulePtr m = std::make_shared<Module>())
524 {
525  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::isless)), "isless");
526  return m;
527 }
528 
529 template<typename Ret, typename Param1, typename Param2>
530 ModulePtr islessequal(ModulePtr m = std::make_shared<Module>())
531 {
532  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::islessequal)), "islessequal");
533  return m;
534 }
535 
536 template<typename Ret, typename Param1, typename Param2>
537 ModulePtr islessgreater(ModulePtr m = std::make_shared<Module>())
538 {
539  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::islessgreater)), "islessgreater");
540  return m;
541 }
542 
543 template<typename Ret, typename Param1, typename Param2>
544 ModulePtr isunordered(ModulePtr m = std::make_shared<Module>())
545 {
546  m->add(chaiscript::fun(static_cast<Ret (*)(Param1, Param2)>(&std::isunordered)), "isunordered");
547  return m;
548 }
549 
550 ModulePtr bootstrap(ModulePtr m = std::make_shared<Module>())
551 {
552  // TRIG FUNCTIONS
553  cos<double, double>(m);
554  cos<float, float>(m);
555  cos<long double, long double>(m);
556 
557  sin<double, double>(m);
558  sin<float, float>(m);
559  sin<long double, long double>(m);
560 
561  tan<double, double>(m);
562  tan<float, float>(m);
563  tan<long double, long double>(m);
564 
565  acos<double, double>(m);
566  acos<float, float>(m);
567  acos<long double, long double>(m);
568 
569  asin<double, double>(m);
570  asin<float, float>(m);
571  asin<long double, long double>(m);
572 
573  atan<double, double>(m);
574  atan<float, float>(m);
575  atan<long double, long double>(m);
576 
577  atan2<double, double, double>(m);
578  atan2<float, float, float>(m);
579  atan2<long double, long double, long double>(m);
580 
581  // HYPERBOLIC FUNCTIONS
582  cosh<double, double>(m);
583  cosh<float, float>(m);
584  cosh<long double, long double>(m);
585 
586  sinh<double, double>(m);
587  sinh<float, float>(m);
588  sinh<long double, long double>(m);
589 
590  tanh<double, double>(m);
591  tanh<float, float>(m);
592  tanh<long double, long double>(m);
593 
594  acosh<double, double>(m);
595  acosh<float, float>(m);
596  acosh<long double, long double>(m);
597 
598  asinh<double, double>(m);
599  asinh<float, float>(m);
600  asinh<long double, long double>(m);
601 
602  atanh<double, double>(m);
603  atanh<float, float>(m);
604  atanh<long double, long double>(m);
605 
606  // EXPONENTIAL AND LOGARITHMIC FUNCTIONS
607  exp<double, double>(m);
608  exp<float, float>(m);
609  exp<long double, long double>(m);
610 
611  frexp<double, double, int *>(m);
612  frexp<float, float, int *>(m);
613  frexp<long double, long double, int *>(m);
614 
615  ldexp<double, double, int>(m);
616  ldexp<float, float, int>(m);
617  ldexp<long double, long double, int>(m);
618 
619  log<double, double>(m);
620  log<float, float>(m);
621  log<long double, long double>(m);
622 
623  log10<double, double>(m);
624  log10<float, float>(m);
625  log10<long double, long double>(m);
626 
627  modf<double, double, double *>(m);
628  modf<float, float, float *>(m);
629  modf<long double, long double, long double *>(m);
630 
631  exp2<double, double>(m);
632  exp2<float, float>(m);
633  exp2<long double, long double>(m);
634 
635  expm1<double, double>(m);
636  expm1<float, float>(m);
637  expm1<long double, long double>(m);
638 
639  ilogb<int, double>(m);
640  ilogb<int, float>(m);
641  ilogb<int, long double>(m);
642 
643  log1p<double, double>(m);
644  log1p<float, float>(m);
645  log1p<long double, long double>(m);
646 
647  log2<double, double>(m);
648  log2<float, float>(m);
649  log2<long double, long double>(m);
650 
651  logb<double, double>(m);
652  logb<float, float>(m);
653  logb<long double, long double>(m);
654 
655  scalbn<double, double, int>(m);
656  scalbn<float, float, int>(m);
657  scalbn<long double, long double, int>(m);
658 
659  scalbln<double, double, long int>(m);
660  scalbln<float, float, long int>(m);
661  scalbln<long double, long double, long int>(m);
662 
663  // POWER FUNCTIONS
664  pow<double, double, double>(m);
665  pow<float, float, float>(m);
666  pow<long double, long double, long double>(m);
667 
668  sqrt<double, double>(m);
669  sqrt<float, float>(m);
670  sqrt<long double, long double>(m);
671 
672  cbrt<double, double>(m);
673  cbrt<float, float>(m);
674  cbrt<long double, long double>(m);
675 
676  hypot<double, double, double>(m);
677  hypot<float, float, float>(m);
678  hypot<long double, long double, long double>(m);
679 
680  // ERROR AND GAMMA FUNCTIONS
681  erf<double, double>(m);
682  erf<float, float>(m);
683  erf<long double, long double>(m);
684 
685  erfc<double, double>(m);
686  erfc<float, float>(m);
687  erfc<long double, long double>(m);
688 
689  tgamma<double, double>(m);
690  tgamma<float, float>(m);
691  tgamma<long double, long double>(m);
692 
693  lgamma<double, double>(m);
694  lgamma<float, float>(m);
695  lgamma<long double, long double>(m);
696 
697  // ROUNDING AND REMAINDER FUNCTIONS
698  ceil<double, double>(m);
699  ceil<float, float>(m);
700  ceil<long double, long double>(m);
701 
702  floor<double, double>(m);
703  floor<float, float>(m);
704  floor<long double, long double>(m);
705 
706  fmod<double, double, double>(m);
707  fmod<float, float, float>(m);
708  fmod<long double, long double, long double>(m);
709 
710  trunc<double, double>(m);
711  trunc<float, float>(m);
712  trunc<long double, long double>(m);
713 
714  round<double, double>(m);
715  round<float, float>(m);
716  round<long double, long double>(m);
717 
718  lround<long int, double>(m);
719  lround<long int, float>(m);
720  lround<long int, long double>(m);
721 
722  // long long ints do not work
723  llround<long long int, double>(m);
724  llround<long long int, float>(m);
725  llround<long long int, long double>(m);
726 
727  rint<double, double>(m);
728  rint<float, float>(m);
729  rint<long double, long double>(m);
730 
731  lrint<long int, double>(m);
732  lrint<long int, float>(m);
733  lrint<long int, long double>(m);
734 
735  // long long ints do not work
736  llrint<long long int, double>(m);
737  llrint<long long int, float>(m);
738  llrint<long long int, long double>(m);
739 
740  nearbyint<double, double>(m);
741  nearbyint<float, float>(m);
742  nearbyint<long double, long double>(m);
743 
744  remainder<double, double, double>(m);
745  remainder<float, float, float>(m);
746  remainder<long double, long double, long double>(m);
747 
748  remquo<double, double, double, int *>(m);
749  remquo<float, float, float, int *>(m);
750  remquo<long double, long double, long double, int *>(m);
751 
752  // FLOATING-POINT MANIPULATION FUNCTIONS
753  copysign<double, double, double>(m);
754  copysign<float, float, float>(m);
755  copysign<long double, long double, long double>(m);
756 
757  nan<double, const char*>(m);
758 
759  nextafter<double, double, double>(m);
760  nextafter<float, float, float>(m);
761  nextafter<long double, long double, long double>(m);
762 
763  nexttoward<double, double, long double>(m);
764  nexttoward<float, float, long double>(m);
765  nexttoward<long double, long double, long double>(m);
766 
767  // MINIMUM, MAXIMUM, DIFFERENCE FUNCTIONS
768  fdim<double, double, double>(m);
769  fdim<float, float, float>(m);
770  fdim<long double, long double, long double>(m);
771 
772  fmax<double, double, double>(m);
773  fmax<float, float, float>(m);
774  fmax<long double, long double, long double>(m);
775 
776  fmin<double, double, double>(m);
777  fmin<float, float, float>(m);
778  fmin<long double, long double, long double>(m);
779 
780  // OTHER FUNCTIONS
781  fabs<double, double>(m);
782  fabs<float, float>(m);
783  fabs<long double, long double>(m);
784 
785  abs<double, double>(m);
786  abs<float, float>(m);
787  abs<long double, long double>(m);
788 
789  fma<double, double, double, double>(m);
790  fma<float, float, float, float>(m);
791  fma<long double, long double, long double, long double>(m);
792 
793  // CLASSIFICATION FUNCTIONS
794  fpclassify<int, float>(m);
795  fpclassify<int, double>(m);
796  fpclassify<int, long double>(m);
797 
798  isfinite<bool, float>(m);
799  isfinite<bool, double>(m);
800  isfinite<bool, long double>(m);
801 
802  isinf<bool, float>(m);
803 
804  // Disabled as these won't compile with gcc6
805  //isinf<bool, double>(m);
806  //isinf<bool, long double>(m);
807 
808  isnan<bool, float>(m);
809 
810  // Disabled as these won't compile with gcc6
811  //isnan<bool, double>(m);
812  //isnan<bool, long double>(m);
813 
814  isnormal<bool, float>(m);
815  isnormal<bool, double>(m);
816  isnormal<bool, long double>(m);
817 
818  signbit<bool, float>(m);
819  signbit<bool, double>(m);
820  signbit<bool, long double>(m);
821 
822  // COMPARISON FUNCTIONS
823  isgreater<bool, double, double>(m);
824  isgreater<bool, float, float>(m);
825  isgreater<bool, long double, long double>(m);
826 
827  isgreaterequal<bool, double, double>(m);
828  isgreaterequal<bool, float, float>(m);
829  isgreaterequal<bool, long double, long double>(m);
830 
831  isless<bool, double, double>(m);
832  isless<bool, float, float>(m);
833  isless<bool, long double, long double>(m);
834 
835  islessequal<bool, double, double>(m);
836  islessequal<bool, float, float>(m);
837  islessequal<bool, long double, long double>(m);
838 
839  islessgreater<bool, double, double>(m);
840  islessgreater<bool, float, float>(m);
841  islessgreater<bool, long double, long double>(m);
842 
843  isunordered<bool, double, double>(m);
844  isunordered<bool, float, float>(m);
845  isunordered<bool, long double, long double>(m);
846 
847  return m;
848 }
849 
850 }
851 
852 }
853 
854 }
chaiscript::extras::math::trunc
ModulePtr trunc(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:320
chaiscript::extras::math::isgreaterequal
ModulePtr isgreaterequal(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:516
chaiscript::extras::math::tanh
ModulePtr tanh(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:114
chaiscript::extras::math::isgreater
ModulePtr isgreater(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:509
chaiscript::extras::math::exp
ModulePtr exp(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:143
chaiscript::extras::math::sqrt
ModulePtr sqrt(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:248
chaiscript::extras::math::atan
ModulePtr atan(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:85
chaiscript::extras::math::floor
ModulePtr floor(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:306
chaiscript::extras::math::atan2
ModulePtr atan2(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:92
chaiscript::extras::math::nearbyint
ModulePtr nearbyint(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:371
chaiscript::extras::math::hypot
ModulePtr hypot(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:262
chaiscript::extras::math::cosh
ModulePtr cosh(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:100
chaiscript::extras::math::isnan
ModulePtr isnan(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:487
chaiscript::extras::math::frexp
ModulePtr frexp(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:150
chaiscript::extras::math::llrint
ModulePtr llrint(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:364
chaiscript::extras::math::log2
ModulePtr log2(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:212
chaiscript::extras::math::asinh
ModulePtr asinh(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:128
chaiscript::extras::math::tgamma
ModulePtr tgamma(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:284
chaiscript::extras::math::logb
ModulePtr logb(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:219
chaiscript::extras::math::remquo
ModulePtr remquo(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:385
chaiscript::extras::math::fmod
ModulePtr fmod(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:313
chaiscript
Definition: commandlineedit.h:11
chaiscript::extras::math::isunordered
ModulePtr isunordered(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:544
chaiscript::extras::math::sin
ModulePtr sin(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:57
chaiscript::extras::math::isless
ModulePtr isless(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:523
chaiscript::extras::math::fdim
ModulePtr fdim(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:422
chaiscript::extras::math::isnormal
ModulePtr isnormal(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:494
chaiscript::extras::math::remainder
ModulePtr remainder(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:378
chaiscript::extras::math::fmax
ModulePtr fmax(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:429
chaiscript::extras::math::atanh
ModulePtr atanh(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:135
chaiscript::extras::math::round
ModulePtr round(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:327
chaiscript::extras::math::lround
ModulePtr lround(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:334
chaiscript::extras::math::islessequal
ModulePtr islessequal(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:530
chaiscript::extras::math::ldexp
ModulePtr ldexp(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:157
chaiscript::extras::math::llround
ModulePtr llround(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:342
chaiscript::extras::math::erf
ModulePtr erf(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:270
chaiscript::extras::math::lgamma
ModulePtr lgamma(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:291
chaiscript::extras::math::exp2
ModulePtr exp2(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:184
chaiscript::extras::math::cbrt
ModulePtr cbrt(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:255
chaiscript::extras::math::islessgreater
ModulePtr islessgreater(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:537
chaiscript::extras::math::abs
ModulePtr abs(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:451
chaiscript::extras::math::rint
ModulePtr rint(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:349
chaiscript::extras::math::log1p
ModulePtr log1p(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:205
chaiscript::extras::math::ilogb
ModulePtr ilogb(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:198
chaiscript::extras::math::acosh
ModulePtr acosh(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:121
chaiscript::extras::math::fabs
ModulePtr fabs(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:444
chaiscript::extras::math::erfc
ModulePtr erfc(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:277
chaiscript::extras::math::isinf
ModulePtr isinf(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:480
chaiscript::extras::math::ceil
ModulePtr ceil(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:299
chaiscript::extras::math::acos
ModulePtr acos(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:71
chaiscript::extras::math::signbit
ModulePtr signbit(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:501
chaiscript::extras::math::scalbln
ModulePtr scalbln(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:233
chaiscript::extras::math::pow
ModulePtr pow(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:241
chaiscript::extras::math::isfinite
ModulePtr isfinite(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:473
chaiscript::extras::math::nextafter
ModulePtr nextafter(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:407
chaiscript::extras::math::scalbn
ModulePtr scalbn(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:226
chaiscript::extras::math::fmin
ModulePtr fmin(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:436
chaiscript::extras::math::copysign
ModulePtr copysign(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:393
chaiscript::extras::math::bootstrap
ModulePtr bootstrap(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:550
chaiscript::extras::math::log
ModulePtr log(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:164
chaiscript::extras::math::cos
ModulePtr cos(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:50
chaiscript::extras::math::log10
ModulePtr log10(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:171
chaiscript::extras::math::sinh
ModulePtr sinh(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:107
chaiscript::extras::math::lrint
ModulePtr lrint(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:356
chaiscript::extras::math::nexttoward
ModulePtr nexttoward(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:414
chaiscript::extras::math::asin
ModulePtr asin(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:78
chaiscript::extras::math::fma
ModulePtr fma(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:458
chaiscript::extras::math::fpclassify
ModulePtr fpclassify(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:466
chaiscript::extras::math::nan
ModulePtr nan(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:400
chaiscript::extras::math::modf
ModulePtr modf(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:178
chaiscript::extras::math::tan
ModulePtr tan(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:64
chaiscript::extras::math::expm1
ModulePtr expm1(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:191