Example #1
0
void z_log(doublecomplex *r, doublecomplex *z)
#endif
{
    double zi = z->i, zr = z->r;
    r->i = atan2(zi, zr);
    r->r = log( f__cabs( zr, zi ) );
    }
Example #2
0
void z_log(doublecomplex *r, doublecomplex *z)
#endif
{

r->i = atan2(z->i, z->r);
r->r = log( f__cabs( z->r, z->i ) );
}
Example #3
0
void c_log(complex *r, complex *z)
#endif
{
        double zi, zr;
        r->i = atan2(zi = z->i, zr = z->r);
        r->r = log( f__cabs(zr, zi) );
        }
Example #4
0
/* PURE _scale_logc PURE */
complex _scale_logc(complex expr)
{
  complex result;

  result.i = atan2(expr.i, expr.r);
  result.r = log(f__cabs(expr.r, expr.i));
  return result;
}
Example #5
0
void c_log(complex *resx, complex *z)
#endif
{
complex res;

res.i = atan2(z->i, z->r);
res.r = log( f__cabs(z->r, z->i) );

resx->r = res.r;
resx->i = res.i;
}
Example #6
0
/* PURE _scale_pow_zz PURE */
void _scale_pow_zz(doublecomplex *r, doublecomplex *a, doublecomplex *b)
{
  double logr, logi, x, y;

  logr = log(f__cabs(a->r, a->i));
  logi = atan2(a->i, a->r);

  x = exp(logr * b->r - logi * b->i);
  y = logr * b->i + logi * b->r;

  r->r = x * cos(y);
  r->i = x * sin(y);
}
Example #7
0
void z_sqrt(doublecomplex *r, doublecomplex *z)
#endif
{
	double mag, zi = z->i, zr = z->r;

	if( (mag = f__cabs(zr, zi)) == 0.)
		r->r = r->i = 0.;
	else if(zr > 0)
		{
		r->r = sqrt(0.5 * (mag + zr) );
		r->i = zi / r->r / 2;
		}
	else
		{
		r->i = sqrt(0.5 * (mag - zr) );
		if(zi < 0)
			r->i = - r->i;
		r->r = zi / r->i / 2;
		}
	}
Example #8
0
void c_sqrt(complex *r, complex *z)
#endif
{
  double mag, t;

  if ((mag = f__cabs(z->r, z->i)) == 0.)
    r->r = r->i = 0.;
  else if (z->r > 0)
  {
    r->r = t = sqrt(0.5 * (mag + z->r));
    t = z->i / t;
    r->i = 0.5 * t;
  }
  else
  {
    t = sqrt(0.5 * (mag - z->r));
    if (z->i < 0)
      t = -t;
    r->i = t;
    t = z->i / t;
    r->r = 0.5 * t;
  }
}
Example #9
0
void c_sqrt(complex *r, complex *z)
#endif
{
        double mag, t;
        double zi = z->i, zr = z->r;

        if( (mag = f__cabs(zr, zi)) == 0.)
                r->r = r->i = 0.0f;
        else if(zr > 0)
                {
                r->r = (real)(t = sqrt(0.5 * (mag + zr) ));
                t = zi / t;
                r->i = (real)( 0.5 * t);
                }
        else
                {
                t = sqrt(0.5 * (mag - zr) );
                if(zi < 0)
                        t = -t;
                r->i = (real)t;
                t = zi / t;
                r->r = (real)(0.5 * t);
                }
        }
Example #10
0
File: c_log.c Project: troore/scale
void c_log(complex *r, complex *z)
#endif
{
r->i = atan2(z->i, z->r);
r->r = log( f__cabs(z->r, z->i) );
}
Example #11
0
double c_abs(complex *z)
#endif
{
return( f__cabs( z->r, z->i ) );
}
Example #12
0
File: c_abs.c Project: troore/scale
double c_abs(complex *z)
{
  return  f__cabs(z->r, z->i);
}
Example #13
0
/* PURE _scale_absc PURE */
float _scale_absc(complex arg)
{
  /* defined in libScaleF77 */
  return f__cabs((double) arg.r, (double) arg.i);
}
Example #14
0
/**
 * Used by Fortran.
 */
float _scale_cabs(complex arg)
{
  return f__cabs((double) arg.r, (double) arg.i);
}
Example #15
0
/* PURE _scale_absz PURE */
double _scale_absz(doublecomplex arg)
{
  /* defined in libScaleF77 */
  return f__cabs(arg.r, arg.i);
}