Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline wb.c  
#1 Posted : 27 April 2021 18:17:31(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 132
United States

Was thanked: 22 time(s) in 19 post(s)
2021-04-27 11_13_57-SMath Studio - [Abspasta Concepts v1.0.sm_].png

Any thoughts?

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 27 April 2021 20:59:56(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: wb.c Go to Quoted Post
Any thoughts ?

It has nothing to do with Smath that displays Win Trig.

Offline wb.c  
#3 Posted : 28 April 2021 01:11:35(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 132
United States

Was thanked: 22 time(s) in 19 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post

It has nothing to do with Smath that displays Win Trig.



Not sure I follow...

Let me be more exact in my request.

Why is cos(270-deg) not equal to zero?

What can I do to make cos(270-deg) equal to zero?

I'll be honest, I'm a bit surprised this even an issue. Seems very basic.
Offline wb.c  
#4 Posted : 28 April 2021 01:42:39(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 132
United States

Was thanked: 22 time(s) in 19 post(s)
sine of 360 is also not quite zero...
Offline Razonar  
#5 Posted : 28 April 2021 01:50:52(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: wb.c Go to Quoted Post

I'll be honest, I'm a bit surprised this even an issue. Seems very basic.


Don't worry, other math programs may surprise you too. SMath, like many other programs, has two forms of calculation: numeric (=) and symbolic (Ctrl + dot). However, the SMath symbolic kernel is not well as others may be, but at least it almost always gives very good results. In this case, it does not give 0, but it does give a symbolic result equivalent to 0.

Clipboard00.jpg

The same can be obtained in Matlab, in this case, using the sym command, which, by the way, changed its syntax very recently.

Clipboard01.jpg

Also WolframAlpha has two answers for the same question, although in the end he opts only to show the exact value.

Clipboard02.jpg

That is, the three programs coincide in giving something very close to 0, but not when the numerical answer is requested, and 0 or some expression equivalent to 0 when they are evaluated symbolically.

Anyway, if you check the code of the symbolic calculation programs you may be disappointed: to evaluate these types of formulas, they actually simply have a table of results where they can find the exact values ​​for a reduced input set. That is to say, in fact, until recently, almost no one applied very elaborate rules to solve those formulas.

Best regards.
Alvaro.
thanks 1 user thanked Razonar for this useful post.
on 28/04/2021(UTC)
Offline wb.c  
#6 Posted : 28 April 2021 02:13:22(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 132
United States

Was thanked: 22 time(s) in 19 post(s)
Yeah, did some more reading and I guess since pi is only carried out to 16 decimal places (floating), the conversion from radians to degrees (pi/180) is limited by the 16 decimal place value of pi.

What isn’t super clear is why it only happens with 270 degrees for cosine and 360 degrees for sine. Pi/180 is used to convert all input to angles.

Maybe at some point in my studies I learned why 270 degrees and 360 degrees are special, but I don’t remember now.
Offline Denis.N  
#7 Posted : 28 April 2021 10:20:57(UTC)
Denis.N


Rank: Member

Groups: Registered
Joined: 21/05/2015(UTC)
Posts: 11
Man
Russian Federation

Was thanked: 2 time(s) in 2 post(s)
2021.04.28-10.27.58.png

Edited by user 28 April 2021 10:28:37(UTC)  | Reason: Not specified

Offline Denis.N  
#8 Posted : 28 April 2021 10:52:33(UTC)
Denis.N


Rank: Member

Groups: Registered
Joined: 21/05/2015(UTC)
Posts: 11
Man
Russian Federation

Was thanked: 2 time(s) in 2 post(s)
2021.04.28-10.50.58.png
Offline Jean Giraud  
#9 Posted : 28 April 2021 14:35:14(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: wb.c Go to Quoted Post
Yeah, did some more reading and I guess since pi is only carried out to 16 decimal places (floating), the conversion from radians to degrees (pi/180) is limited by the 16 decimal place value of pi.

What isn’t super clear is why it only happens with 270 degrees for cosine and 360 degrees for sine. Pi/180 is used to convert all input to angles.

Maybe at some point in my studies I learned why 270 degrees and 360 degrees are special, but I don’t remember now.

Pi and more numbers are stored in computing machinery 40 decimals.
Not a single function exist in maths. They are approximated from the
4 basic arithmetic operations [+, -, *, /].
They are all normalized rational fraction P(n)/1+Q(n) on short range.
then like scaled. The coded native range is globally 21 floating point.
Error propagation brings down to around 18 floating point, by convention
15 digits are considered true to meet typical Abramowitz & Stegun.
Smath, Wolfram Alpha, Mathcad/PTC ... and else don't abide to the
convention of rounding smaller than 15 D to zero.
Mathcad 8, 2000, 2001i, 11 do round cos(270) = 0
In short, Smath does not calculate cos(270), trig and more exp, ln
are built-in in Windows. Smath and those more display the floating
point register, since when they broke the 15 D convention ?
Read more: Luke, Cody Junior, Hart et al.
round(cos((270),15)=0
Not built-in Windows from Smath menu ... Bessel, Airy ...
Have a good day ... Jean

Offline Denis.N  
#10 Posted : 28 April 2021 15:54:49(UTC)
Denis.N


Rank: Member

Groups: Registered
Joined: 21/05/2015(UTC)
Posts: 11
Man
Russian Federation

Was thanked: 2 time(s) in 2 post(s)
2021.04.28-15.53.49.png
Offline wb.c  
#11 Posted : 28 April 2021 17:55:57(UTC)
wb.c


Rank: Advanced Member

Groups: Registered
Joined: 02/04/2018(UTC)
Posts: 132
United States

Was thanked: 22 time(s) in 19 post(s)
This seems to be a good solution since only 270-deg with cosine and 360-deg with sine seem to be an issue.

2021-04-28 10_51_51.png
Offline Jean Giraud  
#12 Posted : 28 April 2021 19:30:04(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: wb.c Go to Quoted Post
This seems to be a good solution since only
270-deg with cosine and 360-deg with sine seem to be an issue.

Add reality ... cos(270deg).PNG
Doing that is bug vs PTC Mathcad, Wolfram Alpha ...
The question is: why and since when CAS don't define result < 10^-15 = 0
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.