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 LordMike  
#1 Posted : 27 October 2009 16:11:49(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

Hey,

I might have a bug in the sine function. It's minorily out of course...


My calculator gives
sin(0) -> 0
sin(pi) -> 0
sin(2 pi) -> 0

Options are set to radians.

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

Offline LordMike  
#2 Posted : 27 October 2009 16:27:01(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

I have found a significant reason for this 'error'...

It seams, that smath doesn't take into account, PI, as symbol behind the scenes.
It calculates it as a decimal value with 'only' (I think) 15 decimals...

Please make PI a symbol until absolutely necessary to show as a decimal Good
Offline omorr  
#3 Posted : 27 October 2009 16:34:35(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
LordMike wrote:
I have found a significant reason for this 'error'...

It seams, that smath doesn't take into account, PI, as symbol behind the scenes.
It calculates it as a decimal value with 'only' (I think) 15 decimals...

Please make PI a symbol until absolutely necessary to show as a decimal Good

If you use symbolic SMath engine, here is the result:
sin(π)—0
sin(2*π)—sin(2*π)

EDIT:On the other hand there is no decimal treshold in SMath where the small numbers should be represented as zero.

Edited by user 27 October 2009 16:40:32(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline LordMike  
#4 Posted : 27 October 2009 16:41:26(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

How does one use this symbolic engine?
Offline omorr  
#5 Posted : 27 October 2009 16:44:43(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
LordMike wrote:
How does one use this symbolic engine?

Instead of regular equal to (numeric) press symbolic equal to (right arrow on the Arithmetic palette) or CTRL+. as shortcut.
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline LordMike  
#6 Posted : 27 October 2009 16:51:21(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

omorr wrote:
LordMike wrote:
How does one use this symbolic engine?

Instead of regular equal to (numeric) press symbolic equal to (right arrow on the Arithmetic palette) or CTRL+. as shortcut.


Like this?:
Offline omorr  
#7 Posted : 27 October 2009 16:55:29(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
LordMike wrote:
omorr wrote:
LordMike wrote:
How does one use this symbolic engine?

Instead of regular equal to (numeric) press symbolic equal to (right arrow on the Arithmetic palette) or CTRL+. as shortcut.


Like this?:

Yes, you are right. The symbolic result will give symbols and numbers as fractions, numeric result will give you floats (with fixed decimal point, or scientific format - number of decimals can be set by Tools=>Options=>Decimal places)

EDIT:some functions (like solve) will give you only numerical values (you will not have PI in this case). Therefor, you will not have the "symbolic" answer. The same is with integration f.e.

Edited by user 27 October 2009 16:59:21(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline LordMike  
#8 Posted : 27 October 2009 17:00:50(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

We do then agree, that working with PI as a number, is stupid.
F.ex, when setting it into the sine function, as such: sin(pi).

When I then do this:


I'd prefer if it showed 0 both places. Given the fact that behind the scenes, it *should* work symbolically.

EDIT: (omorr edited)
Hmm.. That's not practical. Seriously...
Offline omorr  
#9 Posted : 27 October 2009 17:12:08(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
LordMike wrote:
EDIT: (omorr edited)
Hmm.. That's not practical. Seriously...

I agree Mike, but at the moment SMath is working this way. Andrey is doing his best to improve it. Xcas as a symbolic engine and plugin will make solving equations and integration real symbolically. Maybe some other symbolic engines as plugins will be included in the future.

EDIT: Hmm... Did I make a mistake - it is different than yours?
solve(-sin(x)≡0;x;0;2*π)=mat(0;3,142;2;1)
sin(el(solve(-sin(x)≡0;x;0;2*π);1))=0
sin(el(solve(-sin(x)≡0;x;0;2*π);2))=-5,787*10^{-12}

or setting 10 decimal places

sin(el(solve(-sin(x)≡0;x;0;2*π);2))=3,2310851043*10^{-15}

Edited by user 27 October 2009 17:26:08(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline LordMike  
#10 Posted : 27 October 2009 18:08:53(UTC)
LordMike


Rank: Advanced Member

Groups: Registered
Joined: 24/10/2009(UTC)
Posts: 52
Man
Location: Denmark

omorr wrote:
LordMike wrote:
EDIT: (omorr edited)
Hmm.. That's not practical. Seriously...

I agree Mike, but at the moment SMath is working this way. Andrey is doing his best to improve it. Xcas as a symbolic engine and plugin will make solving equations and integration real symbolically. Maybe some other symbolic engines as plugins will be included in the future.

EDIT: Hmm... Did I make a mistake - it is different than yours?
solve(-sin(x)≡0;x;0;2*π)=mat(0;3,142;2;1)
sin(el(solve(-sin(x)≡0;x;0;2*π);1))=0
sin(el(solve(-sin(x)≡0;x;0;2*π);2))=-5,787*10^{-12}

or setting 10 decimal places

sin(el(solve(-sin(x)≡0;x;0;2*π);2))=3,2310851043*10^{-15}


I had 3 decimal places... Dunno what you had on the first one ...

EDIT:
10 decimal spaces:
-1.0206823939*10^{-11}

Edited by user 27 October 2009 18:10:23(UTC)  | Reason: Not specified

Offline omorr  
#11 Posted : 27 October 2009 18:38:32(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
LordMike wrote:
omorr wrote:
LordMike wrote:
EDIT: (omorr edited)
Hmm.. That's not practical. Seriously...

I agree Mike, but at the moment SMath is working this way. Andrey is doing his best to improve it. Xcas as a symbolic engine and plugin will make solving equations and integration real symbolically. Maybe some other symbolic engines as plugins will be included in the future.

EDIT: Hmm... Did I make a mistake - it is different than yours?
solve(-sin(x)≡0;x;0;2*π)=mat(0;3,142;2;1)
sin(el(solve(-sin(x)≡0;x;0;2*π);1))=0
sin(el(solve(-sin(x)≡0;x;0;2*π);2))=-5,787*10^{-12}

or setting 10 decimal places

sin(el(solve(-sin(x)≡0;x;0;2*π);2))=3,2310851043*10^{-15}


I had 3 decimal places... Dunno what you had on the first one ...

EDIT:
10 decimal spaces:
-1.0206823939*10^{-11}

Have no explanation about this, sorry ????
EDIT: I think I found it. It seems the release v0.85_3531 (the official one) gives your result. I think that some fixes are applied in the meantime. My results are from the recent ones v0.85_3545 and v0.85_3578.Alpha.

Edited by user 27 October 2009 19:06:27(UTC)  | Reason: Not specified

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Andrey Ivashov  
#12 Posted : 27 October 2009 19:02:47(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Will check at home.
Offline dm  
#13 Posted : 07 April 2010 21:21:59(UTC)
dm

Rank: Newbie

Groups: Registered
Joined: 07/04/2010(UTC)
Posts: 1

In stable version 0.87 I still have this:

degree setting:
a=0
b=90
cos a =1
cos b =2,9371118168*10^{-14}

radians seems correct.

Thanks in advance.
Users browsing this topic
Guest
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.