delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/08/10:50:44

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-ORBL: [68.122.14.128]
Message-ID: <4347DCA7.8060306@myrealbox.com>
Date: Sat, 08 Oct 2005 07:50:15 -0700
From: Tim Prince <tprince AT myrealbox DOT com>
Reply-To: tprince AT computer DOT org
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921
MIME-Version: 1.0
To: Joost Kraaijeveld <J DOT Kraaijeveld AT Askesis DOT nl>
CC: tprince AT computer DOT org, Cygwin <cygwin AT cygwin DOT com>
Subject: Re: configure and asinl function problem
References: <1128766196 DOT 20665 DOT 124 DOT camel AT Panoramix> <4347CC39 DOT 6090903 AT myrealbox DOT com> <1128780609 DOT 20665 DOT 158 DOT camel AT Panoramix>
In-Reply-To: <1128780609.20665.158.camel@Panoramix>

Joost Kraaijeveld wrote:
> 
> The problem is that configure seems to think that there *is* support 
> "long double math": the test succeeds and HAVE_ASINL (and all other
> double math) is defined. So both compile and link appear to be succesful
> as far as configure is concerned.
> 
> Before choosing a solution, I want to understand why the problem is
> occuring.
> 
> According to the cited mail however, that is because configure checks
> the availibility of "long double math" with a short piece of code,
> supplying *it's own* function definition (and not using e.g. math.h) and
> linking with *some* libraries. Because I do not understand how configure
> is doing that (I have looked into the macros but failed to understand
> them), I do not know what exactly the code is configure is using or to
> which libraries configure links the executable. I think btw that it is
> using libstdc++:
> $ objdump.exe -t libstdc++.a | grep asinl
> [  2](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x00000020 _asinl
> 


If the application has a configure which simply checks for some 
instances of extra precision, without actually checking the presence of 
each function in the headers and libraries to be used, that seems 
broken.  There are plenty of expert models for such configure scripts, 
such as the one used in the libstdc++ build itself.  Maybe we should 
look into how libstdc++ decides it can support asinl() on Cygwin.  Did 
you check whether it is actually using long double, or some mixture of 
double and long double?  I'll try to remember to look next time I build 
libstdc++.

In case the application is serious about wanting more accuracy than 
asin(), I'll point out that the usual macro-like definitions using code 
like atan2l(x,sqrtl(1-x*x) will lose up to 9 bits of precision, compared 
with atan2l(x,sqrtl((1+x)*(1-x))). The former version is accurate (and 
faster) only on architecture with infinite precision fused multiply-add.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019