This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Possible mistake in expf
- From: ethereal at ethv dot net
- To: newlib at sourceware dot org
- Date: Thu, 11 Jun 2015 18:05:58 -0700
- Subject: Possible mistake in expf
- Authentication-results: sourceware.org; auth=none
Hello everyone,
I believe I may have stumbled across a minor mistake in the expf()
implementation in newlib's libm.
newlib/libm/mathfp/sf_pow.c:99 [1] is:
> x = exp (t);
However, I don't see why the function exp should be used instead of
expf, as x itself is a single-precision float. At a quick glance I don't
see any reason why this would benefit greatly from the increased
precision the double-precision version of exp would provide, but I'm far
from an expert on this sort of thing. If someone could confirm or refute
my suspicions, that would be appreciated!
Thanks,
- ethereal
[1]
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libm/mathfp/sf_pow.c;;hb=HEAD#l99