Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/util_math.h
| Show First 20 Lines • Show All 512 Lines • ▼ Show 20 Lines | ccl_device float safe_logf(float a, float b) | ||||
| return safe_divide(logf(a),logf(b)); | return safe_divide(logf(a),logf(b)); | ||||
| } | } | ||||
| ccl_device float safe_modulo(float a, float b) | ccl_device float safe_modulo(float a, float b) | ||||
| { | { | ||||
| return (b != 0.0f)? fmodf(a, b): 0.0f; | return (b != 0.0f)? fmodf(a, b): 0.0f; | ||||
| } | } | ||||
| ccl_device_inline float sqr(float a) | |||||
| { | |||||
| return a * a; | |||||
| } | |||||
| ccl_device_inline float beta(float x, float y) | ccl_device_inline float beta(float x, float y) | ||||
| { | { | ||||
| #ifndef __KERNEL_OPENCL__ | #ifndef __KERNEL_OPENCL__ | ||||
| return expf(lgammaf(x) + lgammaf(y) - lgammaf(x+y)); | return expf(lgammaf(x) + lgammaf(y) - lgammaf(x+y)); | ||||
| #else | #else | ||||
| return expf(lgamma(x) + lgamma(y) - lgamma(x+y)); | return expf(lgamma(x) + lgamma(y) - lgamma(x+y)); | ||||
| #endif | #endif | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||