Click here to Skip to main content
15,892,737 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Seeking A Solution Pin
cp987623-Jun-10 21:28
cp987623-Jun-10 21:28 
GeneralRe: Seeking A Solution Pin
harold aptroot23-Jun-10 21:48
harold aptroot23-Jun-10 21:48 
GeneralRe: Seeking A Solution Pin
cp987624-Jun-10 1:08
cp987624-Jun-10 1:08 
GeneralRe: Seeking A Solution Pin
cp987624-Jun-10 1:22
cp987624-Jun-10 1:22 
GeneralRe: Seeking A Solution Pin
harold aptroot24-Jun-10 1:50
harold aptroot24-Jun-10 1:50 
GeneralRe: Seeking A Solution Pin
cp987624-Jun-10 3:26
cp987624-Jun-10 3:26 
GeneralRe: Seeking A Solution Pin
Roger Wright26-Jun-10 19:54
professionalRoger Wright26-Jun-10 19:54 
GeneralRe: Seeking A Solution Pin
cp987627-Jun-10 0:57
cp987627-Jun-10 0:57 
Roger Wright wrote:
When you refer to a first order expansion, what is it you're expanding? Taylor series?


Just do a Taylor expansion

x - sin(x) = x - (x - x^3/3! + ..) = y

as x->0 only the lowest powers are significant, so

x^3 / 6 = y

or x = (6y)^(1/3)

The rest of the approximation stuff is guesswork, and using something like Excel to see how well you are going. It's a bit of a game that's fun to play occasionally.

Using Excel and the solve function you can get a nice tidy approximation that's probably better for implementation:

x = (ay)^(1/3) + by + cy^2

a = 5.998854
b = 0.10235
c = 0.01579

the relative error is less than 2.7 x 10^-5 over the range 0 <= y <= pi/2 - 1

If you need better than this, one NR iteration gets you to 10^-10 territory and one more should pretty well get you full double precision.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: Seeking A Solution Pin
Roger Wright27-Jun-10 3:56
professionalRoger Wright27-Jun-10 3:56 
GeneralRe: Seeking A Solution Pin
cp987627-Jun-10 19:33
cp987627-Jun-10 19:33 
Questionx^2+y^2+z^2=g^2 Pin
Aristid Papado14-Jun-10 16:43
Aristid Papado14-Jun-10 16:43 
AnswerRe: x^2+y^2+z^2=g^2 Pin
Luc Pattyn14-Jun-10 16:45
sitebuilderLuc Pattyn14-Jun-10 16:45 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Aristid Papado14-Jun-10 17:06
Aristid Papado14-Jun-10 17:06 
AnswerRe: x^2+y^2+z^2=g^2 Pin
Kevin Drzycimski14-Jun-10 19:02
Kevin Drzycimski14-Jun-10 19:02 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Aristid Papado15-Jun-10 2:04
Aristid Papado15-Jun-10 2:04 
GeneralRe: x^2+y^2+z^2=g^2 [modified] Pin
Kevin Drzycimski15-Jun-10 2:09
Kevin Drzycimski15-Jun-10 2:09 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Aristid Papado15-Jun-10 3:37
Aristid Papado15-Jun-10 3:37 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Kevin Drzycimski15-Jun-10 4:14
Kevin Drzycimski15-Jun-10 4:14 
GeneralRe: x^2+y^2+z^2=g^2 Pin
kenfry1322-Jun-10 15:00
kenfry1322-Jun-10 15:00 
AnswerRe: x^2+y^2+z^2=g^2 Pin
Roger Wright15-Jun-10 3:21
professionalRoger Wright15-Jun-10 3:21 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Aristid Papado15-Jun-10 3:52
Aristid Papado15-Jun-10 3:52 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Luc Pattyn15-Jun-10 4:16
sitebuilderLuc Pattyn15-Jun-10 4:16 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Roger Wright15-Jun-10 5:55
professionalRoger Wright15-Jun-10 5:55 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Luc Pattyn15-Jun-10 10:59
sitebuilderLuc Pattyn15-Jun-10 10:59 
GeneralRe: x^2+y^2+z^2=g^2 Pin
Roger Wright15-Jun-10 15:45
professionalRoger Wright15-Jun-10 15:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.