Post Reply 
Replacing "x" is not right!
07-22-2017, 10:21 PM (This post was last modified: 07-22-2017 10:34 PM by Spybot.)
Post: #1
Replacing "x" is not right!
Hello!

I was Confidently doing a substitution on a polynomial... the result! on both emulator & physical device are not correct. FW:11226(on Emulator) and FW:12066 (on the physical one). Is this a bug?

   

Spybot.
Find all posts by this user
Quote this message in a reply
07-23-2017, 12:11 AM (This post was last modified: 07-23-2017 12:19 AM by Tim Wessman.)
Post: #2
RE: Replacing "x" is not right!
Have a value in x? (would assume not, but just thought I'd ask)

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
07-23-2017, 12:22 AM
Post: #3
RE: Replacing "x" is not right!
Spybot,

I could be wrong, but I don't think what you used is a replacement operator. It's a constraint operator. In words you asked the calculator to tell you what x^4-x^2+5 is if x=-x. The only time x=-x is when x=0 so it stuck in 0 for x and returned 5.

You probably want subst(x^4-x^2+5,x=-x) which returns (-x)^4-(-x)^2+5.

-road
Find all posts by this user
Quote this message in a reply
07-23-2017, 01:45 AM
Post: #4
RE: Replacing "x" is not right!
Hello Tim!
Actually I don't have a value stored in "x". I double checked that.

Spybot.
Find all posts by this user
Quote this message in a reply
07-23-2017, 01:57 AM
Post: #5
RE: Replacing "x" is not right!
Hello roadrunner!
That's what I'm talking about, the Prime CAS takes "x" as a zero, but I haven't assigned any numeric value to it. if I use any other variable name... like "r" or "y" it does the replacement correctly, the problem comes in when replacing the "same" variable name.
And... yes! subst() certainly gets the job done, but I think that particular "constrain operator" should do it too.

Spybot.
Find all posts by this user
Quote this message in a reply
07-23-2017, 07:42 AM
Post: #6
RE: Replacing "x" is not right!
Maybe I can improve that, but not sure. It's not easy because you are doing a recursive definition (| is implemented by doing a program where the variables to be substituted are declared local and assigned to the right member of =, I will try to replace occurences of the local variable by quote())
Find all posts by this user
Quote this message in a reply
07-23-2017, 08:17 AM
Post: #7
RE: Replacing "x" is not right!
I think the problem can be simple.
[Image: 35711777160_8401bdff27_o.png]

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
07-23-2017, 12:03 PM
Post: #8
RE: Replacing "x" is not right!
(07-23-2017 01:57 AM)Spybot Wrote:  Hello roadrunner!
That's what I'm talking about, the Prime CAS takes "x" as a zero, but I haven't assigned any numeric value to it.

My thoughts on this topic:

x^4-2*x^3+5|x = x; // where x is not sign changed ==> 5
plotfunc((x^4-2*x^3+5|x = -x); // Suggests a result of 5 (no labels)
plotfunc((x^4-2*x^3+5|x = x); // As above...

These expressions validate that x is assumed to have a value of zero, and thus is not symbolic. However, if:

(r^4-2*r^3+5|(r = (-x))); // ==> (-x)^4-2*(-x)^3+5 the variable x remains symbolic.

Is the original expression sufficiently well described, or is the expression a matter of interpretation, where both Spybot, and Road, have correct solutions? In short, perhaps the provided result IS right, but the expression itself needs better formulation?

Dale
Find all posts by this user
Quote this message in a reply
08-02-2017, 10:45 PM
Post: #9
RE: Replacing "x" is not right!
Try putting the -x in quotes; x='-x' and then simplify.

CHUCK
Find all posts by this user
Quote this message in a reply
08-04-2017, 02:49 AM (This post was last modified: 09-06-2017 02:53 PM by Spybot.)
Post: #10
RE: Replacing "x" is not right!
Hi CHUCK!
You're right, putting x='-x' works as expected, it even reminds me the syntax on the 48-50G calculators. thank you for this new approach.

Spybot.
Find all posts by this user
Quote this message in a reply
12-12-2017, 04:21 PM
Post: #11
RE: Replacing "x" is not right!
Finally this issue has been fixed in this new FW 13217. Thank you parisse!

Spybot.
Find all posts by this user
Quote this message in a reply
12-13-2017, 01:59 AM
Post: #12
RE: Replacing "x" is not right!
I noticed the use of the | character. How do you get that on the Prime? I can get it from the chars but that's a bit of an obscure way to get a character. Anyone know a quick way to get that char?
Thx
Find all posts by this user
Quote this message in a reply
12-13-2017, 02:07 AM
Post: #13
RE: Replacing "x" is not right!
never mind....I found it above the Units key.....has a x|x choice....
Find all posts by this user
Quote this message in a reply
12-31-2017, 02:36 PM (This post was last modified: 12-31-2017 02:49 PM by Rudi.)
Post: #14
RE: Replacing "x" is not right!
Dear All
My Softwareversions:
HP Prime Graphing Calculator Software Version: 2017 11 15 (13011) BETA
and HP Connectivy Kid software version: 2017 11 15 (13012) BETA

Valid only for the CAS View!
Basically, variables may not yet be initialized.
1. This can be done either with result () or purge ({list of variables})
2. Variables can then be used in formulas.
3. Only when values have been assigned to the variables are the variables automatically replaced by their values.

   

Another Example:

   

A happy and healthy new year.
Rudi
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)