Aller au contenu

Mathc initiation/a267

Un livre de Wikilivres.


Sommaire


Installer et compiler ces fichiers dans votre répertoire de travail.

c2l.c
/* --------------------------------- */
/* save as c2l.c                     */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fl.h"
/* --------------------------------- */
int main(void)
{
double i;

 clrscrn();
 printf(" Does lim x->0 %s exist ?\n\n", feq);
 printf(" Substituing 0 for x gives 1**(oo).\n");
 stop();


 clrscrn();
 printf(" f : x-> %s\n\n", feq);

 printf(" Approximate f(x) by the right,\n");
 printf(" for x near 0.\n\n");

 for(i=1; i>0.1; i+=-.1)
     printf(" f(%+.0e) = %5.5f || f(%+.0e) = %5.5f || f(%+.0e) = %5.5f\n",
     i,    f(i),
     i*.01, f(i*.01),
     i*.0001,f(i*.0001)
     );
 stop();


 clrscrn();
 printf(" f : x-> %s\n\n", feq);

 printf(" Approximate f(x) by the left,\n");
 printf(" for x near 0.\n\n");

 for(i=-.9; i<-0.1; i+=.1)
     printf(" f(%+.0e) = %7.5f || f(%+.0e) = %5.5f || f(%+.0e) = %5.5f\n",
     i,    f(i),
     i*.01, f(i*.01),
     i*.0001,f(i*.0001)
     );
     
 printf(" \n\n");
 printf(" With the table we arrive at the following conjecture.\n\n");
 printf("     lim x->0 %s = e = (%+.5f)  \n\n", feq,exp(1));
 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */


Exemple de sortie écran :

 Does lim x->0 (1+x/6)**(6/x) exist ?

 Substituing 0 for x gives 1**(oo).
 Press return to continue. 


 f : x-> (1+x/6)**(6/x)

 Approximate f(x) by the right,
 for x near 0.

 f(+1e+00) = 2.52163 || f(+1e-02) = 2.71602 || f(+1e-04) = 2.71826
 f(+9e-01) = 2.53894 || f(+9e-03) = 2.71625 || f(+9e-05) = 2.71826
 f(+8e-01) = 2.55672 || f(+8e-03) = 2.71647 || f(+8e-05) = 2.71826
 f(+7e-01) = 2.57498 || f(+7e-03) = 2.71670 || f(+7e-05) = 2.71827
 f(+6e-01) = 2.59374 || f(+6e-03) = 2.71692 || f(+6e-05) = 2.71827
 f(+5e-01) = 2.61304 || f(+5e-03) = 2.71715 || f(+5e-05) = 2.71827
 f(+4e-01) = 2.63288 || f(+4e-03) = 2.71738 || f(+4e-05) = 2.71827
 f(+3e-01) = 2.65330 || f(+3e-03) = 2.71760 || f(+3e-05) = 2.71828
 f(+2e-01) = 2.67432 || f(+2e-03) = 2.71783 || f(+2e-05) = 2.71828
 f(+1e-01) = 2.69597 || f(+1e-03) = 2.71806 || f(+1e-05) = 2.71828
 Press return to continue. 


 f : x-> (1+x/6)**(6/x)

 Approximate f(x) by the left,
 for x near 0.

 f(-9e-01) = 2.95488 || f(-9e-03) = 2.72032 || f(-9e-05) = 2.71830
 f(-8e-01) = 2.92489 || f(-8e-03) = 2.72010 || f(-8e-05) = 2.71830
 f(-7e-01) = 2.89594 || f(-7e-03) = 2.71987 || f(-7e-05) = 2.71830
 f(-6e-01) = 2.86797 || f(-6e-03) = 2.71964 || f(-6e-05) = 2.71830
 f(-5e-01) = 2.84094 || f(-5e-03) = 2.71942 || f(-5e-05) = 2.71829
 f(-4e-01) = 2.81481 || f(-4e-03) = 2.71919 || f(-4e-05) = 2.71829
 f(-3e-01) = 2.78951 || f(-3e-03) = 2.71896 || f(-3e-05) = 2.71829
 f(-2e-01) = 2.76502 || f(-2e-03) = 2.71874 || f(-2e-05) = 2.71829
 f(-1e-01) = 2.74129 || f(-1e-03) = 2.71851 || f(-1e-05) = 2.71828
 

 With the table we arrive at the following conjecture.

     lim x->0 (1+x/6)**(6/x) = e = (+2.71828)  

 Press return to continue.