#math - Thu 12 Apr 2007 between 01:55 and 01:59

NY Lost Funds



HiLandermot_: <HiLander> line 27 is wrong
mot_see how i set n to the return value of int() ?
how is 27 wrong?
thermoplyaeMaybe 7 is too far out on the Taylor series
Try something like .25
HiLanderalso, i'm not seeing anythign wrong with intermediate computations
mot_i know int i and inc() are the same, but like i said it's eventually going to be a recursive function
HiLanderthermoplyae's comment is probably dead on
mot_well i just have to be able to compute sin(x)
thermoplyaeI love being dead on
HiLanderthen you better go farther than 5
mot_i'm testing it against the cmath library sin() function and my numbers are wildly, wildy off
thermoplyaePlease try .25 :(
HiLanderyou certainly need that each term is less than 1, so you need (2n+1)! > X^(2n+1)
ailndx-1^n * X^(2n+1)/(2n+1)! is that some sine approximation formula?
thermoplyaeailndx: Taylor series
whaleofconfusionthe problem is you are setting the result to X
as HiLander has been saying
mot_w00t
i fixed it (by doing my iterations of the series)
whaleofconfusionalso that your inc function is stupid
mot_i was just doing 0-5, 0-10 gives a better (almost 99% accurate) approximation
thermoplyaeI love being dead on
mot_whaleofconfusion, yes, i know, but it will be useful when i re-write the function recursively.
JabberWalkieyeah!...stupid.
whaleofconfusionwhy would you want to write it recursively
mot_because i have to
(because my professor is douche)
JabberWalkiegood reason
HiLanderno, it makes sense
it allows for precision to be handled on the fly
whaleofconfusionand you should not use the inc function
HiLanderinstead of ahead of time
whaleofconfusionyou should just use i
thermoplyaehmm
whaleofconfusionC++ is not made for recursion
thermoplyaeSeems like it would be faster to just shift the argument over into [-pi, pi] and then use the method he has now
mot_amazing, it works
i just needed to do more iterations
thermoplyaeRather than decide he needs to go out to the 101th term

Page: 2 9 16 23 30 37 44 51 58 65 

IrcArchive

NY Lost Funds