Compare commits

...

3 commits

Author SHA1 Message Date
5956361088 And tangent 2022-10-27 23:53:21 -05:00
4bca9fd69d easy peasy 2022-10-27 23:51:48 -05:00
e813668878 Comment tweak, we still have exp 2022-10-27 23:27:03 -05:00
3 changed files with 13 additions and 2 deletions

View file

@ -9,8 +9,9 @@
I was stuck on how to actually implement the Taylor series without it
getting far too big for even a long double, and I'm not sure I ever would
have thought to just break it out recursively like this. Instead of each
term being x^n/n!, this says that it's (x/n+1)*(nth term), with a base case
of x/1! = x. Pretty clever, really.
term being x^n/n!, where we have to figure out both x^n and n!, both of which
could be massive, we instead say that it's (x/n+1)*(nth term), with a base
case (1st term) of x/1! = x. Pretty clever, really.
Also, really glad I know how to at least read a basic FORTRAN program. This
probably would have been a little more annoying if I didn't.

5
math/sin.c Normal file
View file

@ -0,0 +1,5 @@
#include <math.h>
double sin(double x) {
return cos(x - M_PI_2);
}

5
math/tan.c Normal file
View file

@ -0,0 +1,5 @@
#include <math.h>
double tan(double x) {
return (cos(x - M_PI_2) / cos(x))
}