Dear mailing list,

Why does the following code produce numerical results for x.pos.l, but NaNs for 
x.neg.l?

x.pos <- function(tau.e, tau.c){
  tau.e + ((-tau.e^3 + 3*tau.e^2*tau.c - 
  3*tau.e*tau.c^2 + tau.c^3)^(1/3))/(2*2^(1/3))
}
(x.pos.l <- x.pos(1, 2))

x.neg <- function(tau.c, tau.i){
  tau.i + ((tau.c^3 - 3*tau.c^2*tau.i + 
  3*tau.c*tau.i^2 - tau.i^3)^(1/3))/(2*2^(1/3))
}
(x.neg.l <- x.neg(2, 3))

Many thanks for help,

Alrik

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to