#include <math.h>


float isasugf_ (float *, float *, float *, float *, float *,
		float *, int *, int *);

double 
sugra (double am0, double am1, double aa0, double atb,
       double aasm, double MT, double MODE, double ch)
{
  float m0, m1, a0, tb, sm, mt, r;
  int p, q;

  m0 = am0;
  m1 = am1;
  a0 = aa0;
  tb = atb;
  sm = aasm;
  mt = MT;
  p = (int) floor (ch + 0.5);
  q = (int) floor (MODE + 0.5);

  r = isasugf_ (&m0, &m1, &a0, &tb, &sm, &mt, &q, &p);
  return (double) r;

}

float isagmbf_ (float *, float *, float *, float *, float *,
		float *, float *, int *, int *);

double 
gmsb (double am0, double am1, double aa0, double atb,
      double aasm, double xcgv, double MT, double MODE, double ch)
{
  float m0, m1, a0, tb, sm, mt, r, cgv;
  int p, q;

  m0 = am0;
  m1 = am1;
  a0 = aa0;
  tb = atb;
  sm = aasm;
  mt = MT;
  cgv = xcgv;
  p = (int) floor (ch + 0.5);
  q = (int) floor (MODE + 0.5);

  r = isagmbf_ (&m0, &m1, &a0, &tb, &sm, &cgv, &mt, &q, &p);
  return (double) r;

}

/*
   void main(void)
   {

   gmsb(1.0e4, 1.0e5, 10.0, 10.0, 1.0, -1.0, 175.0, 1.0, 1.0);
   }

 */
