New R functions
Vectorize()d versions of
qtR() <- Vectorize(qntR1, *); pure R
implementation of R's Mathlib C-level
qt(), but additionally
allowing tweaks, used for fixing R's bug PR#18630.
Added (optional) log-scale Newton steps via
logNewton = log.p,
needing more tests.
qtNappr() – from the remark in R's ‘nmath/qt.c’
about very large
df approximation, now with all 4 large-df terms
from Abramowitz & Stegun's (26.7.5).
gammaVer() to exemplify R's (partly historical)
providing the 6 coefficients-approximation of A. & S. to
qnormR() gets new
version = "2022-08-04" which
uses MM's newly derived asymptotic approximations to
qnormAsymp() providing new asymptotic approximations
Added vignette “Asymptotic Tail Formulas for Gaussian Quantiles”.
chebychevPoly() (and auxiliaries) for evaluation
of Chebyshev polynomials.
qbetaAppr() (and the
auxiliaries) now get a
qbeta.Appr*() functions now accept a
lower.tail argument (with default
New R function
dpsifn(), as interface to R's C API
dpsifn(), the workhorse of all R's
dpois_raw(x, lambda, *) gets new cutoff
to not use
x is much
Simple functions, mostly for didactical and comparison purposes,
stirlerr_simpl(), all of which use the “simple” direct
formula which leads to numerical cancellation typically.
New R function
bpser() interfacing to the C function of
the same in R's Mathlib
bratio() in file
Updated URL of Abramowitz & Stegun.
\ escape in one ‘man/*.Rd’
Our ‘tests/*.R’ no longer rely on the Matrix ‘test-tools.R’ collection but rather use our own.
In ‘tests/chisq-nonc-ex.R’ (and ‘DESCRIPTION’), we've replaced akima by interp as the latter has a FOSS licence.
bd0(x, np, delta, ..) now uses
if (|x-np| <= delta * (x+np)) (less-equal instead of strictly
less), and hence setting
delta = 0 is now allowed, using the
series expansion only for
x == np, useful e.g., for the case
of highly accurate mpfr-numbers.
log1pmx(x, .., eps2, ..),
eps2 = 0 is now allowed.
* e coming last ("bug" did not show ..).
okLongDouble() should no longer fail on M1 mac.
ebd0C() now checking
|yl| < 5.5 before returning; was
horrendously wrong on Windows compiled with
-mnative as long
as it included (the default)
-mfma (FMA:= Fused-Multiply-Add).
rchk issue: "need"
PROTECT(.) while calling allocating
ebd0C() interface to C version; helps to fix
lapsus in pure R version
ebd0(x, M) for large
M now checks for overflow in
M/x, and notably the case
f * 2^-(e+10) =: fg == Inf.
bd0() work around underflow of
new R functions
ldexp() for getting
and setting base-2 representations of numbers,
and new R function
modf() to split number into integer and fractional part,
all interfacing the C99 (math lib) standard functions of the same name.
logcfR.(x) has been “vectorized” in
though it's iterative with different number of iterations for each
x[i], and is hence considerably faster when
x is an
TODO: Consider renaming the two logcfR versions; at least neither is deprecated!
fixed embarrassing typo (two
i's) bug in
stirlerr(n) now also works when
n is large enough for
n * n to overflow (to
fix typo/thinko in
logcfR(*, trace=TRUE) iteration report.
dpois_raw(x, *) now works up to maximal
preventing overflow in previous
dnbinom.mu() fix for
log=TRUE, notably for
x >> size.
bd0_*() versions of
bd0(), based mainly on
To be more modular, our ‘test-tools.R’ no longer
source() those of Matrix.
‘src/bd0.c’ gave warning with some compiler settings with
readRDS_() thinko fixed.
Provide R functions
all interfacing to R's C API (‘Rmath.h’), aka ‘Rmathlib’.
pnormAsymp() for asymptotic (typically upper tail,
log scale) approximation of
pnorm(). With Rmpfr, we
can see how accurate these are in detail.
dnbinomR() finding better code for R itself,
dbinom_raw(); also new utility
stirlerr(), both vectorized,
and also working with "mpfr"-numbers, such that
now does so, too.
Additionally, an “extended” version of
ebd0() in pure R, where a C version was proposed by Morten
Welinder in R's bugzilla, PR#15628.
Experimentally, also provide
p1l1() and its Taylor series
p1l1ser() which could be employed for
ebd0() instead of the current algorithms.
Several C level utilities to be .Call()ed from R, from R's
frexp() even from C math.
Pure R implementations (somewhat experimental) of corresponding
R Mathlib C functions:
each with several tuning parameters for the underlying algorithm,
notably the root-finding parts.
logcf() now based on C code, perfectly
vectorizes; the pure R version, now called
currently still runs the iterations simultaneously for all 'x[i]' and
hence convergence and rescaling happen by “group decision”,
efficiently but undesirable for strict comparisons.
logcfR(x, *) and
log1pmx(x, *) now also work for
log1pmx() gets optional
eps2 = 1e-2 and
minL1 = -0.791 arguments, the defaults
of which may change, as I think at least the latter to not be
lb_chiAsymp(nu, order) works up to order 8.
Provide the first parts of a new vignette
stirlerr(), which should contain part of
Loader(2000)'s report and new findings of improved
(mathematically proven) lower and upper bound to
notably also for investigation with
qnormR(), implementing current R's
pure R, notably with
Reorganize tests; notably to become less platform dependent.
phyper*() functions and helpers for them, such
as Bernoulli numbers
Bern() and asymptotic
phyperR2() which is a pure R version of R's
own (C code based)
pnbetaAS310() gained a
okLongDouble() function, notably for detecting that
valgrinded version of R,
long double C
arithmetic seems to silently switch to (simple)
long double printing from C now should happen correctly on all platforms including 32- and 64-bit Windows.
more efficient (internally vectorized)
dntJKBf1() is deprecated now.
pntR1()) get new option
use.pnorm (the default of which had been hard coded previously).
fix thinko in
pnchisqRC()'s C code gave severe valgrind warnings;
fixed printing of
long double etc;
also added special MinGW deal in Windows.
ppoisD() behaves differently in a valgrinded version;
for now, reproducible only when using valgrind on non-valgrinded
Renamed (and generalized / merged) many functions to have less "." in names.
pnbetaAS310() function interfacing to my
corrected C version of 'ASA 310' (2007).
algdiv() function interfacing to the 'TOMS 708' version of
pl2curves() which generalizes (somewhat) previous
newton() more flexible with new
xMax arguments which are notably useful for
(quantile function) computations.
Correspondingly replaced previous
qchisqA() with new
pnchisqRC(), a version of R's C level non-central
chi-squared, with additional options.
pnchisqT93() (plus its two auxiliaries),
implementing Temme(1993)'s approximations.
implementing Bol'shev and Kuznetzov (1963)'s approximations.
“exact” formulas for the special cases
simplified formula in
qnchisqPearson(pp, df=DF, ncp=100) and
qnchisqSankaran_d(*) no longer return
NaN for very
DF = 1e200.
pnchisq() now also has default
verbose = 0 as all
other such functions with
Move many of my up to 15 years old DPQ computation utilities into a package, to become public, “bloggable”, etc.