dlabad.c 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* dlabad.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. /* Subroutine */ int _starpu_dlabad_(doublereal *small, doublereal *large)
  14. {
  15. /* Builtin functions */
  16. double d_lg10(doublereal *), sqrt(doublereal);
  17. /* -- LAPACK auxiliary routine (version 3.2) -- */
  18. /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
  19. /* November 2006 */
  20. /* .. Scalar Arguments .. */
  21. /* .. */
  22. /* Purpose */
  23. /* ======= */
  24. /* DLABAD takes as input the values computed by DLAMCH for underflow and */
  25. /* overflow, and returns the square root of each of these values if the */
  26. /* log of LARGE is sufficiently large. This subroutine is intended to */
  27. /* identify machines with a large exponent range, such as the Crays, and */
  28. /* redefine the underflow and overflow limits to be the square roots of */
  29. /* the values computed by DLAMCH. This subroutine is needed because */
  30. /* DLAMCH does not compensate for poor arithmetic in the upper half of */
  31. /* the exponent range, as is found on a Cray. */
  32. /* Arguments */
  33. /* ========= */
  34. /* SMALL (input/output) DOUBLE PRECISION */
  35. /* On entry, the underflow threshold as computed by DLAMCH. */
  36. /* On exit, if LOG10(LARGE) is sufficiently large, the square */
  37. /* root of SMALL, otherwise unchanged. */
  38. /* LARGE (input/output) DOUBLE PRECISION */
  39. /* On entry, the overflow threshold as computed by DLAMCH. */
  40. /* On exit, if LOG10(LARGE) is sufficiently large, the square */
  41. /* root of LARGE, otherwise unchanged. */
  42. /* ===================================================================== */
  43. /* .. Intrinsic Functions .. */
  44. /* .. */
  45. /* .. Executable Statements .. */
  46. /* If it looks like we're on a Cray, take the square root of */
  47. /* SMALL and LARGE to avoid overflow and underflow problems. */
  48. if (d_lg10(large) > 2e3) {
  49. *small = sqrt(*small);
  50. *large = sqrt(*large);
  51. }
  52. return 0;
  53. /* End of DLABAD */
  54. } /* _starpu_dlabad_ */