##-*- org -*-->  Emacs .. [Tab] key + [Org] menu; C-c C-o to follow links

* TODO Provide R functions interfacing to the "applied math utilities" in  ./src/DPQ-misc.c
* TODO pbeta() approximations notably for log scale where bpser underflows to -Inf <<<<<<<<<<<
* TODO tests/pnt-precision-problem.R : *label* the 391 plots: tests/pnt-precision-2.pdf
* TODO Compare pnchi1sq() with t1() function in tests/chisq-nonc-ex.R
* DONE in R >= 4.0.0, now .Machine has 10 "longdouble.*" components (when the configuration found long double)
  Note that from `#include <float.h>` we should just return the `LDBL_*` values.
* TODO tests/chisq-nonc-ex.R : move "things" to a vignette -- DONE partly : vignettes/Noncentral-Chisq.Rnw
* TODO tests/qbeta-dist.R    : move "things" to a vignette
* TODO vignettes/comp-beta.Rnw: change to use same 'jss' * \cite*{} etc as ~/R/Pkgs/lme4/vignettes/lme4.Rnw
* TODO b_chi(): Now have higher order asymptotic expansion *and* confirmed via Rmpfr that it is
  much better than internal b2(), we should use its higher order
  down to ~200 and completely "drop" b2() and redefine an optimal c1.
  see R/t-nonc-fn.R and notably man/b_chi.Rd
** TODO in R/t-nonc-fn.R : also have c_dt() etc, based on lb_chi() which needs to be defined,
  using lb_chiAsymp(nu, order) vs lb_chi0() switch()ing depending on
  desired precision (dblpr *and* "mpfr") and nu itself
* TODO t-distributions (notably *noncentral*, "pnt" etc):
* TODO tests/pnt-prec.R : some parts only if(doExtras)
** TODO extract some useful functions from our tests/pnt-prec.R
** TODO extract functions (and "tests") from ~/R/MM/NUMERICS/dpq-functions/dt-ex.R
** TODO extract fns & tests   from ~/R/MM/NUMERICS/dpq-functions/pt-ex.R
** TODO extract fns & tests   from ~/R/MM/NUMERICS/dpq-functions/qt-ex.R

** TODO: Implement Chattamvelli, R. and Shanmugam, R. (1994) --> pntChShP94()
   ~/save/papers/Numerics/Chattamvelli+Sh_noncentr-t_1994.pdf
   Chattamvelli, R. and Shanmugam, R. (1994)
   An enhanced algorithm for noncentral T-distribution
   \emph{Journal of Statistical Computation and Simulation} \bold{49}, 77--83
   \doi{10.1080/00949659408811561}
* TODO chisq-Wienergerm approximations: >>>>> ./wienergerm_README <<<<<<<<<
** TODO move C code to here
** TODO Find documentation / papers ==> for help pages about h() and g() in R/wienergerm_nchisq-fn.R
* TODO non-central beta (AS 310): more experiments (cf with R's older algo) --> R/pnbeta.R
* TODO src/qchisq_appr.c / init.c : change to .Call() version which vectorizes in both args
* TODO tests/qbeta-dist.R : Demonstrates clear *bug* in R's qbeta() incl 'NOTIFY R-core!'

* TODO tests/qbeta-dist.R (2): Shows how to compute  log(p*Beta(p,q)) accurately for p << q  very nice plots <=??=> Qab(), algdiv()??

* TODO tests/qPoisBinom-ex.R:  *FIX* Bug in qpois / qbinom / qnbinom upper.tail|log.p

* DONE ~/R/MM/NUMERICS/dpq-functions/dbinom_raw.R also has dnbinom.mu() ==> provide also dnbinomR()

* DONE tests/chisq-nonc-ex.R : use result file in inst/safe/  -- parts only if(doExtras)
* DONE tests/qbeta-dist.R    : use result file in inst/safe/  -- parts only if(doExtras)
* DONE tests/qgamma-ex.R     : some parts only if(doExtras)
* DONE ppoisErr() should use 'long double'; get an 'all_from_0' option that works like cumsum(dpois(0:n))
* DONE Document these (or do _not_ export):  now --> man/pnchisqWienergerm.Rd
  NB <--> ./wienergerm_README <<< ./R/wienergerm_nchisq-fn.R ./tests/wienergerm_nchisq.R
 ‘g2’ ‘gnt’ ‘h’ ‘h0’ ‘h1’ ‘h2’ ‘hnt’ ‘newton’ ‘p.dnchiB’ ‘ss’ ‘ss2’ ‘ss2.’
* DONE Rename 'err.lambd*()' to 'ppoisErr*()';  put on same help page as ppoisD(); further
** DONE : only when verbose=TRUE, they still print
* DONE lbeta.n(), lbeta.asy() .. __rename__;  add the two  *Qab*() functions to help page  man/lbeta.Rd
* DONE qnormU*(): is "upper tail" qnorm ==>  use default arg  lower.tail=FALSE (but keep log.p=FALSE)
* DONE s() is too short, not ok.  Maybe s_() or s.() ? --> using sW() now
* DONE qchisq.appr.R() in R/qgamma-fn.R and qchisq.appr.Kind() are almost identical:
  kept qchisq.appr.R(), renamed to qchisqAppr.R(); the *.R() version is vectorized and used in qgamma.R()
* DONE dcdflib -- ===> made into separate package (part of same R-forge project 'specfun')
