R Under development (unstable) (2026-02-18 r89435 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > # This test will fail without try() wrapper in multiStart() > require(BB) Loading required package: BB > > test <- function(x, bb0=-3, bb1=5, c0=2, r0=0) { + ((exp(c0-r0)*(bb0+x)*(bb1-x))/((bb0+x+1)*(bb1-x-1))-1) + } > > # uniroot(test,c(-100,100))$root this will fail > > p0 <- matrix(seq(0, 6, length=10), ncol=1) > ans <- multiStart(par=p0, fn=test, method=2, control=list(M=20, NM=FALSE)) Parameter set : 1 ... Unsuccessful convergence. Parameter set : 2 ... Unsuccessful convergence. Parameter set : 3 ... Unsuccessful convergence. Parameter set : 4 ... Parameter set : 5 ... Successful convergence. Parameter set : 6 ... Successful convergence. Parameter set : 7 ... Parameter set : 8 ... Successful convergence. Parameter set : 9 ... Successful convergence. Parameter set : 10 ... Successful convergence. Warning messages: 1: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 2: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 3: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 4: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 5: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 6: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 7: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. 8: In dfsane(par = par, fn, method = cpars[1], control = list(M = as.numeric(cpars[2]), : Function returns a scalar. Function BBoptim or spg is better. > ans$par[ans$conv] [1] 3.069772 3.069772 5.243263 5.243263 5.243263 > > > proc.time() user system elapsed 0.50 0.07 0.56