It is because of the implementation of pow
under C99 standard.
Let alone OP's example: (-50.61828)^(-67.421587)
, the mathematically justified (-8)^(1/3) = -2
does not work in R:
(-8)^(1/3)
# [1] NaN
Quoted from ?"^"
:
Users are sometimes surprised by the value returned, for example
why ‘(-8)^(1/3)’ is ‘NaN’. For double inputs, R makes use of IEC
60559 arithmetic on all platforms, together with the C system
function ‘pow’ for the ‘^’ operator. The relevant standards
define the result in many corner cases. In particular, the result
in the example above is mandated by the C99 standard. On many
Unix-alike systems the command ‘man pow’ gives details of the
values in a large number of corner cases.
I am on Ubuntu LINUX, so can help get relevant part of man power
printed here:
If x is a finite value less than 0, and y is a finite noninteger, a
domain error occurs, and a NaN is returned.