9 static const char*
const names[] = {
31 if ((
unsigned int)status >=
sizeof(names) /
sizeof(names[0])) {
32 return "InternalInvariant";
34 return names[(
unsigned int)status];
40 return lmmc_std_store_finite_real((
lmmc_real_t)sin((
double)x), out);
47 return lmmc_std_store_finite_real((
lmmc_real_t)cos((
double)x), out);
54 return lmmc_std_store_finite_real((
lmmc_real_t)tan((
double)x), out);
63 if (!lmmc_std_real_is_finite(x) || !lmmc_std_real_is_finite(y)) {
66 if ((
double)x == 0.0 && (
double)y < 0.0) {
69 if ((
double)x < 0.0 && modf((
double)y, &integral_part) != 0.0) {
72 value = pow((
double)x, (
double)y);
83 return lmmc_std_store_finite_real((
lmmc_real_t)asin((
double)x), out);
91 return lmmc_std_store_finite_real((
lmmc_real_t)acos((
double)x), out);
98 return lmmc_std_store_finite_real((
lmmc_real_t)atan((
double)x), out);
106 return lmmc_std_store_finite_real((
lmmc_real_t)sqrt((
double)x), out);
113 return lmmc_std_store_finite_real((
lmmc_real_t)exp((
double)x), out);
121 return lmmc_std_store_finite_real((
lmmc_real_t)log((
double)x), out);
133 if (!lmmc_std_real_is_finite(x) || !lmmc_std_real_is_finite(base)) {
140 return lmmc_std_store_finite_real(
141 (
lmmc_real_t)(log((
double)x) / log((
double)base)), out);
149 return lmmc_std_store_finite_real((
lmmc_real_t)log10((
double)x), out);
156 return lmmc_std_store_finite_real((
lmmc_real_t)fabs((
double)x), out);
161 return lmmc_std_store_finite_real((
lmmc_real_t)floor((
double)x), out);
166 return lmmc_std_store_finite_real((
lmmc_real_t)ceil((
double)x), out);
171 return lmmc_std_store_finite_real((
lmmc_real_t)round((
double)x), out);
178 if (!lmmc_std_real_is_finite(x) || !lmmc_std_real_is_finite(lo) ||
179 !lmmc_std_real_is_finite(hi)) {
183 if (x < lo) *out = lo;
184 else if (x > hi) *out = hi;
186 return lmmc_std_store_finite_real(*out, out);
double lmmc_real_t
Public and internal LMMC real type.
lmmc_status_t
LMMC 库统一返回的状态码.
@ LMMC_STATUS_CONVERGENCE_FAILED
@ LMMC_STATUS_UNIT_STRIP_TYPE_MISMATCH
@ LMMC_STATUS_UNIT_STRIP_LEGACY_SYNTAX
@ LMMC_STATUS_REFERENCE_LIMIT
@ LMMC_STATUS_NUMERICAL_FAILURE
@ LMMC_STATUS_NOT_POSITIVE_DEFINITE
@ LMMC_STATUS_DIMENSION_MISMATCH
@ LMMC_STATUS_ALLOCATION_FAILED
@ LMMC_STATUS_SINGULAR_MATRIX
@ LMMC_STATUS_NOT_IMPLEMENTED
@ LMMC_STATUS_UNIT_STRIP_INVALID
@ LMMC_STATUS_NOT_INITIALIZED
@ LMMC_STATUS_INVALID_ARGUMENT
@ LMMC_STATUS_OUT_OF_RANGE
@ LMMC_STATUS_INDEX_OUT_OF_BOUNDS
@ LMMC_STATUS_EMPTY_INPUT
@ LMMC_STATUS_WARNING_MAX_DEPTH
@ LMMC_STATUS_UNIT_STRIP_OVERFLOW
lmmc_status_t lmmc_std_math_log10(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_sqrt(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_ceil(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_sin(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_tan(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_abs(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_ln(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_exp(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_pow(lmmc_real_t x, lmmc_real_t y, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_round(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_atan(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_log(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_log_base(lmmc_real_t x, lmmc_real_t base, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_cos(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_clamp(lmmc_real_t x, lmmc_real_t lo, lmmc_real_t hi, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_floor(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_asin(lmmc_real_t x, lmmc_real_t *out)
lmmc_status_t lmmc_std_math_acos(lmmc_real_t x, lmmc_real_t *out)
const char * lmmc_std_error_name(lmmc_status_t status)
将 LMMC 状态码映射为 LSR 规范定义的稳定诊断名称。