Skip to content

Commit

Permalink
Yes, Github was not happy. Precision issues. This option may be safer…
Browse files Browse the repository at this point in the history
… to test DGEMM --> QR failover for Rational.
  • Loading branch information
aadler committed Aug 21, 2023
1 parent 59159e3 commit fc26a14
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions inst/tinytest/test_MiniMaxApprox.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ wrnMess <- paste("All errors very near machine double precision. The solution",
## Polynomial
fn <- function(x) sin(x) + cos(x)
expect_warning(minimaxApprox(fn, -1.5, 1.5, 15L), wrnMess)
## Rational
fn <- function(x) exp(x) - 1
opts <- list(maxiter = 25L, convrat = 1.01, tol = 1e-12, conviter = 50L)
expect_warning(minimaxApprox(fn, -0.15, 0.15, c(5L, 4L), opts = opts), wrnMess)

# Test consecutive unchanging check and message
fn <- function(x) exp(x) - 1
Expand Down Expand Up @@ -126,6 +122,9 @@ expect_error(minimaxApprox(fn, -1, 1, c(3L, 3L), xi = xi), errMess)
# Test checkDenom error message
expect_error(minimaxApprox(sin, 0.75 * pi, 1.25 * pi, c(2L, 3L)),
"The 3 degree polynomial in the denominator has a zero at 2.80961")
# Should also check DGEMM --> QR failover for Rational
expect_error(minimaxApprox(exp, 0, 0.15, c(3L, 4L)),
"4 degree polynomial in the denominator has a zero at 0.0285519")

# Test evaluation function
x <- seq(0.1, 0.4, 0.025)
Expand Down

0 comments on commit fc26a14

Please sign in to comment.