diff --git a/include/bw_math.h b/include/bw_math.h
index 0e10458..3872291 100644
--- a/include/bw_math.h
+++ b/include/bw_math.h
@@ -46,10 +46,12 @@
*
* - Version 1.1.0:
*
- * - Added
bw_signfilli64
, bw_mini64
,
- * bw_maxi64
, bw_clipi64
,
- * bw_minu64
, bw_maxu64
, and
- * bw_clipu64
.
+ * - Added
bw_signfilli64()
, bw_mini64()
,
+ * bw_maxi64()
, bw_clipi64()
,
+ * bw_minu64()
, bw_maxu64()
,
+ * bw_clipu64()
, bw_log2_1p2xf()
,
+ * bw_log_1pexpxf()
, and
+ * bw_log10_1p10xf()
.
* - Added support for
BW_INCLUDE_WITH_QUOTES
and
* BW_CXX_NO_EXTERN_C
.
*
@@ -534,6 +536,33 @@ static inline float bw_pow10f(
*
* Relative error < 0.062%.
*
+ * #### bw_log2_1p2xf()
+ * ```>>> */
+static inline float bw_log2_1p2xf(
+ float x);
+/*! <<<```
+ * Returns an approximation of `log2(1+2^x)`.
+ *
+ * Absolute error < 0.006.
+ *
+ * #### bw_log_1pexpxf()
+ * ```>>> */
+static inline float bw_log_1pexpxf(
+ float x);
+/*! <<<```
+ * Returns an approximation of `log(1+exp(x))`.
+ *
+ * Absolute error < 0.004.
+ *
+ * #### bw_log10_1p10xf()
+ * ```>>> */
+static inline float bw_log10_1p10xf(
+ float x);
+/*! <<<```
+ * Returns an approximation of `log10(1+10^x)`.
+ *
+ * Absolute error < 0.002.
+ *
* #### bw_dB2linf()
* ```>>> */
static inline float bw_dB2linf(
@@ -1024,6 +1053,30 @@ static inline float bw_pow10f(
return y;
}
+static inline float bw_log2_1p2xf(
+ float x) {
+ BW_ASSERT(!bw_is_nan(x));
+ const float y = x >= 32.f ? x : bw_log2f(1.f + bw_pow2f(x));
+ BW_ASSERT(bw_is_finite(y));
+ return y;
+}
+
+static inline float bw_log_1pexpxf(
+ float x) {
+ BW_ASSERT(!bw_is_nan(x));
+ const float y = 0.693147180559945f * bw_log2_1p2xf(1.442695040888963f * x);
+ BW_ASSERT(bw_is_finite(y));
+ return y;
+}
+
+static inline float bw_log10_1p10xf(
+ float x) {
+ BW_ASSERT(!bw_is_nan(x));
+ const float y = 0.3010299956639811f * bw_log2_1p2xf(3.321928094887363f * x);
+ BW_ASSERT(bw_is_finite(y));
+ return y;
+}
+
static inline float bw_dB2linf(
float x) {
BW_ASSERT(!bw_is_nan(x));