Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 312981 Details for
Bug 43354
expm1l(x) overflows when 11356.1768 < x <= 11356.5234
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Speed measurement program for the testcase
test_speed.c (text/x-csrc), 6.31 KB, created by
Denys Vlasenko
on 2008-07-30 10:40:57 UTC
(
hide
)
Description:
Speed measurement program for the testcase
Filename:
MIME Type:
Creator:
Denys Vlasenko
Created:
2008-07-30 10:40:57 UTC
Size:
6.31 KB
patch
obsolete
>/* Bug 43354: expm1l(x) overflows when 11356.1768 < x <= 11356.5234 */ >/* This testcase shows that approximating expm1l(x) with expl(x) > * for x >= 128.0 makes expm1l(x) work correctly for x up to > * 11356.5234062941435695 and even provides more precise results */ > >/* s_expm1l.S is from glibc 2.7, s_expm1l_fixed.S is a new algorithm */ > >/* gcc -Os -lm test_speed.c s_expm1l.S s_expm1l_fixed.S */ > >#include <stdlib.h> /* for atof */ >#include <stdint.h> >#include <stdio.h> >#include <math.h> >#include <sys/time.h> > >long double __glibc27_expm1l_fixed(long double x); >long double __glibc27_expm1l(long double x); > >static void hack_print(long double *v) >{ > printf("Value: %.20Le ", *v); > printf("Bit value: %04x %04x %04x %04x %04x\n", > ((uint16_t*)v)[4], > ((uint16_t*)v)[3], > ((uint16_t*)v)[2], > ((uint16_t*)v)[1], > ((uint16_t*)v)[0] > ); >} > >static int hack_inc(long double *v) >{ > uint32_t *lowbits = (uint32_t *)v; > if (*lowbits != 0xffffffff) { > if (!(*lowbits & 0xfffff)) { > printf("%.20Le", v); > printf(" (0x%08x)\r", (unsigned)(*lowbits)); > fflush(NULL); > } > (*lowbits)++; > return 1; > } > return 0; >} > >int main(int argc, char **argv) >{ > long double v; > long double e; > long double e1org; > long double e1fix; > int count, i; > unsigned tv_usec, tv_usec_stop; > struct timeval tv; > > v = atof(argv[1]); > hack_print(&v); > > e = expl(v); > e1org = __glibc27_expm1l(v); > e1fix = __glibc27_expm1l_fixed(v); > printf("Testing at:\n"); > printf("%.20Le: %.20Le %.20Le (%.20Le)\n", v, e1org, e1fix, e); > >#define REP 9 > > printf("Current algorithm, iterations in 0.1 sec:"); >for (i = 0; i < REP; i++) { > gettimeofday(&tv, NULL); > tv_usec_stop = tv.tv_sec * (1000*1000) + tv.tv_usec + 100*1000; > count = 0; > do { > /* 64 calls */ > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); e1org = __glibc27_expm1l(v); > count++; > gettimeofday(&tv, NULL); > tv_usec = tv.tv_sec * (1000*1000) + tv.tv_usec; > } while (tv_usec < tv_usec_stop); > printf(" %6d", count); fflush(NULL); >} >printf("\n"); > > printf(" New algorithm, iterations in 0.1 sec:"); >for (i = 0; i < REP; i++) { > gettimeofday(&tv, NULL); > tv_usec_stop = tv.tv_sec * (1000*1000) + tv.tv_usec + 100*1000; > count = 0; > do { > /* 64 calls */ > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); e1org = __glibc27_expm1l_fixed(v); > count++; > gettimeofday(&tv, NULL); > tv_usec = tv.tv_sec * (1000*1000) + tv.tv_usec; > } while (tv_usec < tv_usec_stop); > printf(" %6d", count); fflush(NULL); >} >printf("\n"); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 43354
:
312979
| 312981