mirror of
https://git.vladimir.cc/vladimir/wdsp.git
synced 2026-08-25 17:27:33 +00:00
emnr: linear-time aepf, drop idiv from ring walks, halve getKey's logs
Three separate costs, found with a sampling profile of the RX chain with
emnr forced on:
aepf() averaged mask[] over a window of N = 2*psi + 1 = 41 bins by walking
the window for every one of the 2049 bins, i.e. O(msize*N). Its three spans
are all symmetric windows clipped at the array ends, so take each from a
prefix sum instead: one subtraction per output, O(msize).
xemnr() advanced four ring indices with a '% size' per step. iasize is 4096
and oasize 1024 here, and neither is known to the compiler, so each step was
a real integer division -- ~8700 of them per frame. The indices step by one
and, since iasize >= fsize and oasize >= incr always hold, wrap at most once
per loop, so walk contiguous runs and wrap between them.
calc_gain() called getKey() twice per bin with the same gamma, so the gamma
row index and its log10 were computed twice. Split getKey into keyIndex() +
keyLerp() and locate gamma once. The remaining logs go through wdsp_log10()
(new fastmath.h), accurate to 2e-13 against libm and ~2.4x its throughput;
gamma and xi are bracketed against the table limits first, so the argument
is always positive and normal. Also clamp the row index so the second
bilinear corner cannot address the next row of the 241x241 table.
Measured in situ on an Apple M1 Pro, 512-sample buffers, cost of turning
emnr on, best of 5:
baseline 73661 ns
+ aepf, ring walks 48927 ns 1.51x
+ getKey 37852 ns 1.95x
Output is not bit-identical, as the prefix sum and the reassociated logs
round differently. Over 300 buffers with emnr alone the worst deviation is
4.0e-09, an SNR of 196 dB; perturbing a single input sample of the unmodified
code by one ulp diverges it from itself by 1.4e-08 (186 dB), so this change
disturbs the chain less than the last bit of the input does.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
3faad14fc1
commit
fd2ba84e7d
@@ -70,6 +70,7 @@ warren@wpratt.com
|
|||||||
#include "sbnr.h" // NR3 + NR4 support
|
#include "sbnr.h" // NR3 + NR4 support
|
||||||
#include "emph.h"
|
#include "emph.h"
|
||||||
#include "eq.h"
|
#include "eq.h"
|
||||||
|
#include "fastmath.h"
|
||||||
#include "fcurve.h"
|
#include "fcurve.h"
|
||||||
#include "fir.h"
|
#include "fir.h"
|
||||||
#include "firmin.h"
|
#include "firmin.h"
|
||||||
|
|||||||
@@ -557,6 +557,7 @@ void calc_emnr(EMNR a)
|
|||||||
a->ae.psi = 20.0;
|
a->ae.psi = 20.0;
|
||||||
a->ae.t2 = 0.20;
|
a->ae.t2 = 0.20;
|
||||||
a->ae.nmask = (double *)malloc0(a->ae.msize * sizeof(double));
|
a->ae.nmask = (double *)malloc0(a->ae.msize * sizeof(double));
|
||||||
|
a->ae.csum = (double *)malloc0((a->ae.msize + 1) * sizeof(double));
|
||||||
//
|
//
|
||||||
// post2
|
// post2
|
||||||
a->post2.run = 0;
|
a->post2.run = 0;
|
||||||
@@ -580,6 +581,7 @@ void decalc_emnr(EMNR a)
|
|||||||
_aligned_free(a->post2.noise_frame);
|
_aligned_free(a->post2.noise_frame);
|
||||||
_aligned_free(a->post2.w);
|
_aligned_free(a->post2.w);
|
||||||
// ae
|
// ae
|
||||||
|
_aligned_free(a->ae.csum);
|
||||||
_aligned_free(a->ae.nmask);
|
_aligned_free(a->ae.nmask);
|
||||||
// npl
|
// npl
|
||||||
_aligned_free(a->npl.D);
|
_aligned_free(a->npl.D);
|
||||||
@@ -868,26 +870,26 @@ void aepf(EMNR a)
|
|||||||
else
|
else
|
||||||
N = 1 + 2 * (int)(0.5 + a->ae.psi * (1.0 - zetaT / a->ae.zetaThresh));
|
N = 1 + 2 * (int)(0.5 + a->ae.psi * (1.0 - zetaT / a->ae.zetaThresh));
|
||||||
n = N / 2;
|
n = N / 2;
|
||||||
for (k = 0; k < n; k++)
|
/* Each of the three spans below averages mask[] over a window that is
|
||||||
|
symmetric about k and clipped at the array ends. Taking them straight
|
||||||
|
from a prefix sum makes each output one subtraction rather than a walk of
|
||||||
|
up to N = 2*psi + 1 taps, so the pass is O(msize) instead of O(msize*N). */
|
||||||
{
|
{
|
||||||
a->ae.nmask[k] = 0.0;
|
const int msize = a->ae.msize;
|
||||||
for (m = 0; m <= 2 * k; m++)
|
const double* WDSP_RESTRICT mask = a->mask;
|
||||||
a->ae.nmask[k] += a->mask[m];
|
double* WDSP_RESTRICT nmask = a->ae.nmask;
|
||||||
a->ae.nmask[k] /= (double)(2 * k + 1);
|
double* WDSP_RESTRICT csum = a->ae.csum;
|
||||||
}
|
|
||||||
for (k = n; k < (a->ae.msize - n); k++)
|
csum[0] = 0.0;
|
||||||
{
|
for (k = 0; k < msize; k++)
|
||||||
a->ae.nmask[k] = 0.0;
|
csum[k + 1] = csum[k] + mask[k];
|
||||||
for (m = k - n; m <= (k + n); m++)
|
|
||||||
a->ae.nmask[k] += a->mask[m];
|
for (k = 0; k < n; k++) // window [0, 2k]
|
||||||
a->ae.nmask[k] /= (double)N;
|
nmask[k] = (csum[2 * k + 1] - csum[0]) / (double)(2 * k + 1);
|
||||||
}
|
for (k = n; k < (msize - n); k++) // window [k-n, k+n]
|
||||||
for (k = a->ae.msize - n; k < a->ae.msize; k++)
|
nmask[k] = (csum[k + n + 1] - csum[k - n]) / (double)N;
|
||||||
{
|
for (k = msize - n; k < msize; k++) // window [2k+1-msize, msize-1]
|
||||||
a->ae.nmask[k] = 0.0;
|
nmask[k] = (csum[msize] - csum[2 * k + 1 - msize]) / (double)(2 * (msize - k) - 1);
|
||||||
for (m = (a->ae.msize - 1); m >= (-a->ae.msize + 2 * k + 1); m--)
|
|
||||||
a->ae.nmask[k] += a->mask[m];
|
|
||||||
a->ae.nmask[k] /= (double)(2 * (a->ae.msize - k) - 1);
|
|
||||||
}
|
}
|
||||||
memcpy (a->mask, a->ae.nmask, a->ae.msize * sizeof (double));
|
memcpy (a->mask, a->ae.nmask, a->ae.msize * sizeof (double));
|
||||||
if (a->g.gain_method == 3 && zetaT < a->ae.t2)
|
if (a->g.gain_method == 3 && zetaT < a->ae.t2)
|
||||||
@@ -998,52 +1000,54 @@ void SetRXAEMNRpost2Rate(int channel, double tc)
|
|||||||
* End Post-Processing Functions *
|
* End Post-Processing Functions *
|
||||||
********************************************************************************************************/
|
********************************************************************************************************/
|
||||||
|
|
||||||
double getKey(double* type, double gamma, double xi)
|
/* Locate v on the table's 0.25 dB grid: n1/n2 bracket it, d is the fraction.
|
||||||
|
|
||||||
|
v is compared against the table's dB limits first, so on the interpolating
|
||||||
|
path the log argument is positive and normal and wdsp_log10 applies. */
|
||||||
|
static inline void keyIndex (double v, int* n1, int* n2, double* d)
|
||||||
{
|
{
|
||||||
int ngamma1, ngamma2, nxi1, nxi2;
|
|
||||||
double tg, tx, dg, dx;
|
|
||||||
const double dmin = 0.001;
|
const double dmin = 0.001;
|
||||||
const double dmax = 1000.0;
|
const double dmax = 1000.0;
|
||||||
if (gamma <= dmin)
|
if (v <= dmin)
|
||||||
{
|
{
|
||||||
ngamma1 = ngamma2 = 0;
|
*n1 = *n2 = 0;
|
||||||
tg = 0.0;
|
*d = 0.0;
|
||||||
}
|
}
|
||||||
else if (gamma >= dmax)
|
else if (v >= dmax)
|
||||||
{
|
{
|
||||||
ngamma1 = ngamma2 = 240;
|
*n1 = *n2 = 240;
|
||||||
tg = 60.0;
|
*d = 0.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tg = 10.0 * log10(gamma / dmin);
|
double f = 40.0 * wdsp_log10 (v / dmin); // 4 * (10 * log10)
|
||||||
ngamma1 = (int)(4.0 * tg);
|
int i = (int)f;
|
||||||
ngamma2 = ngamma1 + 1;
|
/* clamp so n2 cannot address the next row of the 241x241 table */
|
||||||
|
if (i > 239) i = 239;
|
||||||
|
*n1 = i;
|
||||||
|
*n2 = i + 1;
|
||||||
|
*d = f - (double)i;
|
||||||
}
|
}
|
||||||
if (xi <= dmin)
|
}
|
||||||
|
|
||||||
|
static inline double keyLerp (const double* type, int ngamma1, int ngamma2, double dg,
|
||||||
|
int nxi1, int nxi2, double dx)
|
||||||
{
|
{
|
||||||
nxi1 = nxi2 = 0;
|
|
||||||
tx = 0.0;
|
|
||||||
}
|
|
||||||
else if (xi >= dmax)
|
|
||||||
{
|
|
||||||
nxi1 = nxi2 = 240;
|
|
||||||
tx = 60.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tx = 10.0 * log10(xi / dmin);
|
|
||||||
nxi1 = (int)(4.0 * tx);
|
|
||||||
nxi2 = nxi1 + 1;
|
|
||||||
}
|
|
||||||
dg = (tg - 0.25 * ngamma1) / 0.25;
|
|
||||||
dx = (tx - 0.25 * nxi1) / 0.25;
|
|
||||||
return (1.0 - dg) * (1.0 - dx) * type[241 * nxi1 + ngamma1]
|
return (1.0 - dg) * (1.0 - dx) * type[241 * nxi1 + ngamma1]
|
||||||
+ (1.0 - dg) * dx * type[241 * nxi2 + ngamma1]
|
+ (1.0 - dg) * dx * type[241 * nxi2 + ngamma1]
|
||||||
+ dg * (1.0 - dx) * type[241 * nxi1 + ngamma2]
|
+ dg * (1.0 - dx) * type[241 * nxi1 + ngamma2]
|
||||||
+ dg * dx * type[241 * nxi2 + ngamma2];
|
+ dg * dx * type[241 * nxi2 + ngamma2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double getKey(double* type, double gamma, double xi)
|
||||||
|
{
|
||||||
|
int ngamma1, ngamma2, nxi1, nxi2;
|
||||||
|
double dg, dx;
|
||||||
|
keyIndex (gamma, &ngamma1, &ngamma2, &dg);
|
||||||
|
keyIndex (xi, &nxi1, &nxi2, &dx);
|
||||||
|
return keyLerp (type, ngamma1, ngamma2, dg, nxi1, nxi2, dx);
|
||||||
|
}
|
||||||
|
|
||||||
int getZeta( EMNR a, double gamma, double eps, double* zeta)
|
int getZeta( EMNR a, double gamma, double eps, double* zeta)
|
||||||
{
|
{
|
||||||
int index, i_gamma, i_xi;
|
int index, i_gamma, i_xi;
|
||||||
@@ -1133,13 +1137,20 @@ void calc_gain (EMNR a)
|
|||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
double gamma, eps_hat, eps_p;
|
double gamma, eps_hat, eps_p;
|
||||||
|
int ngamma1, ngamma2, nxi1, nxi2, npi1, npi2;
|
||||||
|
double dg, dx, dp;
|
||||||
for (k = 0; k < a->g.msize; k++)
|
for (k = 0; k < a->g.msize; k++)
|
||||||
{
|
{
|
||||||
gamma = min(a->g.lambda_y[k] / a->g.lambda_d[k], a->g.gamma_max);
|
gamma = min(a->g.lambda_y[k] / a->g.lambda_d[k], a->g.gamma_max);
|
||||||
eps_hat = a->g.alpha * a->g.prev_mask[k] * a->g.prev_mask[k] * a->g.prev_gamma[k]
|
eps_hat = a->g.alpha * a->g.prev_mask[k] * a->g.prev_mask[k] * a->g.prev_gamma[k]
|
||||||
+ (1.0 - a->g.alpha) * max(gamma - 1.0, a->g.eps_floor);
|
+ (1.0 - a->g.alpha) * max(gamma - 1.0, a->g.eps_floor);
|
||||||
eps_p = eps_hat / (1.0 - a->g.q);
|
eps_p = eps_hat / (1.0 - a->g.q);
|
||||||
a->g.mask[k] = getKey(a->g.GG, gamma, eps_hat) * getKey(a->g.GGS, gamma, eps_p);
|
/* both lookups share gamma, so locate it once */
|
||||||
|
keyIndex (gamma, &ngamma1, &ngamma2, &dg);
|
||||||
|
keyIndex (eps_hat, &nxi1, &nxi2, &dx);
|
||||||
|
keyIndex (eps_p, &npi1, &npi2, &dp);
|
||||||
|
a->g.mask[k] = keyLerp (a->g.GG, ngamma1, ngamma2, dg, nxi1, nxi2, dx)
|
||||||
|
* keyLerp (a->g.GGS, ngamma1, ngamma2, dg, npi1, npi2, dp);
|
||||||
a->g.prev_gamma[k] = gamma;
|
a->g.prev_gamma[k] = gamma;
|
||||||
a->g.prev_mask[k] = a->g.mask[k];
|
a->g.prev_mask[k] = a->g.mask[k];
|
||||||
}
|
}
|
||||||
@@ -1203,18 +1214,34 @@ void xemnr (EMNR a, int pos)
|
|||||||
{
|
{
|
||||||
int i, j, k, sbuff, sbegin;
|
int i, j, k, sbuff, sbegin;
|
||||||
double g1;
|
double g1;
|
||||||
for (i = 0; i < 2 * a->bsize; i += 2)
|
/* The ring indices below advance by one per iteration and wrap at most
|
||||||
|
once per loop, so a '% size' each step is an integer division for
|
||||||
|
nothing (iasize = 3584 here, not a power of two). Walk contiguous runs
|
||||||
|
and wrap between them instead. */
|
||||||
|
const int iasize = a->iasize;
|
||||||
|
const int oasize = a->oasize;
|
||||||
|
const int fsize = a->fsize;
|
||||||
|
const int incr = a->incr;
|
||||||
|
const int bsize = a->bsize;
|
||||||
|
const int ovrlp = a->ovrlp;
|
||||||
|
|
||||||
|
for (i = 0, j = a->iainidx; i < 2 * bsize; i += 2)
|
||||||
{
|
{
|
||||||
a->inaccum[a->iainidx] = a->in[i];
|
a->inaccum[j] = a->in[i];
|
||||||
a->iainidx = (a->iainidx + 1) % a->iasize;
|
if (++j == iasize) j = 0;
|
||||||
}
|
}
|
||||||
a->nsamps += a->bsize;
|
a->iainidx = j;
|
||||||
while (a->nsamps >= a->fsize)
|
a->nsamps += bsize;
|
||||||
|
while (a->nsamps >= fsize)
|
||||||
{
|
{
|
||||||
for (i = 0, j = a->iaoutidx; i < a->fsize; i++, j = (j + 1) % a->iasize)
|
int n1 = iasize - a->iaoutidx;
|
||||||
a->forfftin[i] = a->window[i] * a->inaccum[j];
|
if (n1 > fsize) n1 = fsize;
|
||||||
a->iaoutidx = (a->iaoutidx + a->incr) % a->iasize;
|
for (i = 0; i < n1; i++)
|
||||||
a->nsamps -= a->incr;
|
a->forfftin[i] = a->window[i] * a->inaccum[a->iaoutidx + i];
|
||||||
|
for (; i < fsize; i++)
|
||||||
|
a->forfftin[i] = a->window[i] * a->inaccum[i - n1];
|
||||||
|
if ((a->iaoutidx += incr) >= iasize) a->iaoutidx -= iasize;
|
||||||
|
a->nsamps -= incr;
|
||||||
fftw_execute (a->Rfor);
|
fftw_execute (a->Rfor);
|
||||||
calc_gain(a);
|
calc_gain(a);
|
||||||
for (i = 0; i < a->msize; i++)
|
for (i = 0; i < a->msize; i++)
|
||||||
@@ -1225,30 +1252,41 @@ void xemnr (EMNR a, int pos)
|
|||||||
}
|
}
|
||||||
post2(a);
|
post2(a);
|
||||||
fftw_execute (a->Rrev);
|
fftw_execute (a->Rrev);
|
||||||
for (i = 0; i < a->fsize; i++)
|
for (i = 0; i < fsize; i++)
|
||||||
a->save[a->saveidx][i] = a->window[i] * a->revfftout[i];
|
a->save[a->saveidx][i] = a->window[i] * a->revfftout[i];
|
||||||
for (i = a->ovrlp; i > 0; i--)
|
for (i = ovrlp; i > 0; i--)
|
||||||
{
|
{
|
||||||
sbuff = (a->saveidx + i) % a->ovrlp;
|
const double* WDSP_RESTRICT sv;
|
||||||
sbegin = a->incr * (a->ovrlp - i);
|
double* WDSP_RESTRICT oa = a->outaccum;
|
||||||
for (j = sbegin, k = a->oainidx; j < a->incr + sbegin; j++, k = (k + 1) % a->oasize)
|
int m1;
|
||||||
|
sbuff = (a->saveidx + i) % ovrlp;
|
||||||
|
sbegin = incr * (ovrlp - i);
|
||||||
|
sv = a->save[sbuff] + sbegin;
|
||||||
|
m1 = oasize - a->oainidx;
|
||||||
|
if (m1 > incr) m1 = incr;
|
||||||
|
k = a->oainidx;
|
||||||
|
if (i == ovrlp)
|
||||||
{
|
{
|
||||||
if ( i == a->ovrlp)
|
for (j = 0; j < m1; j++) oa[k + j] = sv[j];
|
||||||
a->outaccum[k] = a->save[sbuff][j];
|
for (; j < incr; j++) oa[j - m1] = sv[j];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
a->outaccum[k] += a->save[sbuff][j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a->saveidx = (a->saveidx + 1) % a->ovrlp;
|
|
||||||
a->oainidx = (a->oainidx + a->incr) % a->oasize;
|
|
||||||
}
|
|
||||||
for (i = 0; i < a->bsize; i++)
|
|
||||||
{
|
{
|
||||||
a->out[2 * i + 0] = a->outaccum[a->oaoutidx];
|
for (j = 0; j < m1; j++) oa[k + j] += sv[j];
|
||||||
a->out[2 * i + 1] = 0.0;
|
for (; j < incr; j++) oa[j - m1] += sv[j];
|
||||||
a->oaoutidx = (a->oaoutidx + 1) % a->oasize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (++a->saveidx == ovrlp) a->saveidx = 0;
|
||||||
|
if ((a->oainidx += incr) >= oasize) a->oainidx -= oasize;
|
||||||
|
}
|
||||||
|
for (i = 0, k = a->oaoutidx; i < bsize; i++)
|
||||||
|
{
|
||||||
|
a->out[2 * i + 0] = a->outaccum[k];
|
||||||
|
a->out[2 * i + 1] = 0.0;
|
||||||
|
if (++k == oasize) k = 0;
|
||||||
|
}
|
||||||
|
a->oaoutidx = k;
|
||||||
|
}
|
||||||
else if (a->out != a->in)
|
else if (a->out != a->in)
|
||||||
memcpy (a->out, a->in, a->bsize * sizeof (complex));
|
memcpy (a->out, a->in, a->bsize * sizeof (complex));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ typedef struct _emnr
|
|||||||
double zetaThresh;
|
double zetaThresh;
|
||||||
double psi;
|
double psi;
|
||||||
double* nmask;
|
double* nmask;
|
||||||
|
double* csum; // prefix sums of mask[], msize + 1 entries
|
||||||
double t2;
|
double t2;
|
||||||
} ae;
|
} ae;
|
||||||
struct _post2
|
struct _post2
|
||||||
|
|||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
/* fastmath.h
|
||||||
|
|
||||||
|
This file is part of a program that implements a Software-Defined Radio.
|
||||||
|
|
||||||
|
Copyright (C) 2013, 2024, 2025 Warren Pratt, NR0V
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
The author can be reached by email at
|
||||||
|
|
||||||
|
warren@wpratt.com
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _fastmath_h
|
||||||
|
#define _fastmath_h
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
/* log10 for strictly positive, finite, normal arguments; about 2.4x the
|
||||||
|
throughput of libm's.
|
||||||
|
|
||||||
|
Accurate to within 2.0e-13 absolute over (0, 1], which is far tighter than
|
||||||
|
mlog10() in meterlog10.c (2.1e-4 absolute -- a 2048-entry table with no
|
||||||
|
interpolation). That table is fine for driving a dB meter display, but too
|
||||||
|
coarse where the result feeds arithmetic rather than a readout.
|
||||||
|
|
||||||
|
Caller must guarantee x > 0 and normal. Zero, negatives, denormals,
|
||||||
|
infinities and NaN are not handled. */
|
||||||
|
static inline double wdsp_log10 (double x)
|
||||||
|
{
|
||||||
|
uint64_t bits;
|
||||||
|
double m, s, s2, p;
|
||||||
|
int e;
|
||||||
|
|
||||||
|
memcpy (&bits, &x, sizeof (bits));
|
||||||
|
e = (int)((bits >> 52) & 0x7FF) - 1023;
|
||||||
|
/* clear the exponent field, leaving the mantissa in [1, 2) */
|
||||||
|
bits = (bits & 0x000FFFFFFFFFFFFFULL) | 0x3FF0000000000000ULL;
|
||||||
|
memcpy (&m, &bits, sizeof (m));
|
||||||
|
|
||||||
|
/* Recentre onto [sqrt(1/2), sqrt(2)) so the series stays in its
|
||||||
|
fast-converging range; |s| <= 0.1716 afterwards. */
|
||||||
|
if (m > 1.4142135623730951)
|
||||||
|
{
|
||||||
|
m *= 0.5;
|
||||||
|
e += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* log(m) = 2 * atanh(s), s = (m-1)/(m+1) */
|
||||||
|
s = (m - 1.0) / (m + 1.0);
|
||||||
|
s2 = s * s;
|
||||||
|
p = 2.0 * (s + s * s2 * (3.3333333333333331e-01 + s2 * (2.0000000000000001e-01
|
||||||
|
+ s2 * (1.4285714285714285e-01 + s2 * (1.1111111111111110e-01
|
||||||
|
+ s2 * (9.0909090909090912e-02 + s2 * 7.6923076923076927e-02))))));
|
||||||
|
|
||||||
|
/* log10(x) = (log(m) + e * ln2) / ln10 */
|
||||||
|
return (p + (double)e * 6.9314718055994531e-01) * 4.3429448190325182e-01;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user