1#ifndef _BBM_DRJIT_MATH_H_
2#define _BBM_DRJIT_MATH_H_
9#include "backbone/vec.h"
45 using drjit::copysign;
52 using drjit::safe_sqrt;
53 using drjit::safe_asin;
54 using drjit::safe_acos;
65 using drjit::isfinite;
69 #undef BBM_DRJIT_MATHOP
74 template<
typename T,
typename U>
75 inline auto max(T&& t, U&& u)
77 return drjit::select(t > u, std::forward<T>(t), std::forward<U>(u));
83 template<
typename T,
typename U>
84 inline auto min(T&& t, U&& u)
86 return drjit::select(t < u, std::forward<T>(t), std::forward<U>(u));
97 return drjit::scalar_t<T>(1) - drjit::erf(t);
109 auto tmp = drjit::sincos(a);
110 return {tmp.second, tmp.first};
Random number generator; built on top of Drjit.
Definition: backbone.h:53
auto min(T &&t, U &&u)
min between two variables
Definition: math.h:84
vec2d< T > cossin(const T &a)
cossin
Definition: math.h:107
drjit::Array< T, 2 > vec2d
Definition: vec.h:13
auto max(T &&t, U &&u)
max between two variables
Definition: math.h:75
T erfc(const T &t)
erfc
Definition: math.h:95
Compile time polynomial using Horner's method.