R: R: LOG(x) BASIC function

1999-03-22 Thread Stefano Fronteddu

Right, good observation ;-)
  Thanks,
  Stefano
-Messaggio originale-
Da: shevek <[EMAIL PROTECTED]>
A: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Data: lunedì 22 marzo 1999 14.32
Oggetto: Re: R: LOG(x) BASIC function


>On Fri, 19 Mar 1999, Stefano Fronteddu wrote:
>
>> Taylors rule says that
>>
>> log (1+x) = x - x^2/2 + x^3/3 +  + (x^(2n+1)) / (2n+1)!
>>
>> so
>>
>> log x = (x-1) - (x-1)^2/2 + ... +(-1)^n-1 * ((x-1)^n) / n
>
>This is correct, but remember that this is an approximation near x=0 (in
>the original form), so if you want to know log(100), it will have a large
>error. For more correct values over the whole interval (you need to
>specify one, preferribly not being infinitely long), there are other ways
>that take longer for each step, but come much closer to the desired
>function if x is large.
>
>Bye,
>shevek
>
>
>
>MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and
put
>in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
>quotes :-) Problems? contact [EMAIL PROTECTED]
(www.stack.nl/~wiebe/mailinglist/)
>



MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)




Re: R: LOG(x) BASIC function

1999-03-22 Thread shevek

On Fri, 19 Mar 1999, Stefano Fronteddu wrote:

> Taylors rule says that 
> 
> log (1+x) = x - x^2/2 + x^3/3 +  + (x^(2n+1)) / (2n+1)!
> 
> so
> 
> log x = (x-1) - (x-1)^2/2 + ... +(-1)^n-1 * ((x-1)^n) / n

This is correct, but remember that this is an approximation near x=0 (in
the original form), so if you want to know log(100), it will have a large
error. For more correct values over the whole interval (you need to
specify one, preferribly not being infinitely long), there are other ways
that take longer for each step, but come much closer to the desired
function if x is large.

Bye,
shevek



MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)




R: LOG(x) BASIC function

1999-03-19 Thread Stefano Fronteddu


>very much like a log. You could use the taylor-series, which can be
>calculated quite quick, but is not a very good approximation. I don't know
>the taylor-series by heart, but I could look it up. In case you want to
>start programming, it will be of the form:
>y=a+bx+cx^2+dx^3+


Taylors rule says that 

log (1+x) = x - x^2/2 + x^3/3 +  + (x^(2n+1)) / (2n+1)!

so

log x = (x-1) - (x-1)^2/2 + ... +(-1)^n-1 * ((x-1)^n) / n

I hope to be helpful to you, bye
  Stefano
---
Fronteddu Stefano
Student in Software Engineering
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://members.xoom.it/dudduMSX, Sardinia, Robotics, Friends
http://computer.digiland.it/1461   MSX Soft Tips Page
Member of Miri Software - Italy  http://Frengo.dragonfire.net/MSX.HTM
ICQ: 21401454
0338/3645458



MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)