Simplify quirk
|
11-10-2020, 05:55 AM
Post: #1
|
|||
|
|||
Simplify quirk
For polynomials of the Nth order, say a 3rd order: y := x + x^3 + x^2, the expected decreasing order expression is displayed when simplify(y)= x^3 + x^2 + x is applied (unless you have increasing checked in the CAS settings). Things change the moment a second symbolic variable factor is included in the polynomial, say y := a*x + x^3+ x^2, you get: simplify(y) := a*x + x^3 + x^2, which, i think, is counter intuitive. Increasing order seems to work as expected when minimum simplify is chosen in CAS settings.
|
|||
11-11-2020, 05:25 PM
Post: #2
|
|||
|
|||
RE: Simplify quirk
That's because the main variable of the polynomial is a here. You can run reorder to specify variable ordering.
|
|||
11-13-2020, 04:36 PM
Post: #3
|
|||
|
|||
RE: Simplify quirk
(11-11-2020 05:25 PM)parisse Wrote: That's because the main variable of the polynomial is a here. You can run reorder to specify variable ordering. I see, thanks. Another pet peeve of mine with this calculator is how the poly2sym() output is handled, when compared to other software such as matlab for example, which I think is more intuitive: syms a b c d x p = poly2sym([1, a, b + c, d], x) Outputs: p = x^3 + a*x^2 + (b + c)*x + d In HP Prime, you would expect a result with grouping by coefficient order but this not the case: p:=poly2sym([1, a, b+c, d]) = x*(x*(a+x)+b+c)+d and after a simplify press: a*x^2 + b*x + d + x^3 Now as there's no built in function to group a polynomial by coefficient order, one way around to do it in the HP Prime is: sum(coeff(p,x).*seq(x^n,n,degree(p,x),0,1)) = a*x^2 + x^3 +x*(b+c) + d (Result with simplify minimum in CAS settings) A reorder command would give me the correct descending exponential order for variable x but would expand the polynomial. The only way to get sum(coeff(p,x).*seq(x^n,n,degree(p,x),0,1)) =x^3 + a*x^2 + +x*(b+c) + d is to have the simplify setting set to none. |
|||
11-13-2020, 06:42 PM
(This post was last modified: 11-13-2020 06:42 PM by parisse.)
Post: #4
|
|||
|
|||
RE: Simplify quirk
poly2symb is an advanced user command. It returns the Horner form of the polynomial, which is the fastest way to evaluate the polynomial (and probably also the most accurate). Moreover, you can copy/paste the output to a standard programming language like C without modification.
|
|||
11-14-2020, 05:49 AM
(This post was last modified: 11-14-2020 05:56 AM by dah145.)
Post: #5
|
|||
|
|||
RE: Simplify quirk
(11-13-2020 06:42 PM)parisse Wrote: poly2symb is an advanced user command. It returns the Horner form of the polynomial, which is the fastest way to evaluate the polynomial (and probably also the most accurate). Moreover, you can copy/paste the output to a standard programming language like C without modification. I see, didn't really think of that, thank you for your patience. Also, another quirk I found, I know this one seems fairly simple but I have not found a way to do it with the Prime built in functions: We know that x*x^(1/3) = x^(4/3), but I haven't found a way in the HP Prime to express it like the right part of the equation, after inputting the left part of the equation. Already tried simplify(), normal(), regroup() and expand() to no avail. Same behavior for expressions such as (x^(1/4))^3 that we know is equivalent to x^(3/4). |
|||
11-14-2020, 08:14 PM
Post: #6
|
|||
|
|||
RE: Simplify quirk
You can't because x^(4/3) is automatically rewritten as x*x^(1/3) and x^(3/4) as (x^(1/4))^3.
|
|||
11-16-2020, 01:31 PM
(This post was last modified: 11-16-2020 01:32 PM by dah145.)
Post: #7
|
|||
|
|||
RE: Simplify quirk
(11-14-2020 08:14 PM)parisse Wrote: You can't because x^(4/3) is automatically rewritten as x*x^(1/3) and x^(3/4) as (x^(1/4))^3. Actually it seems I found a workaround. With simplify set to none and floating to 5: approx(x*x^(1/3)) = x*x^(0.333333) expand(x*x^(0.333333)) = x^(1.333333) exact(x^(1.333333)) = x^(4/3) Same method also works with (x^(1/4))^3. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)