Mathc initiation/c34cb

Un livre de Wikilivres.


Sommaire


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


c00b.c
/* --------------------------------- */
/* save as c00b.c                    */
/* --------------------------------- */
#include  "x_hfile.h"
#include       "fb.h"
/* --------------------------------- */
int main(void)
{
double M = simpson_dydx(f, ay,by,LOOP, ax,bx,LOOP);
 
 clrscrn();
 
 printf(" f  : (x,y)-> %s  \n\n",  feq);
 
 printf(" by :   (x)-> %s    \n", byeq); 
 printf(" ay :   (x)-> %s  \n\n", ayeq);
 
 printf(" bx :         %s    \n", bxeq);
 printf(" ax :         %s\n\n\n", axeq);

 printf(" With the simpson's rule.\n\n");
 printf("    (%.3f  (%s\n",      bx,byeq);
 printf(" int(    int(       %s  dy dx = %.6f\n", feq, M);
 printf("    (%.3f  (%s\n\n\n",  ax,ayeq);

 stop();

 return 0;
}
/* --------------------------------- */
/* --------------------------------- */
 Même résultat que la version avec l'algorithme des trapèzes à quelques décimales près.

Exemple de sortie écran :

 f  : (x,y)-> 1  

 by :   (x)-> 8-(x**2/2)    
 ay :   (x)-> 2-(x/2)  

 bx :         +4    
 ax :         -3


 With the simpson's rule.

    (4.000  (8-(x**2/2)
 int(    int(       1  dy dx = 28.583333
    (-3.000  (2-(x/2)


 Press return to continue.