133#ifndef PICO_DOUBLE_IN_RAM
134#define PICO_DOUBLE_IN_RAM 0
137#if !(LIB_PICO_DOUBLE_COMPILER || defined(__riscv)) || PICO_DOCS
139#define __PICO_DOUBLE_ARM_OPTIMIZED 1
148#if __PICO_DOUBLE_ARM_OPTIMIZED || !defined(__ASSEMBLER__)
150#define PICO_DOUBLE_HAS_INT32_TO_DOUBLE_CONVERSIONS 1
152#define PICO_DOUBLE_HAS_INT64_TO_DOUBLE_CONVERSIONS 1
154#define PICO_DOUBLE_HAS_DOUBLE_TO_INT32_Z_CONVERSIONS 1
156#define PICO_DOUBLE_HAS_DOUBLE_TO_INT64_Z_CONVERSIONS 1
159#if __PICO_DOUBLE_ARM_OPTIMIZED
161#define PICO_DOUBLE_HAS_FIX32_TO_DOUBLE_CONVERSIONS 1
163#define PICO_DOUBLE_HAS_FIX64_TO_DOUBLE_CONVERSIONS 1
165#define PICO_DOUBLE_HAS_DOUBLE_TO_FIX32_Z_CONVERSIONS 1
167#define PICO_DOUBLE_HAS_DOUBLE_TO_FIX64_Z_CONVERSIONS 1
170#define PICO_DOUBLE_HAS_DOUBLE_TO_INT32_M_CONVERSIONS 1
172#define PICO_DOUBLE_HAS_DOUBLE_TO_INT64_M_CONVERSIONS 1
175#define PICO_DOUBLE_HAS_DOUBLE_TO_FIX32_M_CONVERSIONS 1
177#define PICO_DOUBLE_HAS_DOUBLE_TO_FIX64_M_CONVERSIONS 1
180#if (PICO_RP2350 && LIB_PICO_DOUBLE_PICO_DCP) || PICO_DOCS
182#define PICO_DOUBLE_HAS_DDIV_FAST 1
184#define PICO_DOUBLE_HAS_SQRT_FAST 1
186#define PICO_DOUBLE_HAS_FMA_FAST 1
189#if __PICO_DOUBLE_ARM_OPTIMIZED || __builtin_powi || PICO_DOCS
191#define PICO_DOUBLE_HAS_POWINT 1
204#if PICO_DOUBLE_HAS_INT32_TO_DOUBLE_CONVERSIONS
205#if !__PICO_DOUBLE_ARM_OPTIMIZED
207 static inline double int2double(int32_t i) {
return (
double)i; }
208 static inline double uint2double(uint32_t u) {
return (
double)u; }
217#if PICO_DOUBLE_HAS_INT64_TO_DOUBLE_CONVERSIONS
218#if !__PICO_DOUBLE_ARM_OPTIMIZED
220 static inline double int642double(int64_t i) {
return (
double)i; }
221 static inline double uint642double(uint64_t u) {
return (
double)u; }
230#if PICO_DOUBLE_HAS_DOUBLE_TO_INT32_Z_CONVERSIONS
231#if !__PICO_DOUBLE_ARM_OPTIMIZED
233 static inline int32_t
double2int_z(
double d) {
return (int32_t)d; }
234 static inline uint32_t
double2uint_z(
double d) {
return (uint32_t)d; }
245#if PICO_DOUBLE_HAS_DOUBLE_TO_INT64_Z_CONVERSIONS
246#if !__PICO_DOUBLE_ARM_OPTIMIZED
248 static inline int64_t
double2int64_z(
double d) {
return (int64_t)d; }
249 static inline uint64_t
double2uint64_z(
double d) {
return (uint64_t)d; }
260#if PICO_DOUBLE_HAS_FIX32_TO_DOUBLE_CONVERSIONS
269#if PICO_DOUBLE_HAS_FIX64_TO_DOUBLE_CONVERSIONS
278#if PICO_DOUBLE_HAS_DOUBLE_TO_FIX32_Z_CONVERSIONS
287#if PICO_DOUBLE_HAS_DOUBLE_TO_FIX64_Z_CONVERSIONS
298#if PICO_DOUBLE_HAS_DOUBLE_TO_INT32_M_CONVERSIONS
307#if PICO_DOUBLE_HAS_DOUBLE_TO_INT64_M_CONVERSIONS
316#if PICO_DOUBLE_HAS_DOUBLE_TO_FIX32_M_CONVERSIONS
325#if PICO_DOUBLE_HAS_DOUBLE_TO_FIX64_M_CONVERSIONS
338 double exp10(
double x);
342#if __PICO_DOUBLE_ARM_OPTIMIZED && PICO_C_COMPILER_IS_CLANG
344 extern void WRAPPER_FUNC(
sincos)(
double x,
double *sinx,
double *cosx);
345 #define sincos(x, sinx, cosx) WRAPPER_FUNC(sincos)(x, sinx, cosx)
348 void sincos(
double x,
double *sinx,
double *cosx);
351#if PICO_DOUBLE_HAS_POWINT
352#if !__PICO_DOUBLE_ARM_OPTIMIZED && __has_builtin(__builtin_powi)
354 return __builtin_powi(d, p);
362#if PICO_DOUBLE_HAS_DDIV_FAST
367#if PICO_DOUBLE_HAS_SQRT_FAST
372#if PICO_DOUBLE_HAS_FMA_FAST
376double mla(
double x,
double y,
double z);
380#undef __PICO_DOUBLE_ARM_OPTIMIZED
int32_t double2fix(double d, int e)
Convert a double to a signed 32-bit fixed-point integer with the given number of fractional bits,...
double uint2double(uint32_t u)
Convert an unsigned 32-bit integer to the nearest double.
int64_t double2int64(double d)
Convert a double to a signed 64-bit integer, rounding towards -Infinity. This conversion is saturatin...
double uint642double(uint64_t u)
Convert an unsigned 64-bit integer to the nearest double.
uint32_t double2ufix_z(double d, int e)
Convert a double to an unsigned 32-bit fixed-point integer with the given number of fractional bits,...
int32_t double2int(double d)
Convert a double to a signed 32-bit integer, rounding towards -Infinity. This conversion is saturatin...
uint64_t double2uint64(double d)
Convert a double to an usigned 64-bit integer, rounding towards -Infinity. This conversion is saturat...
uint64_t double2uint64_z(double d)
Convert a double to an unsigned 64-bit integer, rounding towards zero. On Arm this conversion is satu...
int64_t double2fix64(double d, int e)
Convert a double to a signed 64-bit fixed-point integer with the given number of fractional bits,...
double sqrt_fast(double d)
Perform a fast floating point square-root with reduced accuracy.
uint64_t double2ufix64(double d, int e)
Convert a double to an unsigned 64-bit fixed-point integer with the given number of fractional bits,...
int32_t double2fix_z(double d, int e)
Convert a double to a signed 32-bit fixed-point integer with the given number of fractional bits,...
uint64_t double2ufix64_z(double d, int e)
Convert a double to an unsigned 64-bit fixed-point integer with the given number of fractional bits,...
double mla(double x, double y, double z)
Perform a fast multiply-add (x * y + z) with reduced accuracy (not fused multiply-add)....
double fma_fast(double x, double y, double z)
Perform a fast (non-fused) multiply-add (x * y + z) with reduced accuracy.
double ufix642double(uint64_t m, int e)
Convert an unsigned 64-bit fixed-point integer with the given number of fractional bits to the neares...
double fix642double(int64_t m, int e)
Convert a signed 64-bit fixed-point integer with the given number of fractional bits to the nearest d...
int32_t double2int_z(double d)
Convert a double to a signed 32-bit integer, rounding towards zero. On Arm this conversion is saturat...
double int2double(int32_t i)
Convert a signed 32-bit integer to the nearest double.
double int642double(int64_t i)
Convert a signed 64-bit integer to the nearest double.
void sincos(double x, double *sinx, double *cosx)
Return both the sine and cosine of an angle efficiently.
double ddiv_fast(double n, double d)
Perform a fast floating point divide with reduced accuracy.
int64_t double2fix64_z(double d, int e)
Convert a double to a signed 64-bit fixed-point integer with the given number of fractional bits,...
uint32_t double2uint(double d)
Convert a double to an unsigned 32-bit integer, rounding towards -Infinity. This conversion is satura...
uint32_t double2uint_z(double d)
Convert a double to an unsigned 32-bit integer, rounding towards zero On Arm this conversion is satur...
int64_t double2int64_z(double d)
Convert a double to a signed 64-bit integer, rounding towards zero. On Arm this conversion is saturat...
double powint(double x, int32_t y)
Raise a floating point number to an integer power.
double fix2double(int32_t m, int e)
Convert a signed 32-bit fixed-point integer with the given number of fractional bits to the nearest d...
double exp10(double x)
Evaluate 10.0 to the power of the given value.
Definition double_math.c:341
double ufix2double(uint32_t m, int e)
Convert an unsigned 32-bit fixed-point integer with the given number of fractional bits to the neares...
uint32_t double2ufix(double d, int e)
Convert a double to an unsigned 32-bit fixed-point integer with the given number of fractional bits,...