Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

«Exercise» Numeric Est. of Smooth Functions

Name: Anonymous 2010-09-23 7:50

/prog/ Exercise

Write an implementation of that gives the numeric approximation of a smooth function (infinitely differentiable) such as tangent(x), cosine(x), or log(x) with an adjustable level of precision in a desired programming language.  Please briefly describe the method or algorithm used in your code to approximate the function. If desired, it is acceptable to not reply.

XAMPLE.

Function ex
Method Maclaurin
Language ANSI C

#include <stdio.h>
double e(double e, int p)
{
    double x=1,y=1; int i=1,j=1;
    for(;i<p;++i) {
        y*=e,j*=i;
        x+=y/j;
    }
    return x;
}
int main()
{
    double x = 1;
    int p = 11;
    printf("e^%f ≈ %.8f\n| Error | ≤ %f^%d/%d!\n", x, e(x,p), x, ++p, p);
}

Name: Anonymous 2010-09-23 13:47

>>10
That's the second time I've been accused of being Xarn this week.

But it's true, look it up.

Name: Anonymous 2010-09-23 13:49

>>15
Hotaru likes to pretend everyone who disagrees with him is Xarn. Just take it as a compliment.

Name: Anonymous 2010-09-23 14:32

>>16
Xarn likes to pretend everyone who disagrees with him is Hotaru.

Name: Anonymous 2010-09-23 14:36

Xarn is the only one of /proŋ/ who both uses ``faggot quotes'' and is able to make a post nitpicking about ancient language guidelines that are long obsolete and unnecessary.

Name: Anonymous 2010-09-23 14:52

>>18
>>9,15 here
I use ``faggot quotes'' jokingly. And yes, I love being a pedantic asshole.

Name: Anonymous 2010-09-23 15:54

Xarn bashers are like the web developers on /r/programming: nobody likes them, they shit up every thread they post in, but they're somehow convinced that they're in the majority and that the community would be worse without them.
Fuck off already.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List