bug-gnucap
[Top][All Lists]

[Bug-gnucap] insufficient limits checking in tanh model

 From: mcmahill Subject: [Bug-gnucap] insufficient limits checking in tanh model Date: Sat, 5 Apr 2003 16:10:54 -0500 (EST)

Hi Al,

I've been looking at gnucap-0.33 a little and it seems that the bm_tanh.cc
file has a potential problem on some systems.  In this function:

void EVAL_BM_TANH::tr_eval(ELEMENT* d)const
{
double x = ioffset(d->_y0.x);
double aa = x * _gain/_limit;
double cosine = cosh(aa);
double f1 = _gain / (cosine*cosine);
double f0 = _limit * tanh(aa);
d->_y0 = FPOLY1(x, f0, f1);
}

its possible for 'aa' to be large enough to overflow cosh and product
'inf' as the result.  Then you're relying on _gain / (inf * inf) to give
0.  In particular I've noticed that on an alpha system (alpha processors
do not implement full IEEE 754 math in hardware) I get floating point
exceptions at that line of the code.  If I compile with the -mieee flag to
gcc, traps are generated in the code to allow the software floating point
completion code to kick in and the program runs without generating the
SIGFPE's that I was getting before.  However, not all systems implement
this sort of floating point math so you may find problems on some systems.

-Dan

reply via email to
{"ft_lang_label":"__label__en","ft_lang_prob":0.81106704,"math_prob":0.80783826,"size":1425,"snap":"2019-43-2019-47","text_gpt3_token_len":408,"char_repetition_ratio":0.08937368,"word_repetition_ratio":0.026548672,"special_character_ratio":0.28210527,"punctuation_ratio":0.11721612,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.950966,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-15T17:10:34Z\",\"WARC-Record-ID\":\"<urn:uuid:0a0ed038-ed04-4b5f-9b2d-fc65a0edce4a>\",\"Content-Length\":\"5975\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d445c362-4cb2-418c-8c01-9574b9ff312d>\",\"WARC-Concurrent-To\":\"<urn:uuid:c226c47f-821b-4244-b8e9-1a6188dc7ccd>\",\"WARC-IP-Address\":\"209.51.188.17\",\"WARC-Target-URI\":\"https://lists.defectivebydesign.org/archive/html/bug-gnucap/2003-04/msg00001.html\",\"WARC-Payload-Digest\":\"sha1:XUWH6SOMRWG5FECKVELOQE3HIXUXMFYQ\",\"WARC-Block-Digest\":\"sha1:P3DLF3GCMCGQO2XBB5SLHM7BJJGGHKUQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986660067.26_warc_CC-MAIN-20191015155056-20191015182556-00313.warc.gz\"}"}