% Copyright (c) 2013, Avraham Adler All rights reserved
% SPDX-License-Identifier: BSD-2-Clause

\name{NEWS}
\alias{NEWS}
\title{NEWS file for the Delaporte package}

\section{Version 9.0.0 (2026-08-23)}{
While there are breaking changes below, the majority of them would not have been
encountered in normal practice. Most users should see no change to results,
other than increased speed and fewer failures.
  \subsection{Fixed}{
    \itemize{
      \item \strong{Breaking:} Internal function \code{log1p} now carries a
      cubic Taylor term. The prior quadratic form left a truncation error of
      order \eqn{\frac{\beta^3}{3}}{beta^3 / 3}. For large \eqn{\alpha} with
      very small \eqn{\beta} this reached the sixth significant figure of
      ordinary probabilities. Results for \eqn{\beta > 10^{-4}}{beta > 1e-4} are
      bitwise-unchanged.
      
      \item \strong{Breaking:} Non-finite parameters now return \code{NaN} with
      a warning across \code{d/p/q/rdelap} instead of clamp-laundered 0s and 1s.
      
      \item \strong{Breaking:} \code{ddelap}, \code{pdelap}, \code{qdelap}, and
      \code{rdelap} with singleton parameters now first attempt to build their
      \acronym{PMF} and \acronym{CDF} tables using a three-term recurrence
      relationship derived from the Delaporte distribution's probability
      generating function. This takes \eqn{O(K)} arithmetic operations instead
      of \eqn{O(K^2)} \code{log_gamma}/\code{exp} evaluations. Masses whose
      leading term underflows---roughly \eqn{\lambda + \alpha\log(1+\beta) >
      745}---are handled by internal rescaling, allowing accuracy to be retained
      for very large \eqn{\lambda}. This is done natively in linear- or
      log-space as per the call. This may shift results relative to the old
      \dQuote{always sum} algorithm at the level of accumulated rounding: one or
      two \acronym{ulp}s for short tables, growing with table length to roughly
      the 13th significant digit for very long ones. Both parameters extreme
      enough to risk overflow in the recurrence fall back to the summation
      algorithm and vector-valued parameters continue to use the per-element
      path.

      \item \strong{Breaking:} \code{ddelap} and \code{pdelap} now treat
      arguments below the support the same way base \R does. \code{ddelap}
      returns \code{0} (\code{-Inf} with \code{log = TRUE}) and \code{pdelap}
      returns a lower-tail \acronym{CDF} of \code{0} and a survival of \code{1}.
      Previously these inputs returned \code{NaN} with a \dQuote{NaNs produced}
      warning.
      
      \item \strong{Breaking:} \code{ddelap}'s internal summand formula
      subtracted \eqn{\lambda} from its running sum before a large canceling
      pair, \eqn{\log\Gamma(\alpha + i) - \log\Gamma(\alpha)}{lgamma(alpha+i) -
      lgamma(alpha)} (exactly \eqn{0} at \eqn{i = 0}), had resolved. When
      \eqn{\alpha} is very small, \eqn{\log\Gamma(\alpha)}{lgamma(alpha)} is
      itself large, and \eqn{\lambda}, when smaller than that intermediate
      value's rounding unit, was silently discarded before the cancellation
      completed. This was invisible with \code{log = FALSE}, since \code{exp()}
      of the resulting error and \code{exp(0) = 1} are both indistinguishable in
      linear-space double precision at the affected magnitudes. Parenthesizing
      the canceling pair so it resolves first fixes both the log-space and
      linear-space summand formulas. Ordinary (non-degenerate) parameters are
      bitwise-unchanged.
    
      \item \strong{Breaking:} \code{ddelap} with \code{log = TRUE} now
      accumulates the PMF in log space using a streaming log-sum-exp instead of
      taking the log of the linear-space result. This is technically breaking
      as deep-tail log-probabilities which previously returned \code{-Inf}
      because the linear PMF underflowed below the smallest representable double
      are now accurate to near full precision. For example,
      \code{ddelap(2000, 1, 1, 1, log = TRUE)} returns approximately -1385.99
      instead of \code{-Inf}. Hoisting the variables for both log and normal
      space routines makes them slightly faster than before.
      
      \item \strong{Breaking:} \code{pdelap} with \code{lower.tail = FALSE} now
      computes the upper tail by direct summation of the PMF when doing so is
      needed to preserve accuracy, instead of \eqn{1 - \textrm{CDF}}. Survival
      probabilities near or below machine epsilon previously returned only
      floating-point rounding noise. For example, 
      \code{pdelap(60, 1, 1, 1, lower.tail = FALSE)} returned roughly 3.3e-16
      when the true value is roughly 1.18e-18. The algorithms are now accurate
      to near full double precision. This is technically breaking, but users
      should see no change outside of the deep tail which was likely not of
      interest to most. This summation is used only once the survival
      probability is small enough that the ordinary complement
      \eqn{1 - \textrm{CDF}} would lose meaningful precision: below
      \eqn{\sqrt{\epsilon} \approx 1.49 \times 10^{-8}}{sqrt(EPS) ~ 1.49e-8}.
      Since the summation's remainder-bound safeguard gives it an
      \eqn{O(\beta^2)}{O(beta^2)} worst-case cost, it is reserved for where it
      is genuinely needed.
      
      \item \strong{Breaking:} \code{pdelap} with \code{log.p = TRUE} previously
      computed the linear-space CDF/survival first and took \code{log()} of the
      result, so any value that underflowed to exactly 0 in the deep tail
      silently returned \code{-Inf} even though the true log-probability is
      finite. \code{log.p = TRUE} is now computed directly in log space
      throughout, matching the log-space guarantee
      \code{ddelap(..., log = TRUE)} already provides, and is accurate to near
      full double precision even where the linear-space value underflows.
      \code{pdelap} derives log-probabilities in the saturated bands---log-CDF
      values within about \code{sqrt(.Machine$double.eps)} of \eqn{0}, and their
      log-survival mirror---from the opposite, relatively accurate side via
      \code{log1p(-exp(.))} rather than reporting the accumulation's own
      rounding noise. On the log scale those values now agree with an
      independent \code{\link[stats:NegBinomial]{dnbinom}}\eqn{\ast}{*}
      \code{\link[stats:Poisson]{dpois}} convolution oracle to about
      \code{1e-13} relative. In linear space, the original algorithm was already
      accurate to an \acronym{ulp}, so linear-scale results are unaffected, as
      is everything outside the bands. All three computational
      routes---recurrence table, degenerate-ratio elemental fill, and
      vector-parameter recycling---apply the same repair. A consequence is
      that \code{qdelap}/\code{pdelap} round trips with \code{log.p = TRUE} are
      now exact in both tails wherever the input is representable.
      
      \item \strong{Breaking:} \code{qdelap} for probabilities within
      accumulated rounding of \eqn{1} combined with highly overdispersed
      parameters previously ground its lookup-table build indefinitely,
      as the cumulative sum plateaus below such targets no matter how far it
      extends. These targets are now resolved from the accurate upper-tail
      survival table, returning the true finite quantile instantly.
      For example, \code{qdelap(1 - 1e-12, 5, 5, 7000)} now returns \code{7630}.
      Ordinary probabilities are unaffected.
      
      \item \strong{Breaking:} \code{qdelap} with \code{lower.tail = FALSE}
      and/or \code{log.p = TRUE} now searches in the native space of the
      supplied probabilities instead of transforming them to linear
      lower-tail space first. The old \code{1 - p} flip collapsed survival
      probabilities below machine epsilon to exactly \code{1}, returning
      \code{Inf} where \code{\link[stats:Poisson]{qpois}} resolves a finite
      quantile, and the old \code{exp()} of log-probabilities collapsed deep
      log-space targets the same way; near-1 targets were inflated by an
      \acronym{ulp}, stepping round-tripped quantiles up by one. Upper-tail
      targets are now searched against a survival table built as \code{pdelap},
      and log-space targets against log-probability tables accumulated by
      streaming log-sum-exp. The default (\code{lower.tail = TRUE},
      \code{log.p = FALSE}) path is bitwise-unchanged. Interior search targets
      carry one-sided tolerances sized to their measured noise sources, in the
      spirit of base \R's \code{64 * EPS} fuzz in \file{qpois.c}. The
      vector-parameter path retains base \R's fuzz verbatim.
      
      \item \strong{Breaking:} \code{qdelap} no longer hangs when passed extreme
      parameter sets whose quantiles are computationally unreachable. The
      original explicit-summation algorithm, now used when the recurrence table
      would overflow, costs \eqn{O(\textrm{answer}^2)}{O(answer^2)}. Past
      \eqn{2^{15}}{2^15} summation steps \code{qdelap} now returns
      \code{NaN} for the unresolved targets with the warning
      \dQuote{quantile too large to compute exactly for these parameter
      values; NaN returned}, as a truncated cumulative sum carries no
      information about a quantile beyond it. The parameter sets involved
      generally put the true quantile beyond \eqn{2^{53}}{2^53}, where a count
      is no longer exactly representable as a double in any case. Targets the
      partial sum \emph{did} resolve, including the \eqn{p = 0} and \eqn{p = 1}
      boundaries, still return normally.
      
      \item \strong{Breaking:} The approximate form of \code{qdelap}, which has
      much less utility now (see documentation), will always generate at least
      10,000 variates for pooling. It remains capped at no more than 10M
      variates. Prior behavior for pathologically tiny means (~1e-12) could have
      resulted in no variants being generated and an NA return.
      
      \item \strong{Breaking:} The approximate form of \code{qdelap} now
      pre-allocates the result vector at full length first and then assigns the
      \code{NaN}, \code{Inf}, 0, or proper value for each category. This ensures
      that element \code{i} of the output always corresponds to element \code{i}
      of the input. Previously, the return may have scrambled the "valid" inputs
      if there were non-valid values in the input.
      
      \item For \eqn{x \geq 2^{63}}, including +\code{Inf}, the functions no
      longer convert \code{x} to an integer kind which it then overflows.
      Instead, they return 0 or \code{-Inf} directly.

      \item Zero-length parameters now return zero-length results in
      \code{p/d/qdelap} per base \R. This is not considered breaking as it used
      to fail with a segfault from Fortran.
      
      \item Zero-length parameters in \code{rdelap} now return \code{NaN}s per
      base \R. This is not considered breaking as it used to fail with a
      segfault from Fortran.
      
      \item \code{qdelap} and \code{rdelap} with a \code{NaN} scalar parameter
      previously looped indefinitely while consuming memory. Now they return
      \code{NaN} with a warning, matching \code{pdelap}.
      
      \item Prevented \code{qdelap} from overwriting passed \code{p} vector
      within Fortran, preserving the \code{.Call} contract.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item \strong{Breaking:} Both the exact and approximate versions of
      \code{qdelap} now return \code{NaN} with a warning for probabilities
      strictly greater than one, following base \R convention. The function
      returns \code{Inf} only for probabilities exactly equal to one.
      Prior behavior was that all probabilities \eqn{\ge 1} returned \code{Inf}.
      
      \item \strong{Breaking:} \code{setDelapThreads} no longer calls
      \code{omp_set_num_threads}, and \code{getDelapThreads} no longer calls
      \code{omp_get_max_threads}. The thread count is package-local and is
      passed to each parallelized routine, whose \code{num_threads} clauses
      already scope it per region. Process-global OpenMP state is never
      modified, so \pkg{Delaporte} neither affects nor is affected by the
      threading of other OpenMP-using packages. On load, the count is seeded
      from the OpenMP runtime default, which respects \env{OMP_NUM_THREADS} and
      \env{OMP_THREAD_LIMIT}.
      
      \item As the singleton-parameter \acronym{CDF} build is no longer
      quadratic, the maximum \code{q} for \code{pdelap}'s fast path was
      raised from \eqn{2^{14}} to \eqn{2^{24}}, and the interactive
      confirmation prompt now guards only the genuinely slow routes:
      vector-valued parameters with \code{q} at or above \eqn{2^{15}}, or any
      \code{q} at or above \eqn{2^{24}}. When not interactive, \code{pdelap}
      checks the new (and undocumented) \code{Delaporte.maxq} option in the
      local environment and stops if the largest value exceeds the option or
      warns if it does not. The default value is \eqn{2^{15}}.
      
      \item Changing \code{qdelap} to use the lookup table most of the time
      \code{exact = TRUE} makes it orders of magnitude faster than
      \code{exact = FALSE} for essentially all practical parameter ranges.
      The only time where \code{exact = FALSE} may still be worth considering is
      when the expected table length, \eqn{K = \alpha\beta + \lambda +
      10\sqrt{\alpha\beta(1+\beta) + \lambda}}, exceeds roughly \eqn{1.5\times
      10^{7}}{1.5e7}. Beyond that point, the exact path's memory use of ~17
      bytes per unit of \eqn{K} begins to exceed the bounded ~330MB/2.5s cost of
      the Monte Carlo approximation. The table size \eqn{K} depends on the
      distribution's dispersion, not just its mean. A low mean with a high
      overdispersion can require as large a table as a much larger,
      near-Poisson mean. The \code{exact = FALSE} remains unavailable for
      vector-valued parameters regardless of this threshold, as approximate
      quantiles cannot be pooled across distinct parameter triplets.
      
      \item \code{qdelap} and \code{rdelap} with singleton parameters now size
      their quantile lookup table from a moment-based estimate and grow it
      geometrically, replacing element-by-element growth whose copying was
      \eqn{O(K^2)}. The table is built with the identical routine and
      accumulation order as \code{pdelap}, so the \code{qdelap(pdelap(k)) == k}
      round trip is preserved bitwise. They now also locate quantiles in the
      sorted CDF vector by a binary search instead of a linear scan.
      
      \item \code{MoMdelap} now checks that at least 3 values are passed to it,
      none of which are \code{NA}, otherwise it will error. This is not
      considered breaking as it used to fail with a different error which
      propagated from Fortran (missing value where TRUE/FALSE needed). Now it
      never triggers a Fortran call.
      
      \item Cleaned \file{Makevars} from unneeded calls to \acronym{BLAS} and
      \acronym{LAPACK} libraries.
      
      \item The guidance added to Writing \R Extensions in r88406 is better
      adhered to by storing the package-specific state (the thread count and
      detected \acronym{CPU} count) in an environment inside the \emph{package}
      namespace. The environment is no longer created in the user's workspace,
      and is no longer exported.
      
      \item Refactored C and Fortran sources to be more manageable using header
      files, splitting initialization from active function calls, hardening with
      explicit "only" lists on the Fortran side, removing unnecessary includes,
      and using the modern bind(C) interface to call back-and-forth between C
      and Fortran instead of the older F77 idiom.
      
      \item The manual now documents the package's accuracy limits at the
      representation edges: the context dependence of \code{lower.tail =
      FALSE} values at the level of their accumulated rounding, the
      \eqn{\pm 1}{+/-1} round-trip shoulder for survival targets within about
      \code{sqrt(.Machine$double.eps)} of \eqn{1}, the linear-space
      convention (and consequent deep-tail saturation) of vector-parameter
      \code{qdelap}, and the cost profile of deep upper-tail log-scale
      quantiles at high dispersion.
      
      \item Updated unit tests and documentation for the changes and fixed a
      number of spelling and grammar mistakes.
    }
  }
  \subsection{Removed}{
    \itemize{
      \item \strong{Breaking:} The \code{sOMPT_C} function and entry point was
      removed, including its \code{R_RegisterCCallable} registration, as were
      the \code{.onDetach} thread reset and its Fortran backend \code{sOMPT_f}.
      
      \item \strong{Breaking:} \env{DelaporteEnv} is no longer exported.
    }
  }
}

