flat assembler
Message board for the users of flat assembler.

 Index > Heap > Is sinx+cosx=sqrt(1+sin(2x))
Author
prostyle4444

Joined: 28 Jun 2013
Posts: 22
Location: Bootsector
prostyle4444
I know this is a basic question. But i am curious about this function. Is this function correct?
Code:
```
sinx + cosx =
sqrt(sinx + cosx)^2 =
sqrt(1 + sin(2x))
(by using function
(sinx + cosx)^2 =
(1 + sin(2x)) ).
```
27 Jul 2014, 16:53
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 17278
revolution
The sqrt function has both positive and negative roots so you need to be careful to state which root you are referring to. For example at x=pi you need to take the negative root, whereas at x=0 you need to take the positive root.
27 Jul 2014, 18:26
Dr F

Joined: 01 Apr 2014
Posts: 239
Location: Berehove, Ukraine
Dr F
stupid
27 Jul 2014, 20:19
neville

Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville
prostyle4444, a little clarification may be helpful here. In algebra, the sqrt function is assumed to include both the positive and negative values. So by convention, "sqrt(x)" means "+/-sqrt(x)" i.e. "plus or minus the sqrt of x". Sometimes an equation needs to be limited to only positive or only negative values, in which case the sign will be specified i.e. +sqrt(x) or -sqrt(x). However that is not the case with your equation, so what you've written is 100% correct

_________________
FAMOS - the first memory operating system
27 Jul 2014, 23:44
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum