Commit Graph

1 Commits

Author SHA1 Message Date
Corinna Vinschen 183e5f0a15 Cygwin: take hypotl function from Mingw-w64
The simple newlib hypotl for real long double architectures is too
simple at this point.  It's implemented as a real call to sqrtl(x^2+y^2).
This has a fatal tendency to overflow for big input numbers.  Hypotl
isn't supposed to do that if the result would still be valid in range of
long double.

Given the complexity of implementing hypotl for various architectures,
we just take the hypotl function from Mingw-w64, which is in the public
domain.

Even though this hypotl is an architecture-independent implementation,
we can't use it for newlib yet, unfortunately, because it requires logbl
under the hood.  Logbl is yet another function missing in newlib for
real long double architectures.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-04-19 12:39:30 +02:00