\section{Version 8.4.3 (2026-01-08)}{
  \subsection{Fixed}{
    \itemize{
      \item Corrected improper link in \file{SECURITY.md}.
      \item Other spelling errors corrected.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item Changes related to Github workflows and requirements.
      \item Minor tweaks to \R and Fortran code. No change to calculations.
    }
  }
}

\section{Version 8.4.2 (2025-07-17)}{
  \subsection{Fixed}{
    \itemize{
      \item Corrected package metadata unit tests and switched \code{sapply} to
      \code{vapply} for type safety.
      \item Updated Github action YAMLs.
      \item Updated \file{NEWS} markup.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item Switched \dQuote{max cpu} holding variable location from
      \code{options} to an environment variable per \R commit 88406 by Brian
      Ripley.
      \item Converted some architecture-specific tests to use looser tolerances
      based on Tomas Kalibera's
      \href{https://blog.r-project.org/2025/04/24/sensitivity-to-c-math-library-and-mingw-w64-v12/}{
      blog post}.
      \item Made checks of the \code{lt} and \code{lg} variables passed to
      Fortran from C to be against \code{c_int} variables, which they should be.
    }
  }
}

\section{Version 8.4.1 (2024-06-17)}{
  \subsection{Changed}{
    \itemize{
      \item Testing for \code{NaN} within Fortran now more efficient.
      \item Other changes to C and Fortran code for efficiency and readability.
      \item Added package metadata tests.
      \item Set up new version of \pkg{rhub} checking.
      \item Use native \acronym{CRAN} \acronym{DOI}.
    }
  }
}

