The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

[HP Prime] Plots containing complex numbers bug?
Message #1 Posted by Chris Pem10 on 4 Dec 2013, 1:04 p.m.

Plot the following expression in the Function app:

x^(1/3)*(x+3)^(2/3)

The resulting plot is only partialy shown... values should be plotted for x < -3 as well. I assume this has something to do with the way the Prime handles exact/inexact arithmatic?

Both Mathematica and a textbook confirm the plot should display values for x < -3

I'll try to remember to upload a screen shot when I get storage space on this site.

Done.

I've plotted the expression two ways (working horizontally in the figure):



The first row shows the Mathematica output, the Prime equation, and Prime output. Same for the second row, just rewrote the expression. Both Prime plots seem to disagree with Mathematica's plot.

Edited: 4 Dec 2013, 2:54 p.m. after one or more responses were posted

      
Re: [HP Prime] Plots containing complex numbers bug?
Message #2 Posted by Mark Hardman on 4 Dec 2013, 2:07 p.m.,
in response to message #1 by Chris Pem10

What if you plot:

3 NTHROOT X *((X+3)/(3 NTHROOT (X+3)))
            
Re: [HP Prime] Plots containing complex numbers bug?
Message #3 Posted by Chris Pem10 on 4 Dec 2013, 3:20 p.m.,
in response to message #2 by Mark Hardman

Not sure how to enter that? Do I use tick marks or something?

      
Re: [HP Prime] Plots containing complex numbers bug?
Message #4 Posted by Chris Pem10 on 4 Dec 2013, 3:18 p.m.,
in response to message #1 by Chris Pem10

Update... Found yet another way the Prime graphs this function:

            
Re: [HP Prime] Plots containing complex numbers bug?
Message #5 Posted by Mark Hardman on 4 Dec 2013, 5:12 p.m.,
in response to message #4 by Chris Pem10

I see you learned how to use NTHROOT.

The lower-right result is somewhat similar to the Complex-valued plot that you get from Wolfram Alpha except the plot is in the wrong quadrant for -3 < x < 0.

x^(1/3)*((x+3)/((x+3)^(1/3)))

                  
Re: [HP Prime] Plots containing complex numbers bug?
Message #6 Posted by Chris Pem10 on 4 Dec 2013, 9:12 p.m.,
in response to message #5 by Mark Hardman

I haven't looked into using NTHROOT yet...
What's even weirder... if you download the "Xcas Pad" android app and plot the original function above, you get Wolfram's correct plot! The Xcas Pad app is built on xcas... go figure?

Regardless; I don't feel very confident this plot system is up to the task. I'd rather have no plot than a wrong plot.

Edited: 4 Dec 2013, 9:19 p.m.

                        
Re: [HP Prime] Plots containing complex numbers bug?
Message #7 Posted by Tim Wessman on 5 Dec 2013, 12:28 a.m.,
in response to message #6 by Chris Pem10

I'm guessing the 48 series is also deficient since it does exactly the same thing? :-)

It really gets down to the behavior in the HP math library. NTHROOT (x v/ y) returns the real root, and fractional power will return the principal root instead of the real one.

Its probably time to update that I think. No reason not to have the behavior dependent on the complex flag.

If you'd like to see some graphs that wolfram totally screws up, I've got a nice collection. There really is no "magic bullet" for graphing. :-)

TW

      
Re: [HP Prime] Plots containing complex numbers bug?
Message #8 Posted by cyrille de Brébisson on 5 Dec 2013, 7:40 a.m.,
in response to message #1 by Chris Pem10

Hello,

The main problem is that you are using mathematical functions (^ to a non integer, or NTHROOT) which happends NOT TO BE FUNCTIONS by the strict definition of the word function.

ie: these 'function' have multiple mathematicaly correct results and various math system are giving you different (correct) results, which results in a different output plot.

Furthemore, depending on the complex setting of Prime, you can get different graphs on the same machine!

cyrille


[ Return to Index | Top of Index ]

Go back to the main exhibit hall