HP Forums
Bug in simplifying trig expressions - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Bug in simplifying trig expressions (/thread-11303.html)



Bug in simplifying trig expressions - drake200120xx - 08-31-2018 02:19 PM

When trying to use the simplify function in the CAS workspace for "COS(x)/SIN(x)*COT(x)". This should, of course, return COT(x)^2, but instead returned something enormous. For example, part of the numerator of the returned fraction "-16*COS(RE(x))^4*(e^(-IM(x)))^4+16*COS(RE(x))^2..." Does someone know why this happened? Is there a way to fix this or get around it?

Thanks to everyone who helps me out with my new HP Prime Smile

-Drake

(PS-Calculator in Radians and running latest firmware)


RE: Bug in simplifying trig expressions - parisse - 08-31-2018 03:30 PM

Uncheck complex variables in the CAS settings. Run trigtan instead of simplify if you prefer tan to cos in the answer.


RE: Bug in simplifying trig expressions - Magnus512 - 09-01-2018 02:22 AM

There is an error, the calculator says that this is not equal, when I run the same in wolfram it says that it is equal.
[attachment=6271]
[attachment=6272]


RE: Bug in simplifying trig expressions - Carsen - 09-01-2018 05:11 AM

(09-01-2018 02:22 AM)Magnus512 Wrote:  There is an error, the calculator says that this is not equal, when I run the same in wolfram it says that it is equal.

When you submit the test into the Prime, read the terminal that pops up. I've attached the terminal to this post. Note the "Therefore a==b may return false even if a and b are mathematically equal".


RE: Bug in simplifying trig expressions - Stevetuc - 09-01-2018 06:54 AM

(09-01-2018 05:11 AM)Carsen Wrote:  
(09-01-2018 02:22 AM)Magnus512 Wrote:  There is an error, the calculator says that this is not equal, when I run the same in wolfram it says that it is equal.

When you submit the test into the Prime, read the terminal that pops up. I've attached the terminal to this post. Note the "Therefore a==b may return false even if a and b are mathematically equal".

It would be much more robust if the prime would check for mathematically equal but different representations and apply
simplify(a-b)==0 itself if need be.


RE: Bug in simplifying trig expressions - parisse - 09-01-2018 08:31 AM

It seems, but it is not for efficiency reasons : running simplify may take several seconds or more on some expressions. Therefore the choice is left to the user depending on the simplification level in the CAS settings. If you select maximum, then simplify(a-b) is called automatically and you will get 1.


RE: Bug in simplifying trig expressions - Stevetuc - 09-01-2018 08:47 AM

(09-01-2018 08:31 AM)parisse Wrote:  It seems, but it is not for efficiency reasons : running simplify may take several seconds or more on some expressions. Therefore the choice is left to the user depending on the simplification level in the CAS settings. If you select maximum, then simplify(a-b) is called automatically and you will get 1.

Thanks, thats useful to know and it works well.


RE: Bug in simplifying trig expressions - Magnus512 - 09-01-2018 06:24 PM

That's right my bad jaja I was using min simplification I don't know why


RE: Bug in simplifying trig expressions - Tim Wessman - 09-02-2018 03:56 AM

Because that is the default and you should be using it. We will be removing "maximum". All it really does it click the simplify button each time essentially.


RE: Bug in simplifying trig expressions - CyberAngel - 09-02-2018 05:40 AM

(09-02-2018 03:56 AM)Tim Wessman Wrote:  Because that is the default and you should be using it. We will be removing "maximum". All it really does it click the simplify button each time essentially.

Why remove it?
Let the USER choose!!
Make a better help - don't remove options.