Newsgroups: sci.math.num-analysis, alt.lang.asm, comp.programming
From: "io_x" <a...@b.c.invalid>
Date: Mon, 16 Apr 2012 09:01:10 +0200
Local: Mon, Apr 16 2012 3:01 am
Subject: Re: Exp() function reloaded
"pete" <pfil...@mindspring.com> ha scritto nel messaggio
> hopcode wrote:
Pet's one is better and fast of what i use...
>> Hi,
>> it is ~40 lines of code (my Taylors's exp() code + main routine)
> I've code Taylors's exp(x) for both positive and negative x in C,
> /* BEGIN new.c output */
> fs_expl(20.3) is 654904512.153239
> fs_expl(-20.3) is 1.526940e-009
> /* END new.c output */
#include <stdio.h>
#define u32 unsigned
#define F for
double ke=2.7182818284590452353602874713527;
long double fs_expl(long double x)
con=0;
}
// alcune cose [quelle giuste]
// provengono da "Satoshi Tomabechi" // per il resto non so 100% come funziona... // 0 per errore altrimenti ritorna il numero di cicli u32 mexp(double* r, double espon) {double ip, fp, t, x; u32 v, w, i; i=0;
}
int main(void)
{long double xx, dd; double d, r, x, y; u32 i; dd=12.1929292992; d=dd; x=exp(d); i=mexp(&y,d); P("exp(%.20f)=%.20f, %.20f i=%d\n", d, x, y, i); xx=fs_expl(dd); x=xx; P("exp(%.20f)=%.20f i=%d\n", d, x, con); R 0; }
exp(12.19292929919999935000)=197388.53005457221300000000,
197388.53005457215480000000 i=144 exp(12.19292929919999935000)=197388.53005457221300000000 i=18 You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||