/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
#include<math.h>

double hypot(double x, double y) {
    void *fptr;
    double retval;

    if(isnan(x) || isnan(y)) /* some native implementation give hypot(+/-INF, NAN) == INF */
      return NAN;
    fptr = dlsym(_Chmath_handle, "hypot_chdl");
    if(fptr == NULL)  {
       printf("Error: %s(): dlsym(): %s\n", __func__, dlerror());
       return -1;
    }
    dlrunfun(fptr, &retval, hypot, x, y);
    return retval;
}
