fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. long double GiveCx(long double x)
  6. {
  7. double a = 5.3226927610784935E-01;
  8. double b = 6.5410208763684241E-01;
  9. double c = -1.4312869957125389E+00;
  10. double d = 8.4710834303177074E-01;
  11. return (c*atanl(expl(x-a)/b) + d);
  12. }
  13.  
  14. double BurkardtCollectionBased_sech_cdf_Offset_model(double x)
  15. {
  16. double temp;
  17. temp = 0.0;
  18. // coefficients
  19. double a = 5.3226927610784935E-01;
  20. double b = 6.5410208763684241E-01;
  21. double c = -1.4312869957125389E+00;
  22. double d = 8.4710834303177074E-01;
  23. return c * atan(exp(x-a)/b) + d;
  24. }
  25.  
  26. int main()
  27. {
  28. int ix;
  29. for (ix=0; ix<5; ix++)
  30. printf(" ix = %d ; c = %.20f ; %.20Lf \n", ix, BurkardtCollectionBased_sech_cdf_Offset_model( (long double)ix), GiveCx((long double )ix));
  31. return 0;
  32. }
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
 ix = 0 ; c = -0.20004050665796929698  ;  -0.20004050665796930359 
 ix = 1 ; c = -0.84455584419096485504  ;  -0.84455584419096496618 
 ix = 2 ; c = -1.18701705113792033153  ;  -1.18701705113792041978 
 ix = 3 ; c = -1.32186430467910986941  ;  -1.32186430467910977205 
 ix = 4 ; c = -1.37195787094497578806  ;  -1.37195787094497580628