Am 13.08.2020 um 03:55 schrieb Allin Cottrell:
On Wed, 12 Aug 2020, Alecos Papadopoulos wrote:
> W = sgn(Z) * (abs(Z)^(1/3))
> Is this the proper/efficient way?
My second reply. No, this is not proper!
<gretl>
? Z = -2
Generated scalar Z = -2
? W = sgn(Z) * (abs(Z)^(1.0/4))
There's a digital approximation involved in the octave answer,
via
complex numbers, but it's basically right, while the answer according to
your proposal is flat wrong.
The issue is already largely moot now, but just for the record, notice
how you changed Alecos' example. He hardwired the special case 1/3, and
you responded with 1/4. So depending on how general he wanted to be
(implicitly), he may not have been wrong at all.
cheers
sven