alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
math.hpp
Go to the documentation of this file.
1/* Copyright 2023 Axel Huebl, Benjamin Worpitz, Matthias Werner, Bert Wesarg, Valentin Gehrke, René Widera,
2 * Jan Stephan, Andrea Bocci, Bernhard Manfred Gruber, Jeffrey Kelling, Sergei Bastrakov, Mehmet Yusufoglu
3 * SPDX-License-Identifier: MPL-2.0
4 */
5
6#pragma once
7
8#include "alpaka/api/api.hpp"
12#include "alpaka/core/decay.hpp"
16
17#include <cmath>
18#include <concepts>
19
21{
22#if ALPAKA_LANG_CUDA || ALPAKA_LANG_HIP
23
24 template<typename T_Arg>
25 requires std::signed_integral<T_Arg> || std::floating_point<T_Arg>
26 struct Abs::Op<CudaHipMath, T_Arg>
27 {
28 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
29 {
30 if constexpr(is_decayed_v<T_Arg, float>)
31 return ::fabsf(arg);
32 else if constexpr(is_decayed_v<T_Arg, double>)
33 return ::fabs(arg);
34 else if constexpr(is_decayed_v<T_Arg, int>)
35 return ::abs(arg);
36 else if constexpr(is_decayed_v<T_Arg, long int>)
37 return ::labs(arg);
38 else if constexpr(is_decayed_v<T_Arg, long long int>)
39 return ::llabs(arg);
40 else
41 static_assert(!sizeof(T_Arg), "Unsupported data type");
42
43 ALPAKA_UNREACHABLE(T_Arg{});
44 }
45 };
46
47 template<std::floating_point T_Arg>
48 struct Sin::Op<CudaHipMath, T_Arg>
49 {
50 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
51 {
52 if constexpr(is_decayed_v<T_Arg, float>)
53 return ::sinf(arg);
54 else if constexpr(is_decayed_v<T_Arg, double>)
55 return ::sin(arg);
56 else
57 static_assert(!sizeof(T_Arg), "Unsupported data type");
58
59 ALPAKA_UNREACHABLE(T_Arg{});
60 }
61 };
62
63 template<std::floating_point T_Arg>
64 struct Acosh::Op<CudaHipMath, T_Arg>
65 {
66 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
67 {
68 if constexpr(is_decayed_v<T_Arg, float>)
69 return ::acoshf(arg);
70 else if constexpr(is_decayed_v<T_Arg, double>)
71 return ::acosh(arg);
72 else
73 static_assert(!sizeof(T_Arg), "Unsupported data type");
74
75 ALPAKA_UNREACHABLE(T_Arg{});
76 }
77 };
78
79 template<std::floating_point T_Arg>
80 struct Asinh::Op<CudaHipMath, T_Arg>
81 {
82 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
83 {
84 if constexpr(is_decayed_v<T_Arg, float>)
85 return ::asinhf(arg);
86 else if constexpr(is_decayed_v<T_Arg, double>)
87 return ::asinh(arg);
88 else
89 static_assert(!sizeof(T_Arg), "Unsupported data type");
90
91 ALPAKA_UNREACHABLE(T_Arg{});
92 }
93 };
94
95 template<std::floating_point T_Arg>
96 struct Sinh::Op<CudaHipMath, T_Arg>
97 {
98 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
99 {
100 if constexpr(is_decayed_v<T_Arg, float>)
101 return ::sinhf(arg);
102 else if constexpr(is_decayed_v<T_Arg, double>)
103 return ::sinh(arg);
104 else
105 static_assert(!sizeof(T_Arg), "Unsupported data type");
106
107 ALPAKA_UNREACHABLE(T_Arg{});
108 }
109 };
110
111 template<std::floating_point T_Arg>
112 struct Atan::Op<CudaHipMath, T_Arg>
113 {
114 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
115 {
116 if constexpr(is_decayed_v<T_Arg, float>)
117 return ::atanf(arg);
118 else if constexpr(is_decayed_v<T_Arg, double>)
119 return ::atan(arg);
120 else
121 static_assert(!sizeof(T_Arg), "Unsupported data type");
122
123 ALPAKA_UNREACHABLE(T_Arg{});
124 }
125 };
126
127 template<std::floating_point T_Arg>
128 struct Atanh::Op<CudaHipMath, T_Arg>
129 {
130 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
131 {
132 if constexpr(is_decayed_v<T_Arg, float>)
133 return ::atanhf(arg);
134 else if constexpr(is_decayed_v<T_Arg, double>)
135 return ::atanh(arg);
136 else
137 static_assert(!sizeof(T_Arg), "Unsupported data type");
138
139 ALPAKA_UNREACHABLE(T_Arg{});
140 }
141 };
142
143 template<std::floating_point T_Arg>
144 struct Tanh::Op<CudaHipMath, T_Arg>
145 {
146 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
147 {
148 if constexpr(is_decayed_v<T_Arg, float>)
149 return ::tanhf(arg);
150 else if constexpr(is_decayed_v<T_Arg, double>)
151 return ::tanh(arg);
152 else
153 static_assert(!sizeof(T_Arg), "Unsupported data type");
154
155 ALPAKA_UNREACHABLE(T_Arg{});
156 }
157 };
158
159 template<typename T_Arg>
160 requires(std::is_arithmetic_v<T_Arg>)
162 {
163 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
164 {
165 if constexpr(is_decayed_v<T_Arg, float>)
166 return ::cbrtf(arg);
167 else if constexpr(is_decayed_v<T_Arg, double> || std::is_integral_v<T_Arg>)
168 return ::cbrt(arg);
169 else
170 static_assert(!sizeof(T_Arg), "Unsupported data type");
171
172 ALPAKA_UNREACHABLE(T_Arg{});
173 }
174 };
175
176 template<std::floating_point T_Arg>
177 struct Ceil::Op<CudaHipMath, T_Arg>
178 {
179 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
180 {
181 if constexpr(is_decayed_v<T_Arg, float>)
182 return ::ceilf(arg);
183 else if constexpr(is_decayed_v<T_Arg, double>)
184 return ::ceil(arg);
185 else
186 static_assert(!sizeof(T_Arg), "Unsupported data type");
187
188 ALPAKA_UNREACHABLE(T_Arg{});
189 }
190 };
191
192 template<std::floating_point T_Arg>
193 struct Round::Op<CudaHipMath, T_Arg>
194 {
195 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
196 {
197 if constexpr(is_decayed_v<T_Arg, float>)
198 return ::roundf(arg);
199 else if constexpr(is_decayed_v<T_Arg, double>)
200 return ::round(arg);
201 else
202 static_assert(!sizeof(T_Arg), "Unsupported data type");
203
204 ALPAKA_UNREACHABLE(T_Arg{});
205 }
206 };
207
208 template<std::floating_point T_Arg>
209 struct Lround::Op<CudaHipMath, T_Arg>
210 {
211 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
212 {
213 if constexpr(is_decayed_v<T_Arg, float>)
214 return ::lroundf(arg);
215 else if constexpr(is_decayed_v<T_Arg, double>)
216 return ::lround(arg);
217 else
218 static_assert(!sizeof(T_Arg), "Unsupported data type");
219
220 ALPAKA_UNREACHABLE(long{});
221 }
222 };
223
224 template<std::floating_point T_Arg>
225 struct Llround::Op<CudaHipMath, T_Arg>
226 {
227 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
228 {
229 if constexpr(is_decayed_v<T_Arg, float>)
230 return ::llroundf(arg);
231 else if constexpr(is_decayed_v<T_Arg, double>)
232 return ::llround(arg);
233 else
234 static_assert(!sizeof(T_Arg), "Unsupported data type");
235
236 ALPAKA_UNREACHABLE(long long{});
237 }
238 };
239
240 template<std::floating_point T_Arg>
241 struct SinCos::Op<CudaHipMath, T_Arg>
242 {
243 constexpr auto operator()(CudaHipMath, T_Arg const& arg, T_Arg& result_sin, T_Arg& result_cos) const
244 {
245 if constexpr(is_decayed_v<T_Arg, float>)
246 ::sincosf(arg, &result_sin, &result_cos);
247 else if constexpr(is_decayed_v<T_Arg, double>)
248 ::sincos(arg, &result_sin, &result_cos);
249 else
250 static_assert(!sizeof(T_Arg), "Unsupported data type");
251 }
252 };
253
254 template<std::floating_point T_Arg>
255 struct Exp::Op<CudaHipMath, T_Arg>
256 {
257 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
258 {
259 if constexpr(is_decayed_v<T_Arg, float>)
260 return ::expf(arg);
261 else if constexpr(is_decayed_v<T_Arg, double>)
262 return ::exp(arg);
263 else
264 static_assert(!sizeof(T_Arg), "Unsupported data type");
265
266 ALPAKA_UNREACHABLE(T_Arg{});
267 }
268 };
269
270 template<typename T_Arg>
271 requires(std::is_arithmetic_v<T_Arg>)
273 {
274 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
275 {
276 if constexpr(is_decayed_v<T_Arg, float>)
277 return ::sqrtf(arg);
278 else if constexpr(is_decayed_v<T_Arg, double> || std::is_integral_v<T_Arg>)
279 return ::sqrt(arg);
280 else
281 static_assert(!sizeof(T_Arg), "Unsupported data type");
282
283 ALPAKA_UNREACHABLE(T_Arg{});
284 }
285 };
286
287 template<typename T_Arg>
288 requires(std::is_arithmetic_v<T_Arg>)
290 {
291 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
292 {
293 if constexpr(is_decayed_v<T_Arg, float>)
294 return ::rsqrtf(arg);
295 else if constexpr(is_decayed_v<T_Arg, double> || std::is_integral_v<T_Arg>)
296 return ::rsqrt(arg);
297 else
298 static_assert(!sizeof(T_Arg), "Unsupported data type");
299
300 ALPAKA_UNREACHABLE(T_Arg{});
301 }
302 };
303
304 template<std::floating_point T_Arg>
305 struct Trunc::Op<CudaHipMath, T_Arg>
306 {
307 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
308 {
309 if constexpr(is_decayed_v<T_Arg, float>)
310 return ::truncf(arg);
311 else if constexpr(is_decayed_v<T_Arg, double>)
312 return ::trunc(arg);
313 else
314 static_assert(!sizeof(T_Arg), "Unsupported data type");
315
316 ALPAKA_UNREACHABLE(T_Arg{});
317 }
318 };
319
320 template<std::floating_point T_Arg>
321 struct Cos::Op<CudaHipMath, T_Arg>
322 {
323 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
324 {
325 if constexpr(is_decayed_v<T_Arg, float>)
326 return ::cosf(arg);
327 else if constexpr(is_decayed_v<T_Arg, double>)
328 return ::cos(arg);
329 else
330 static_assert(!sizeof(T_Arg), "Unsupported data type");
331
332 ALPAKA_UNREACHABLE(T_Arg{});
333 }
334 };
335
336 template<std::floating_point T_Arg>
337 struct Cosh::Op<CudaHipMath, T_Arg>
338 {
339 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
340 {
341 if constexpr(is_decayed_v<T_Arg, float>)
342 return ::coshf(arg);
343 else if constexpr(is_decayed_v<T_Arg, double>)
344 return ::cosh(arg);
345 else
346 static_assert(!sizeof(T_Arg), "Unsupported data type");
347
348 ALPAKA_UNREACHABLE(T_Arg{});
349 }
350 };
351
352 template<std::floating_point T_Arg>
353 struct Erf::Op<CudaHipMath, T_Arg>
354 {
355 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
356 {
357 if constexpr(is_decayed_v<T_Arg, float>)
358 return ::erff(arg);
359 else if constexpr(is_decayed_v<T_Arg, double>)
360 return ::erf(arg);
361 else
362 static_assert(!sizeof(T_Arg), "Unsupported data type");
363
364 ALPAKA_UNREACHABLE(T_Arg{});
365 }
366 };
367
368 template<std::floating_point T_Arg>
369 struct Floor::Op<CudaHipMath, T_Arg>
370 {
371 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
372 {
373 if constexpr(is_decayed_v<T_Arg, float>)
374 return ::floorf(arg);
375 else if constexpr(is_decayed_v<T_Arg, double>)
376 return ::floor(arg);
377 else
378 static_assert(!sizeof(T_Arg), "Unsupported data type");
379
380 ALPAKA_UNREACHABLE(T_Arg{});
381 }
382 };
383
384 template<std::floating_point T_Arg>
385 struct Log::Op<CudaHipMath, T_Arg>
386 {
387 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
388 {
389 if constexpr(is_decayed_v<T_Arg, float>)
390 return ::logf(arg);
391 else if constexpr(is_decayed_v<T_Arg, double>)
392 return ::log(arg);
393 else
394 static_assert(!sizeof(T_Arg), "Unsupported data type");
395
396 ALPAKA_UNREACHABLE(T_Arg{});
397 }
398 };
399
400 template<std::floating_point T_Arg>
401 struct Log2::Op<CudaHipMath, T_Arg>
402 {
403 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
404 {
405 if constexpr(is_decayed_v<T_Arg, float>)
406 return ::log2f(arg);
407 else if constexpr(is_decayed_v<T_Arg, double>)
408 return ::log2(arg);
409 else
410 static_assert(!sizeof(T_Arg), "Unsupported data type");
411
412 ALPAKA_UNREACHABLE(T_Arg{});
413 }
414 };
415
416 template<std::floating_point T_Arg>
417 struct Log10::Op<CudaHipMath, T_Arg>
418 {
419 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
420 {
421 if constexpr(is_decayed_v<T_Arg, float>)
422 return ::log10f(arg);
423 else if constexpr(is_decayed_v<T_Arg, double>)
424 return ::log10(arg);
425 else
426 static_assert(!sizeof(T_Arg), "Unsupported data type");
427
428 ALPAKA_UNREACHABLE(T_Arg{});
429 }
430 };
431
432 template<std::floating_point T_Arg>
433 struct Tan::Op<CudaHipMath, T_Arg>
434 {
435 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
436 {
437 if constexpr(is_decayed_v<T_Arg, float>)
438 return ::tanf(arg);
439 else if constexpr(is_decayed_v<T_Arg, double>)
440 return ::tan(arg);
441 else
442 static_assert(!sizeof(T_Arg), "Unsupported data type");
443
444 ALPAKA_UNREACHABLE(T_Arg{});
445 }
446 };
447
448 template<std::floating_point T_Y, std::floating_point T_X>
449 struct Atan2::Op<CudaHipMath, T_Y, T_X>
450 {
451 constexpr auto operator()(CudaHipMath, T_Y const& y, T_X const& x) const
452 {
454 return ::atan2f(y, x);
456 return ::atan2(y, x);
457 else
458 static_assert(!sizeof(T_Y), "Unsupported data type");
459
460 ALPAKA_UNREACHABLE(T_Y{});
461 }
462 };
463
464 template<std::floating_point T_Arg>
465 struct Arg::Op<CudaHipMath, T_Arg>
466 {
467 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
468 {
469 // Fall back to atan2 so that boundary cases are resolved consistently
470 return atan2(T_Arg{0.0}, arg);
471 }
472 };
473
474 template<std::floating_point T_Arg>
475 struct Asin::Op<CudaHipMath, T_Arg>
476 {
477 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
478 {
479 if constexpr(is_decayed_v<T_Arg, float>)
480 return ::asinf(arg);
481 else if constexpr(is_decayed_v<T_Arg, double>)
482 return ::asin(arg);
483 else
484 static_assert(!sizeof(T_Arg), "Unsupported data type");
485
486 ALPAKA_UNREACHABLE(T_Arg{});
487 }
488 };
489
490 template<std::floating_point T_Arg>
491 struct Acos::Op<CudaHipMath, T_Arg>
492 {
493 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
494 {
495 if constexpr(is_decayed_v<T_Arg, float>)
496 return ::acosf(arg);
497 else if constexpr(is_decayed_v<T_Arg, double>)
498 return ::acos(arg);
499 else
500 static_assert(!sizeof(T_Arg), "Unsupported data type");
501
502 ALPAKA_UNREACHABLE(T_Arg{});
503 }
504 };
505
506 // Shared helper keeps CUDA/HIP IEEE predicates aligned with host behavior under fast-math.
507 template<std::floating_point T_Arg>
508 struct Isnan::Op<CudaHipMath, T_Arg>
509 {
510 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
511 {
512 return ieeeIsnan(arg);
513 }
514 };
515
516 template<std::floating_point T_Arg>
517 struct Isinf::Op<CudaHipMath, T_Arg>
518 {
519 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
520 {
521 return ieeeIsinf(arg);
522 }
523 };
524
525 template<std::floating_point T_Arg>
526 struct Isfinite::Op<CudaHipMath, T_Arg>
527 {
528 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
529 {
530 return ieeeIsfinite(arg);
531 }
532 };
533
534 template<std::floating_point T_Arg>
535 struct Conj::Op<CudaHipMath, T_Arg>
536 {
537 constexpr auto operator()(CudaHipMath, T_Arg const& arg) const
538 {
539 return Complex<T_Arg>{arg, T_Arg{0.0}};
540 }
541 };
542
543 template<std::floating_point T_Mag, std::floating_point T_Sgn>
544 struct Copysign::Op<CudaHipMath, T_Mag, T_Sgn>
545 {
546 constexpr auto operator()(CudaHipMath, T_Mag const& mag, T_Sgn const& sgn) const
547 {
549 return ::copysignf(mag, sgn);
551 return ::copysign(mag, sgn);
552 else
553 static_assert(!sizeof(T_Mag), "Unsupported data type");
554
555 ALPAKA_UNREACHABLE(T_Mag{});
556 }
557 };
558
559 template<std::floating_point T_A, std::floating_point T_B>
560 struct Min::Op<CudaHipMath, T_A, T_B>
561 {
562 constexpr auto operator()(CudaHipMath, T_A const& a, T_B const& b) const
563 {
564 if constexpr(std::is_integral_v<T_A> && std::is_integral_v<T_B>)
565 return ::min(a, b);
567 return ::fminf(a, b);
568 else if constexpr(
570 || (is_decayed_v<T_A, float> && std::is_integral_v<T_B>)
571 || (std::is_integral_v<T_A> && is_decayed_v<T_B, float>) )
572 return ::fmin(a, b);
573 else
574 static_assert(!sizeof(T_A), "Unsupported data type");
575
576 using Ret [[maybe_unused]] = std::conditional_t<
577 std::is_integral_v<T_A> && std::is_integral_v<T_B>,
578 decltype(::min(a, b)),
579 std::conditional_t<is_decayed_v<T_A, float> && is_decayed_v<T_B, float>, float, double>>;
580 ALPAKA_UNREACHABLE(Ret{});
581 }
582 };
583
584 template<typename T_A, typename T_B>
585 requires(std::is_arithmetic_v<T_A> && std::is_arithmetic_v<T_B>)
587 {
588 constexpr auto operator()(CudaHipMath, T_A const& a, T_B const& b) const
589 {
590 if constexpr(std::is_integral_v<T_A> && std::is_integral_v<T_B>)
591 return ::max(a, b);
593 return ::fmaxf(a, b);
594 else if constexpr(
596 || (is_decayed_v<T_A, float> && std::is_integral_v<T_B>)
597 || (std::is_integral_v<T_A> && is_decayed_v<T_B, float>) )
598 return ::fmax(a, b);
599 else
600 static_assert(!sizeof(T_A), "Unsupported data type");
601
602 using Ret [[maybe_unused]] = std::conditional_t<
603 std::is_integral_v<T_A> && std::is_integral_v<T_B>,
604 decltype(::max(a, b)),
605 std::conditional_t<is_decayed_v<T_A, float> && is_decayed_v<T_B, float>, float, double>>;
606 ALPAKA_UNREACHABLE(Ret{});
607 }
608 };
609
610 template<std::floating_point T_Base, std::floating_point T_Exp>
611 struct Pow::Op<CudaHipMath, T_Base, T_Exp>
612 {
613 constexpr auto operator()(CudaHipMath, T_Base const& base, T_Exp const& exp) const
614 {
616 return ::powf(base, exp);
618 return ::pow(static_cast<double>(base), static_cast<double>(exp));
619 else
620 static_assert(!sizeof(T_Base), "Unsupported data type");
621
622 using Ret [[maybe_unused]]
623 = std::conditional_t<is_decayed_v<T_Base, float> && is_decayed_v<T_Exp, float>, float, double>;
624 ALPAKA_UNREACHABLE(Ret{});
625 }
626 };
627
628 template<std::floating_point T_X, std::floating_point T_Y>
629 struct Fmod::Op<CudaHipMath, T_X, T_Y>
630 {
631 constexpr auto operator()(CudaHipMath, T_X const& x, T_Y const& y) const
632 {
634 return ::fmodf(x, y);
636 return ::fmod(x, y);
637 else
638 static_assert(!sizeof(T_X), "Unsupported data type");
639
640 using Ret [[maybe_unused]]
641 = std::conditional_t<is_decayed_v<T_X, float> && is_decayed_v<T_Y, float>, float, double>;
642 ALPAKA_UNREACHABLE(Ret{});
643 }
644 };
645
646 template<std::floating_point T_X, std::floating_point T_Y>
647 struct Remainder::Op<CudaHipMath, T_X, T_Y>
648 {
649 constexpr auto operator()(CudaHipMath, T_X const& x, T_Y const& y) const
650 {
652 return ::remainderf(x, y);
654 return ::remainder(x, y);
655 else
656 static_assert(!sizeof(T_X), "Unsupported data type");
657
658 using Ret [[maybe_unused]]
659 = std::conditional_t<is_decayed_v<T_X, float> && is_decayed_v<T_Y, float>, float, double>;
660 ALPAKA_UNREACHABLE(Ret{});
661 }
662 };
663
664 template<std::floating_point T_X, std::floating_point T_Y, std::floating_point T_Z>
665 struct Fma::Op<CudaHipMath, T_X, T_Y, T_Z>
666 {
667 constexpr auto operator()(CudaHipMath, T_X const& x, T_Y const& y, T_Z const& z) const
668 {
670 return ::fmaf(x, y, z);
672 return ::fma(x, y, z);
673 else
674 static_assert(!sizeof(T_X), "Unsupported data type");
675
676 using Ret [[maybe_unused]] = std::conditional_t<
678 float,
679 double>;
680 ALPAKA_UNREACHABLE(Ret{});
681 }
682 };
683
684
685#endif
686
687} // namespace alpaka::math::internal
#define ALPAKA_UNREACHABLE(...)
Before CUDA 11.5 nvcc is unable to correctly identify return statements in 'if constexpr' branches....
constexpr T arg(Complex< T > const &x)
Argument.
Definition Complex.hpp:399
constexpr bool ieeeIsnan(T const &arg)
Definition ieee754.hpp:25
constexpr bool ieeeIsinf(T const &arg)
Definition ieee754.hpp:46
constexpr Complex< T > exp(Complex< T > const &x)
Exponential.
Definition Complex.hpp:455
constexpr bool ieeeIsfinite(T const &arg)
Definition ieee754.hpp:67
constexpr auto atan2(auto const &y, auto const &x)
Definition math.hpp:152
constexpr auto sincos(auto const &arg, auto &result_sin, auto &result_cos)
Definition math.hpp:130
constexpr auto min(auto const &a, auto const &b)
Definition math.hpp:272
constexpr auto max(auto const &a, auto const &b)
Definition math.hpp:278
constexpr auto is_decayed_v
Provides a decaying wrapper around std::is_same. Example: is_decayed_v<volatile float,...
Definition decay.hpp:13
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:39
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:42
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:43
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:72
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:47
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:48
constexpr auto operator()(T_MathImpl, T_Y const &y, T_X const &x) const
Definition math.hpp:119
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:52
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:53
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:58
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:79
constexpr auto operator()(T_MathImpl, T_Mag const &mag, T_Sgn const &sgn) const
Definition math.hpp:172
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:41
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:44
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:73
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:70
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:64
constexpr auto operator()(T_MathImpl, T_X const &x, T_Y const &y, T_Z const &z) const
Definition math.hpp:286
constexpr auto operator()(T_MathImpl, T_X const &x, T_Y const &y) const
Definition math.hpp:248
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:77
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:76
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:75
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:61
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:68
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:67
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:66
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:60
constexpr auto operator()(T_MathImpl, T_A const &a, T_B const &b) const
Definition math.hpp:191
constexpr auto operator()(T_MathImpl, T_Base const &base, T_Exp const &exp) const
Definition math.hpp:229
constexpr auto operator()(T_MathImpl, T_X const &x, T_Y const &y) const
Definition math.hpp:267
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:59
constexpr auto operator()(T_MathImpl, T_Arg const &arg, T_Arg &result_sin, T_Arg &result_cos) const
Definition math.hpp:153
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:46
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:49
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:51
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:54
constexpr auto operator()(T_MathImpl, T_Arg const &argument) const
Definition math.hpp:63