#include <libm-alias-float.h>
-#if LIBM_SVID_COMPAT
+#if LIBM_SVID_COMPAT && SHLIB_COMPAT (libm, GLIBC_2_0, GLIBC_2_43)
float
-__atan2f (float y, float x)
+__atan2_compatf (float y, float x)
{
float z;
__set_errno (ERANGE);
return z;
}
-libm_alias_float (__atan2, atan2)
+# ifdef NO_COMPAT_NEEDED
+strong_alias (__atan2_compatf, __atan2f)
+libm_alias_float (__atan2_compat, atan2)
+# else
+compat_symbol (libm, __atan2_compatf, atan2f, GLIBC_2_0);
+# endif
#endif
Copyright (c) 2022-2024 Alexei Sibidanov and Paul Zimmermann.
The original version of this file was copied from the CORE-MATH
-project (file src/binary32/atan2/atan2f.c, revision 7835c5d).
+project (file src/binary32/atan2/atan2f.c, revision 9b28a4a).
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
#include <math.h>
#include <stdint.h>
#include <libm-alias-finite.h>
+#include <libm-alias-float.h>
+#include <math-svid-compat.h>
#include "math_config.h"
static inline double
else
t -= 1;
}
- return asdouble (t);
+ double r = asdouble (t);
+ float rf = r;
+ if (__glibc_unlikely (rf == 0.0f))
+ return __math_uflowf (t >> 63);
+ return rf;
}
float
-__ieee754_atan2f (float y, float x)
+__atan2f (float y, float x)
{
static const double cn[] =
{
}
r = th + tm;
}
- return r;
+ float rf = r;
+ if (__glibc_unlikely (rf == 0.0f))
+ return __math_uflowf (asuint (rf) >> 1);
+ return rf;
}
+strong_alias (__atan2f, __ieee754_atan2f)
+#if LIBM_SVID_COMPAT
+versioned_symbol (libm, __atan2f, atan2f, GLIBC_2_43);
+libm_alias_float_other (__atan2, atan2)
+#else
+libm_alias_float (__atan2, atan2)
+#endif
libm_alias_finite (__ieee754_atan2f, __atan2f)
--- /dev/null
+/* m68k provides an optimized __ieee754_atan2f. */
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_atan2f_compat.c>
+#else
+# include <math-type-macros-float.h>
+# include <w_atan2_template.c>
+#endif