Skip to content

Commit

Permalink
Reduce tailtol tolerance in expecatation of CRAN note regarding OpenB…
Browse files Browse the repository at this point in the history
…LAS test, EVEN THOUGH THIS PLATFORM HAS BEEN USING OPENBLAS FOR > 10 YEARS AND PASSED THE TESTS!
  • Loading branch information
aadler committed Sep 5, 2023
1 parent 9334fa6 commit 77ba6cd
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 17 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Package: minimaxApprox
Type: Package
Title: Implementation of Remez Algorithm for Polynomial and Rational Function
Approximation
Version: 0.2.1
Date: 2023-09-04
Version: 0.2.1.9000
Date: 2023-09-05
Authors@R: person(given="Avraham", family="Adler",role=c("aut", "cre", "cph"),
email="[email protected]", comment = c(ORCID = "0000-0002-3039-0703"))
Description: Implements the algorithm of Remez (1962) for polynomial minimax
Expand Down
10 changes: 5 additions & 5 deletions R/MiniMaxApprox.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ minimaxApprox <- function(fn, lower, upper, degree, relErr = FALSE, xi = NULL,
# Used for cases where we check polynomial degree n + 1.
# See issue 2 https://github.com/aadler/minimaxApprox/issues/2
if (!("tailtol" %in% names(opts))) {
opts$tailtol <- min(1e-10, (upper - lower) / 1e6)
opts$tailtol <- min(sqrt(.Machine$double.eps), (upper - lower) / 1e6)
}

if (!("ztol" %in% names(opts))) {
Expand Down Expand Up @@ -99,10 +99,10 @@ minimaxApprox <- function(fn, lower, upper, degree, relErr = FALSE, xi = NULL,
"of degree", degree, "but successfully completed",
"when looking for a polynomial of degree",
degree + 1L, "with the largest coefficient's",
"contribution to the approximation <=",
paste0(opts$tailtol, ":"), "the tailtol option. The",
"result is a polynomial of length", degree, "as the",
"uppermost coefficient is effectively 0.")
"contribution to the approximation <= the tailtol",
"option. The result is a polynomial of length",
degree, "as the uppermost coefficient is effectively",
"0.")
mmA$a <- mmA$a[-length(mmA$a)]
message(mess)
} else {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you use the package, please cite it as:
Adler A (2023). minimaxApprox: Implementation of Remez Algorithm for
Polynomial and Rational Function Approximation.
[doi: 10.5281/zenodo.8158855](https://doi.org/10.5281/zenodo.8158855),
R package version 0.2.0, https://CRAN.R-project.org/package=minimaxApprox
R package version 0.2.1.9000, https://CRAN.R-project.org/package=minimaxApprox

A BibTeX entry for LaTeX users is:

Expand All @@ -30,7 +30,7 @@ A BibTeX entry for LaTeX users is:
year = {2023},
url = {https://CRAN.R-project.org/package=minimaxApprox},
doi = {10.5281/zenodo.8158855},
note = {R package version 0.2.0},
note = {R package version 0.2.1.9000},
}
```

Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ bibentry(bibtype = "Manual",
year = "2023",
url = "https://CRAN.R-project.org/package=minimaxApprox",
doi = "10.5281/zenodo.8158855",
note = "R package version 0.2.1"
note = "R package version 0.2.1.9000"
)
16 changes: 14 additions & 2 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,24 @@
}
}

\section{Version 0.2.1.9000 (2023-09-05)}{
\subsection{Changed}{
\itemize{
\item \strong{Breaking:} Reduced \code{tailtol} tolerance to
\code{sqrt(.Machine$double.eps)} as one of the myriad \acronym{CRAN}
testbeds also had issues with convergence. Different \acronym{BLAS}
implementations seem to display different levels of precision.
}
}
}

\section{Version 0.2.1 (2023-09-04)}{
\subsection{Changed}{
\itemize{
\item Test for calculating polynomial of degree \code{n + 1} when one of
degree \code{n} fails, while passing both R Mac Builder and Github's Mac
platform, failed on CRAN's testbed. So test is not run for Mac.
degree \code{n} fails, while passing both R \acronym{Mac} Builder and
Github's \acronym{Mac} platform, failed on \acronym{CRAN}'s testbed.
So test is no longer run for \acronym{Mac} on \acronym{CRAN}.
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/test_MiniMaxApprox.R
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ if (!("darwin" %in% tolower(Sys.info()[["sysname"]]))) {
mess <- paste("The algorithm failed while looking for a polynomial of degree",
"10 but successfully completed when looking for a polynomial of",
"degree 11 with the largest coefficient's contribution to the",
"approximation <= 1e-10: the tailtol option. The result is a",
"approximation <= the tailtol option. The result is a",
"polynomial of length 10 as the uppermost coefficient is",
"effectively 0.")
fn <- function(x) 1 / (1 + (5 * x) ^ 2)
Expand Down
9 changes: 5 additions & 4 deletions man/MiniMaxApprox.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ minimaxApprox(fn, lower, upper, degree, relErr = FALSE, xi = NULL,
\item \code{tailtol}: numeric; The tolerance of the coefficient of
the largest power of \code{x} to be ignored when performing the
polynomial approximation a second time. Defaults to the smaller of
\eqn{1\times 10^{-10}}{1e-10} or \eqn{\frac{\code{upper} -
\code{lower}}{10^6}}{(\code{upper} - \code{upper}) / 1e6}. Set to
\code{NULL} to skip the \code{degree + 1} check completely. See
\strong{Details}.
\eqn{\sqrt{\text{.Machine\$double.eps}} \approx 1.49\times
10^{-8}}{\code{sqrt(.Machine$double.eps)}} or
\eqn{\frac{\code{upper} - \code{lower}}{10^6}}{(\code{upper} -
\code{upper}) / 1e6}. Set to \code{NULL} to skip the
\code{degree + 1} check completely. See \strong{Details}.
\item \code{ztol}: numeric; The tolerance for each polynomial or
rational numerator or denominator coefficient's contribution to
\strong{not} to be set to 0. Similar to polynomial \code{tailtol}
Expand Down

0 comments on commit 77ba6cd

Please sign in to comment.