[gambit-list] Which function in libm are portable enough to assume that they will be on all platforms?
Bradley Lucier
lucier at math.purdue.edu
Thu Oct 31 16:43:22 EDT 2013
On 10/31/2013 04:34 PM, Joe Doyle Ardent wrote:
> On Thu, Oct 31, 2013 at 04:21:27PM -0400, Bradley Lucier wrote:
>> The following we don't have:
>>
>> ln1p ; ln1p(x)=ln(1+x)
>> arcsinh
>> sinh
>>
>>
>> So I need only flln1p, flasinh, and flsinh. Which is not so much.
>> (But which may be more than what Windows provides, according to Joe's
>> email.)
>>
> Well, according to that page, Windows has flsinh, but lacks ln1p
> and asinh. flasinh can be computed with a logarithm, and ln1p can be
> implemented fairly simply as well (see http://www.johndcook.com/cpp_log_one_plus_x.html).
That code has a relative error of about 1e-12, which is not good enough
for our purposes. I suppose we could write a few helper functions for
Windows that may not have optimal accuracy or range, but that's another
pain ...
Brad
More information about the Gambit-list
mailing list