\section{Version 8.4.0 (2024-04-04)}{
  \subsection{Changed}{
    \itemize{
      \item \code{qdelap} now automatically calls the \code{exact = TRUE}
      version when passed inappropriate parameters instead of just stopping with
      an error.
      \item Refactor \file{README.md} into component \acronym{MD} files for
      Github purposes.
      \item Capture and restore original thread count after running tests.
      \item Efficiency tweaks to underlying Fortran code.
    }
  }
}

\section{Version 8.3.0 (2023-10-02)}{
  \subsection{Changed}{
    \itemize{
      \item Converted \code{log1p} implementation to one based on its Taylor
      sequence, instead of catastrophic substitution elimination, as some
      compilers may optimize out that subtraction. Since any difference in
      result should be at machine precision or lower, this is considered a
      minor update.
      \item Removed \code{back} keyword from \code{minloc} call in the Fortran
      implementation of \code{qdelap}. Technically unneeded since its value is
      the default \code{FALSE}. This allows for systems with an only partial
      implementation of Fortran 2008 to compile (see
      \href{https://github.com/aadler/Delaporte/issues/3}{Issue 3} and thanks to
      \href{https://github.com/dpascall}{David Pascall}).
      \item Correct error message of \code{setDelapThreads} to reflect that
      setting thread count to 0 is also an error. Functionality has not changed.
      \item Removed unnecessary explicit check for \code{NaN} in \code{qdelap}
      as it will be covered by check using \code{anyNA}.
      \item Tweaked documentation for clarity.
    }
  }
  \subsection{Added}{
    \itemize{
      \item Added unit test for new \code{log1p} function.
      \item Added \code{LTO_OPT} and \code{LTO_FC_OPT} flags to \file{Makevars}.
    }
  }
}

\section{Version 8.2.0 (2023-08-08)}{
  \subsection{Added}{
    \itemize{
      \item Added \code{getDelapThreads} and \code{setDelapThreads} to
      explicitly control OpenMP thread usage based on
      \href{https://cran.r-project.org/doc/manuals/R-exts.html#OpenMP-support}{
      WRE 1.2.1.1}.
      \item Added \pkg{parallel} as an import for \code{detectCores}.
      \item Added \acronym{SPDX} header to more files.
      \item Added more unit tests.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item Changed Fortran suffix to \code{.f90} for better compatibility with
      the Intel Fortran compiler, per \acronym{CRAN}.
      \item Tweaked minor linting and documentation issues.
      \item Explicitly enumerated exports instead of using wide-ranging regex.
    }
  }
}

\section{Version 8.1.1 (2023-06-19)}{
  \subsection{Changed}{
    \itemize{
      \item Removed \code{-std=f2008} on the advice of Professor Ripley.
    }
  }
}

\section{Version 8.1.0 (2023-02-01)}{
  \subsection{Changed}{
    \itemize{
      \item Fortran source code now reliant on Fortran 2008.
      \item Fortran module \code{ieee_arithmetic} used.
      \item Updated help documentation.
      \item Updated Github actions.
      \item Updated internal code to be more compliant with personal style guide.
      \item Updated \file{CITATION} to use \code{bibentry} per \acronym{CRAN}
      request.
    }
  }
  \subsection{Removed}{
    \itemize{
      \item \code{gamln} replaced with Fortran 2008 \code{log_gamma}.
      \item \code{position} replaced with Fortran \code{minloc}.
      \item The \code{set_nan} and \code{set_inf} procedures were replaced with
      \code{ieee_arithmetic} calls.
      \item Checks for \code{NaN} now use \code{ieee_arithmetic} calls.
    }
  }
}

\section{Version 8.0.3 (2022-09-05)}{
  \subsection{Changed}{
    \itemize{
      \item Updated package with information necessary to achieve
      \acronym{OpenSSF} silver status.
    }
  }
}

\section{Version 8.0.2 (2021-01-20)}{
  \subsection{Changed}{
    \itemize{
      \item Converted unit testing framework to \pkg{tinytest} to reduce
      dependencies.
      \item Augmented citation with \acronym{DOI} and \acronym{CFF} file.
    }
  }
  \subsection{Fixed}{
    \itemize{
      \item Corrected help file.
    }
  }
}

\section{Version 8.0.1 (2021-01-10)}{
  \subsection{Removed}{
    \itemize{
      \item Removed \acronym{SIMD} calls added in 8.0.0 due to Solaris.
      \item Removed \acronym{LTO} mentions from Makevars added in 8.0.0 per
      Brian Ripley.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item Pass more \R-consistent error messages.
      \item Made more robust to improper inputs such as negative, \code{NA}, or
      \code{NaN} parameters or passed values.
      \item \R versions of \code{qdelap} and \code{rdelap} behave more like the
      Fortran versions.
    }
  }
}

\section{Version 8.0.0 (2021-01-05) [YANKED]}{
  \subsection{Changed}{
    \itemize{
      \item Exact code more in line with \R defaults for d/p/q/r functions in
      that \code{NaN} inputs return \code{NaN} outputs.
      \item Handling of \code{Inf} and \code{-Inf} now more in line with \R
      defaults for d/p/q/r functions.
      \item Parameter errors now check for \eqn{< 0} instead of \code{< EPS}.
      \item \code{ddelap} and \code{pdelap} now use 8-byte integers
      (\acronym{INT64}) for their counters which allows calculation for values
      up to \eqn{2^{63}}{2^63}.
      \itemize{
        \item \code{ddelap} will return 0 for all values \eqn{> 2^{63}}{> 2^63}
        under the assumption that the \acronym{PMF} is spread too thinly.
        \item \code{pdelap} will not run for values \eqn{> 2^{63}}{> 2^63}.
        \item \code{ddelap} of \code{Inf} returns 0 and \code{pdelap} of
        \code{Inf} returns 1.
      }
      \item \code{pdelap} gives a warning for finite values
      \eqn{> 2^{15}}{> 2^15} as, depending on the parameters, this may take
      hours to finish (it's a double summation!). The user has to respond with
      \kbd{y} to continue.
      \item Updated help and tests.
      \item Allow compiler to use OpenMP \acronym{SIMD} constructs.
      \item Allow using \acronym{LTO}.
      \item Switched continuous integration from Travis/AppVeyor to Github
      actions (thanks to Jim Hester for his help in fixing the coverage check
      issue).
    }
  }
}

\section{Version 7.0.5 (2020-11-10)}{
  \subsection{Fixed}{
    \itemize{
      \item Corrected \acronym{CRAN} requests.
      \item Cleaned up \file{NEWS}.
    }
  }
}

\section{Version 7.0.4 (2020-11-08)}{
  \subsection{Changed}{
    \itemize{
      \item Converted tests to be compliant with \pkg{testthat}: 3rd edition.
      \item Cleaned up prose.
    }
  }
  \subsection{Added}{
    \itemize{
      \item Added a citation to \file{DESCRIPTION}.
      \item Added a test to increase code coverage.
    }
  }
}

\section{Version 7.0.3 (2020-06-01)}{
  \subsection{Added}{
    \itemize{
      \item \file{CITATION} file.
      \item Explicit citation information to \file{README}.
      \item Travis, AppVeyor, and CodeCov integration.
      \item Added \code{R_forceSymbols(dll, TRUE)} to source per \acronym{WRE}
      5.4.
      \item Tests for package versioning.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item Moved canonical repository to Github.
      \item Use \code{FFLAGS} instead of \code{FCFLAGS} in Makevars.
    }
  }
  \subsection{Removed}{
    \itemize{
      \item Removed depsy badge from \file{README} as site is now defunct.
    }
  }
}

\section{Version 7.0.2 (2019-05-17)}{
  \subsection{Changed}{
    \itemize{
      \item Updated \file{NEWS} to reflect recent changes.
      \item Updated various file versions to reflect recent changes.
    }
  }
}

\section{Version 7.0.1 (2019-04-26)}{
  \subsection{Changed}{
    \itemize{
      \item Makevars adjusted by \acronym{CRAN} to prevent issues with parallel
      make.
    }
  }
}

\section{Version 7.0.0 (2019-02-12)}{
  \subsection{Changed}{
    \itemize{
      \item Changed Makevars flags and targets and forced dependence on \R 3.6+
      to comply with new \acronym{CRAN} policies on Fortran and OpenMP.
      \item Preventing spurious floating point errors by implementing hard floor
      of 0 and hard ceiling of 1.
      \item Updated comments in \file{delaporte.f95} source code.
      \item Changed \code{rdelap} testing to always use a fixed seed.
      \item Documentation cleaned up.
    }
  }
  \subsection{Removed}{
    \itemize{
      \item Removed the \code{cleanzeros} function.
      \item Removed unneeded Makevars target \code{cleanup}.
      \item Removed \acronym{GNU}-specific Makevars target \code{.NOTPARALLEL}.
    }
  }
}

\section{Version 6.3.0 (2018-11-21)}{
  \subsection{Added}{
    \itemize{
      \item Added \code{cleanzeros} function that zaps to 0 any value less than
      or equal to \acronym{EPS} (thanks Kipper Fletez-Brant).
      \item Test for zeros (thanks Kipper Fletez-Brant).
      \item Added items to \file{README} to comply with
      \href{https://bestpractices.coreinfrastructure.org/en}{\acronym{CII}}
      best practices and added badge.
      \item Added various badges to \file{README}.
      \item Added copyright and license information inside \R source code file.
    }
  }
}

\section{Version 6.2.0 (2018-06-22)}{
  \subsection{Added}{
    \itemize{
      \item \code{MoMdelap} now allows a skew \code{type} selection, similar to
      that of the \link[e1071]{skewness} function in the \pkg{e1071} package
      (thanks to William Cipolli for the suggestion). Skew defaults to former
      selection so there should be no change to any values.
      \item Tests added for all three skewness variants.
      \item \acronym{ORCID} added to author description.
      \item Copyright date corrected to reflect actual copyright and not date of
      licensure change.
      }
  }
}

\section{Version 6.1.0 (2017-08-13)}{
  \subsection{Fixed}{
    \itemize{
      \item There was an error in the calculation of \code{beta}, and thus all
      three parameters, in \code{MoMdelap} (thanks to William Cipolli).
      }
  }
}

\section{Version 6.0.0 (2017-03-31)}{
  \subsection{Fixed}{
    \itemize{
      \item The approximate version of \code{qdelap} was not correct. It pooled
      together ALL generated random variables. As it is impractical to generate
      millions of random variates for each unique parameter triplet, the
      functionality was changed so that only the \dQuote{exact} version of
      \code{qdelap} may be used if any of the parameters are a vector.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item In the continued struggle to have the package pass all its tests on
      Solaris \acronym{SPARC}, all logicals needing to be passed to Fortran are
      now passed as integers and not booleans. While all other platforms had no
      problem using Fortran 2003's ISO_C_bindings, Solaris \acronym{SPARC} did.
    }
  }
  \subsection{Added}{
    \itemize{
      \item Added note to \file{README} about Solaris \acronym{SPARC}.
      \item More tests including for singleton approximate \code{qdelap}.
    }
  }  
  \subsection{Removed}{
    \itemize{
      \item Older implementation of \code{qdelap} and \code{rdelap}
      approximations are now completely removed from code and documentation.
    }
  }
}

\section{Version 5.0.1 (2017-03-05)}{
  \subsection{Changed}{
    \itemize{
      \item Solaris, being big-endian, appears unable to use the same bit-mask
      transfer for \code{NaN} and \code{Inf} as any other \R platform.
      Therefore, the package has to revert to calling C to call the \R magic
      words which should recognize the platform.
    }
  }
}

\section{Version 5.0.0 (2017-03-05)}{
  \subsection{Changed}{
    \itemize{
      \item Changed handling of non-integers to be in line with \R convention
      that they have 0 probability instead of being considered the next integer.
      \code{ddelap} will return 0 for each non-integral value and will pass one
      warning, unlike base \R which passes one warning per non-integral value.
      \code{qdelap} will just return the value for the last integer and no
      warnings, similar to base \R.
      \item Use bit-representation of \code{NaN} and \code{Inf} to remove need
      to call C for setting these values. This allows the log-gamma and
      singleton d/p/qdelap functions to be elemental.
      \item Changed registration of the C \acronym{SEXP} functions seen by the
      package to use \code{R_CallMethodDef} as now preferred by \acronym{CRAN}.
      \item Explicitly listed the five C \acronym{SEXP} functions seen by the
      package as \code{R_RegisterCCallable} for potential downstream package
      use.
      \item Corrected some prose in documentation page.
      \item Older \file{NEWS} entries refactored for accuracy.
    }
  }
  \subsection{Fixed}{
    \itemize{
      \item Explicitly cast \code{n} as an integer in loggamma routine. This
      should suppress warning on \acronym{OSX} mavericks.
    }
  }
  \subsection{Removed}{
    \itemize{
      \item Older implementation of \code{qdelap} and \code{rdelap}
      approximations is now defunct. Only the new faster approximation based on
      section 3.9 of Karlis & Xekalaki (2005) remains. The next minor version
      may remove the \code{.Defunct} calls and the references to the old version
      in the documentation.
      \item Removed \code{colClasses = 'double'} from tests. This should solve
      Sun \acronym{SPARC} issues (It didn't).
    }
  }
  \subsection{Added}{
    \itemize{
      \item Specified, clarified, and added many more unit tests.
    }
  }
}

\section{Version 4.0.3 (2017-01-30)}{
  \subsection{Changed}{
    \itemize{
      \item Back end code ported from C++ & \pkg{Rcpp} to Fortran and C. In
      most cases this alone showed an increase in speed. There should be no
      noticeable difference in results. Random numbers generated with the same
      seeds should be the same as in previous packages.
      \item OpenMP calls activated for systems which have it which allows
      parallel processing of certain loops resulting in further speed increases
      over and above those supplied by Fortran. OpenMP compatibility is
      approximately version 3.1; no \acronym{SIMD} instructions are used.
      \item License changed from \acronym{GPL2+/LGPL3+} to \acronym{BSD-2}
      clause.
    }
  }
  \subsection{Fixed}{
    \itemize{
      \item Includes various emergency fixes to address parallel make and other
      compilation issues in versions 4.0.0--4.0.2.
    }
  }
}

\section{Version 4.0.2 (2017-01-30) [YANKED]}{
  \itemize{
    \item Did not build properly on some systems using a parallel make.
  }
}

\section{Version 4.0.1 (2017-01-30) [YANKED]}{
  \itemize{
    \item Did not build properly on Fedora using Clang.
  }
}

\section{Version 4.0.0 (2017-01-29) [YANKED]}{
  \itemize{
    \item Did not build properly on various platforms such as Fedora and Solaris.
  }
}

\section{Version 3.0.0 (2016-07-19)}{
  \subsection{Changed}{
    \itemize{
      \item The distributional functions now return \code{NaN} where the passed
      \code{alpha}, \code{beta}, or \code{lambda} is close to 0 (less than
      machine epsilon). Within vectors, valid triplets should still return
      proper values. The approximate versions of \code{qdelap} and \code{rdelap}
      do not handle 0 properly, and an error is thrown directing the user to the
      exact version (thanks are due to Jonathan Cairns and Jin-Rui Xu for their
      help in testing).
      }
    }
  \subsection{Added}{
    \itemize{
      \item Faster versions of the approximate \code{qdelap} and \code{rdelap}
      have been implemented.
      \item Tests for near 0 handling on exact version.
      }
    }
  \subsection{Deprecated}{
    \itemize{
      \item The old approximation versions of \code{qdelap} and \code{rdelap}
      can still be used by passing \code{old = TRUE}. This will be removed
      eventually.
    }
  }
}

\section{Version 2.3.1 (2016-06-16)}{
  \subsection{Changed}{
    \itemize{
      \item Reverted back to 2.2-3 as change to trapping zeros caused serious
      downstream issues. Will work on more elegant correction shortly
      (thanks to Mikhail Spivakov, Jonathan Cairns, and Jin-Rui Xu).
    }
  }
}

\section{Version 2.3.0 (2016-06-02)}{
  \subsection{Deprecated}{
    \itemize{
      \item In the next release (\strong{3.0.0}), passing \code{FALSE} to
      \code{exact} in \code{rdelap} and \code{qdelap} will use the method
      described in section 3.9 of Karlis & Xekalaki (2005) to generate
      approximately Delaporte random variates much more quickly for large
      \code{n} and large values of the parameters. However, when implemented,
      this will break reproducible even for specifically set seeds. The new code
      is commented out in the function.
    }
  }
  \subsection{Changed}{
    \itemize{
      \item Change non-exact \code{qdelap} mode to \emph{numeric} instead of
      \emph{integer} to handle returned \code{Inf}.
      \item Refactor \file{NEWS} to more closely comply with
      \href{https://keepachangelog.com/}{keep a changelog} suggestions.
    }
  }
  \subsection{Fixed}{
    \itemize{
      \item Check for any parameters not strictly greater than 0 (thanks to
      Mikhail Spivakov and Jonathan Cairns).
    }
  }
}

\section{Version 2.2-3 (2015-06-30)}{
  \subsection{Fixed}{
    \itemize{
      \item Explicitly import code from package \code{\link{stats}}.
      \item Updated code in unit tests to reflect change in
      \pkg{testthat} package (move to \code{expect_equal}).
      \item Minor tweaks to prose and grammar and expanded description.
    }
  }
}

\section{Version 2.2-2 (2014-12-04)}{
  \subsection{Fixed}{
    \itemize{
      \item Updated \file{DESCRIPTION} file to comply with recent changes.
    }
  }
}

\section{Version 2.2-1 (2014-09-24)}{
  \subsection{Fixed}{
    \itemize{
      \item Trapped machine precision issues when calling right-tailed version
      of cumulative distribution function (thanks to Mikhail Spivakov and
      Jonathan Cairns).
      \item Update documentation to reflect rounding procedure when non-integer
      passed as value.
    }
  }
}

\section{Version 2.2-0 (2014-07-15)}{
  \subsection{Added}{
    \itemize{
      \item Vectorized \code{d/p/q/rdelap}; \code{alpha}, \code{beta}, and
      \code{lambda} can now be vectors.
      \item Added more robust tests.
      \item Minor optimizations for speed.
    }
  }
  \subsection{Fixed}{
    \itemize{
      \item Corrected \code{lower.tail} and \code{log.p} which were not
      implemented properly.
    }
  }
}

\section{Version 2.1-1 (2014-04-07)}{
  \subsection{Fixed}{
    \itemize{
      \item Adjusted unit test so it can be run more easily on 32 bit machines
      with limited memory.
      \item Fixed spelling and other prose.
    }
  }
}

\section{Version 2.1-0 (2014-04-06)}{
  \subsection{Added}{
    \itemize{
      \item Added function to calculate method of moments estimates for the
      parameters. These estimates should also serve as good starting points for
      maximum likelihood estimation.
      \item Added unit testing.
    }
  }
}

\section{Version 2.0-1 (2014-02-05)}{
  \subsection{Changed}{
    \itemize{
      \item Minor cleanup after \pkg{Rcpp} update (remove \file{Makevar} files
      and tweak documentation).
    }
  }
}

\section{Version 2.0-0 (2014-02-05)}{
  \subsection{Changed}{
    \itemize{
      \item Updating for changes made to \pkg{Rcpp} 0.11.0. Previous versions
      may no longer compile properly and the current version may no longer work
      with older versions of \pkg{Rcpp}.
    }
  }
}

\section{Version 1.1-0 (2014-01-17)}{
  \subsection{Changed}{
    \itemize{
      \item Change \dQuote{Depends} to \dQuote{LinkingTo} in line with
      \acronym{CRAN} philosophy on package dependencies.
      \item Update documentation to give rough estimate as to when
      \code{exact = FALSE} should be used (rarely).
      \item Have \R code be written in a consistent style.
    }
  }
}

\section{Version 1.0-1 (2013-09-01)}{
  \subsection{Changed}{
    \itemize{
      \item Update \file{README} now that \acronym{CRAN} uses it as well.
      \item Minor grammar and typography tweaks to documentation.
    }
  }
}

\section{Version 1.0-0 (2013-07-09)}{
  \subsection{Added}{
    \itemize{
      \item Poisson-negative binomial approximation to quantile and random
      variate functions. This greatly speeds up calculation for large
      \eqn{\alpha, \beta}, or \eqn{\lambda}.
    }
  }
}

\section{Version 0.1-2 (2013-04-10)}{
  \subsection{Added}{
    \itemize{
      \item Converted \file{NEWS} to \file{NEWS.Rd}.
      \item Added repository and bug report \acronym{URL} to DESCRIPTION.
    }
  }  
  \subsection{Fixed}{
    \itemize{  
      \item Help documentation corrections, comments, and tweaks.
    }  
  }
}

\section{Version 0.1-1 (2013-04-08)}{
  \itemize{
    \item Initial version.
  }
}
