CubeRoot (cbrt) of complex numbers

97 views
Skip to first unread message

Andrew McGurth

unread,
Apr 7, 2017, 8:11:56 PM4/7/17
to speedcrunch
When attempting to use complex numbers with cbrt,
Speedcrunch says "Not valid for this domain".

Entering cbrt(3+j) should return a result.
In fact, it should return 3 results.

Please fix. :)

Pol Welter

unread,
Apr 9, 2017, 5:28:30 AM4/9/17
to speedcrunch
Thanks for the hint.

This is a bug. The cbrt function is supposed to work with complex numbers. I am pretty sure this is a regression, it must have worked at some point before.
Please submit an issue on the bug tracker.

From the documentation:
cbrt(x)
Compute the third (cubic) root of x. In real mode, it accepts any real number. Negative numbers will yield a negative cubic root.
[...]
In complex mode, this function accepts any complex input. The result will generally be the first complex root, i.e. the one with a phase between 0 and π/3. Real negative arguments however will still yield a real (negative) result, matching the function’s behavior in real mode. Use x^(1/3) to get the first complex root.

True to the mathematic definition of a function, it can only ever return a single value. It can not return all roots at one.
 
Reply all
Reply to author
Forward
0 new messages