Home | Develop | Download | Contact
example.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <pds/pdsmath.h>
4 #include <float.h>
5 
6 int main(int argc, char** argv)
7 {
8  double x,y,z;
9 
10  for(x=0.001;x<0.5;x=x+0.05)
11  {
12  y=pds_hb(x);
13  z=pds_hbinv(y);
14 
15  printf("x=%f\ty=hb(x)=%f\t",x,y);
16  printf("z=hbinv(y)=%f\t",z);
17  printf("ERROR=%6.4f ppm\n",(x-z)*1000000/x);
18  }
19 
20  return EXIT_SUCCESS;
21 }
double pds_hb(double x)
Evalúa la función de entropía binaria Hb(x)=-x*log2(x)-(1-x)*log2(1-x).
double pds_hbinv(double h)
Retorna el valor x de la función de entropía binaria para un valor de h aproximadamente igual a Hb(x)...

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed