Csound Csound-dev Csound-tekno Search About

[Csnd] 2^(1/12) and other fractional exponents

Date2013-03-14 18:43
FromAdam Puckett
Subject[Csnd] 2^(1/12) and other fractional exponents
Hi,


I've been wondering how it is that computers analytically calculate
such functions as roots, fractional exponents and other such "magic"
such as trig functions.

Thanks,
Adam

Date2013-03-14 19:10
FromMartin Huenniger
SubjectRe: [Csnd] 2^(1/12) and other fractional exponents
Hi Adam,

a common way to compute sine and cosine functions is to use a taylor series expansion. http://en.wikipedia.org/wiki/Taylor_series

For the root function a Newton iteration is sometimes used http://en.wikipedia.org/wiki/Newton%27s_method

C/C++ uses the Floating-Point-Unit of the processor and so references the functions directly implemented in Hardware/microcode. FPU's use the CORDIC algorithm http://en.wikipedia.org/wiki/Cordic

Best,
Martin

Am 14.03.2013 um 19:43 schrieb Adam Puckett:

> Hi,
> 
> 
> I've been wondering how it is that computers analytically calculate
> such functions as roots, fractional exponents and other such "magic"
> such as trig functions.
> 
> Thanks,
> Adam
> 
> 
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 

_________________________
Martin Hünniger
a_s_tarantoga@yahoo.de
a-s-tarantoga.tumblr.com
soundcloud.com/a_s_tarantoga






Date2013-03-14 21:19
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] 2^(1/12) and other fractional exponents
> Hi Adam,
>
> a common way to compute sine and cosine functions is to use a taylor
> series expansion. http://en.wikipedia.org/wiki/Taylor_series
>

But tghe wrong way if you want any decent speed.  Tchebychev polynomials
is the correct way.  Try Code & Waite's book.


> For the root function a Newton iteration is sometimes used
> http://en.wikipedia.org/wiki/Newton%27s_method
>
> C/C++ uses the Floating-Point-Unit of the processor and so references the
> functions directly implemented in Hardware/microcode. FPU's use the CORDIC
> algorithm http://en.wikipedia.org/wiki/Cordic
>
> Best,
> Martin
>
> Am 14.03.2013 um 19:43 schrieb Adam Puckett:
>
>> Hi,
>>
>>
>> I've been wondering how it is that computers analytically calculate
>> such functions as roots, fractional exponents and other such "magic"
>> such as trig functions.
>>
>> Thanks,
>> Adam
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
> _________________________
> Martin Hünniger
> a_s_tarantoga@yahoo.de
> a-s-tarantoga.tumblr.com
> soundcloud.com/a_s_tarantoga
>
>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>             https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>
>