Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.intel > #353

Transcendental floating point functions are now unfixably broken on Intel processors

Date 2014-10-10 06:58 -0400
From Yousuf Khan <bbbl67@spammenot.yahoo.com>
Newsgroups comp.sys.ibm.pc.hardware.chips, comp.sys.intel, alt.comp.hardware.pc-homebuilt
Subject Transcendental floating point functions are now unfixably broken on Intel processors
Message-ID <5437bbbe$1@news.bnb-lp.com> (permalink)
Organization Send abuse or DMCA complaints to abuse@bnb-lp.com

Cross-posted to 3 groups.

Show all headers | View raw


" This error has tragically become un-fixable because of the 
compatibility requirements from one generation to the next. The fix for 
this problem was figured out quite a long time ago. In the excellent 
paper The K5 transcendental functions by T. Lynch, A. Ahmed, M. Schulte, 
T. Callaway, and R. Tisdale a technique is described for doing argument 
reduction as if you had an infinitely precise value for pi. As far as I 
know, the K5 is the only x86 family CPU that did sin/cos accurately. AMD 
went back to being bit-for-bit compatibile with the old x87 behavior, 
assumably because too many applications broke. Oddly enough, this is 
fixed in Itanium.

What we do in the JVM on x86 is moderately obvious: we range check the 
argument, and if it's outside the range [-pi/4, pi/4]we do the precise 
range reduction by hand, and then call fsin.

So Java is accurate, but slower. I've never been a fan of "fast, but 
wrong" when "wrong" is roughly random(). Benchmarks rarely test 
accuracy. "double sin(double theta) { return 0; }" would be a great 
benchmark-compatible implementation of sin(). For large values of theta, 
0 would be arguably more accurate since the absolute error is never 
greater than 1. fsin/fcos can have absolute errors as large as 2 
(correct answer=1; returned result=-1). "

https://blogs.oracle.com/jag/entry/transcendental_meditation

Back to comp.sys.intel | Previous | NextNext in thread | Find similar


Thread

Transcendental floating point functions are now unfixably broken on Intel processors Yousuf Khan <bbbl67@spammenot.yahoo.com> - 2014-10-10 06:58 -0400
  Re: Transcendental floating point functions are now unfixably broken on Intel processors Mark F <mark53916@gmail.com> - 2014-10-10 09:52 -0400

csiph-web