Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Inverse Functions in Math

Reply
Thread Tools

Inverse Functions in Math

 
 
a.dheeraj.kumar@gmail.com
Guest
Posts: n/a
 
      07-01-2005
i know that there is a function to find the logarithm of a number, sin,
cos, tan etc. but are there which can find sin^-1, cos^-1, tan^-1 and
antilog of a given number?

PS: sin^-1 means sin inverse. eg:
if sin 30 =1/2
30=sin inverse of 1/2

HELP!

 
Reply With Quote
 
 
 
 
Dik T. Winter
Guest
Posts: n/a
 
      07-01-2005
In article < .com> writes:
> i know that there is a function to find the logarithm of a number, sin,
> cos, tan etc. but are there which can find sin^-1, cos^-1, tan^-1 and
> antilog of a given number?
>
> PS: sin^-1 means sin inverse. eg:
> if sin 30 =1/2
> 30=sin inverse of 1/2


asin, acos, atan and exp.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
 
Reply With Quote
 
 
 
 
a.dheeraj.kumar@gmail.com
Guest
Posts: n/a
 
      07-01-2005
thanks man, i understood all functions except exp function.

can you tell me how to use this function to find the antilog of
0.something to base 10, and also how to make it work for different bases

 
Reply With Quote
 
REH
Guest
Posts: n/a
 
      07-01-2005

<> wrote in message
news: oups.com...
> thanks man, i understood all functions except exp function.
>
> can you tell me how to use this function to find the antilog of
> 0.something to base 10, and also how to make it work for different bases
>


The exp function is just like the pow function but with a constant base,
namely e. If you want "exp" with 10 or other bases, use pow.

REH


 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      07-01-2005
In article < .com>,
<> wrote:
>thanks man, i understood all functions except exp function.


>can you tell me how to use this function to find the antilog of
>0.something to base 10, and also how to make it work for different bases


(Using non-C notation in this portion)

Log{N}[x] -> ln[x] / ln[N]

so

ln[x] -> Log{N}[x] * ln[N]

so

exp[ln[x]] -> exp[ Log{N}[x] * ln[N] ]

hence

x -> exp[ Log{N}[x] * ln[N] ]

Hence, to find the antilog of something base 10, Y, take
(using C notation)

exp(Y * log(10.))


For example, log10(1000.) = 3., ln(10.) ~= 2.3025851, and
exp( 3. * 2.3025851 ) = exp( 6.9077553 ) ~= 1000.0

--
Studies show that the average reader ignores 106% of all statistics
they see in .signatures.
 
Reply With Quote
 
Rouben Rostamian
Guest
Posts: n/a
 
      07-01-2005
In article <da3t5q$4hi$>,
Walter Roberson <> wrote:
>
>Hence, to find the antilog of something base 10, Y, take
>(using C notation)
>
> exp(Y * log(10.))


Or simply:

pow(10., Y)


--
Rouben Rostamian
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      07-01-2005
wrote:
>
> i know that there is a function to find the logarithm of a number, sin,
> cos, tan etc. but are there which can find sin^-1, cos^-1, tan^-1 and
> antilog of a given number?
>
> PS: sin^-1 means sin inverse. eg:
> if sin 30 =1/2
> 30=sin inverse of 1/2


Such as arcsin or asin, and exp?

--
Chuck F () ()
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!

 
Reply With Quote
 
Martin Ambuhl
Guest
Posts: n/a
 
      07-01-2005
wrote:
> thanks man, i understood all functions except exp function.
>
> can you tell me how to use this function to find the antilog of
> 0.something to base 10, and also how to make it work for different bases

pow(base, x) == exp(x * log(base)) :


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <time.h>


int main(void)
{
double x, y;
int i;
double M_log10 = log(10);
srand(time(0));

printf("exp(x) is the antilog(x, base=%.*g)\n\n", DBL_DIG, exp(1));

for (i = 0; i < 10; i++) {
x = rand() / (1. + RAND_MAX);
y = exp(x),
printf("exp(%g) = %g, log(%g) = %g\n", x, y, y, log(y));
y = pow(10, x);
printf("pow(10, %g) = %g, log10(%g) = %g\n", x, y, y, log10(y));
y = exp(x * M_log10);
printf("exp(%g * log(10)) = %g, log10(%g) = %g\n\n",
x, y, y, log10(y));
}
return 0;
}


This is the result of one run:

exp(x) is the antilog(x, base=2.71828182845905)

exp(0.54030 = 1.71654, log(1.71654) = 0.540308
pow(10, 0.54030 = 3.46983, log10(3.46983) = 0.540308
exp(0.540308 * log(10)) = 3.46983, log10(3.46983) = 0.540308

exp(0.655142) = 1.92542, log(1.92542) = 0.655142
pow(10, 0.655142) = 4.52004, log10(4.52004) = 0.655142
exp(0.655142 * log(10)) = 4.52004, log10(4.52004) = 0.655142

exp(0.430014) = 1.53728, log(1.5372 = 0.430014
pow(10, 0.430014) = 2.69162, log10(2.69162) = 0.430014
exp(0.430014 * log(10)) = 2.69162, log10(2.69162) = 0.430014

exp(0.656084) = 1.92723, log(1.92723) = 0.656084
pow(10, 0.656084) = 4.52985, log10(4.52985) = 0.656084
exp(0.656084 * log(10)) = 4.52985, log10(4.52985) = 0.656084

exp(0.567552) = 1.76394, log(1.76394) = 0.567552
pow(10, 0.567552) = 3.69447, log10(3.69447) = 0.567552
exp(0.567552 * log(10)) = 3.69447, log10(3.69447) = 0.567552

exp(0.346806) = 1.41454, log(1.41454) = 0.346806
pow(10, 0.346806) = 2.22232, log10(2.22232) = 0.346806
exp(0.346806 * log(10)) = 2.22232, log10(2.22232) = 0.346806

exp(0.418147) = 1.51914, log(1.51914) = 0.418147
pow(10, 0.418147) = 2.61907, log10(2.61907) = 0.418147
exp(0.418147 * log(10)) = 2.61907, log10(2.61907) = 0.418147

exp(0.859071) = 2.36097, log(2.36097) = 0.859071
pow(10, 0.859071) = 7.22888, log10(7.2288 = 0.859071
exp(0.859071 * log(10)) = 7.22888, log10(7.2288 = 0.859071

exp(0.824404) = 2.28052, log(2.28052) = 0.824404
pow(10, 0.824404) = 6.67427, log10(6.67427) = 0.824404
exp(0.824404 * log(10)) = 6.67427, log10(6.67427) = 0.824404

exp(0.225011) = 1.25234, log(1.25234) = 0.225011
pow(10, 0.225011) = 1.67885, log10(1.67885) = 0.225011
exp(0.225011 * log(10)) = 1.67885, log10(1.67885) = 0.225011
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
Math::erfinv inverse error function Bil Kleb Ruby 2 06-14-2008 08:57 PM
math.h trig functions questions (and some forgotten high school math) Mark Healey C Programming 7 05-22-2006 10:42 AM
Re: Is still math.h the C++ math library ? AciD_X C++ 4 04-01-2004 07:29 PM
Why can I not use: Math a=new Math(); chirs Java 18 03-02-2004 06:00 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57