Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18672

Re: CPU radian-based calculation

$
0
0

example of error was printed as follows,

 

=sin(radians(X))+sin(radians(X+120))+sin(radians(X+240))

calculated with cell A2- (repeated autofill) as X value on OpenOffice 4.01/Windows 7Pro 64bit

 

0-3600 degree (0.1 increment), 3600-5800 (1 increment) 5800-6400 (2 increment) 6400-7000 (5 increment)

error occurs mainly at around 150, 300, 450, 600, 750, 900 ...

1800-3600, 3600-above shows similar patterns, although above 3600 degree shows wider error ranges.

 

radian-calc.png

thus error occurs -1800 angle degree on certain value ranges (though fifth and sixth peaks are wider than else). Wider error starts from 1800 angle degree to 3600 and appearance of error came spread.

Same pattern could be obtained with AMD chipset (athlon tested), and Excel. I have no RISC-based unix nor 68-based Apple-PC, I could not test the situation differences.

 

As Kevin wrote below, I have re-calculated 0-1440 degrees (1 increment) in OpenOffice.org (Win7 64 bit), with original sin(radians()) way.

dot blue : sin(radians(x))+sin(radians(x+120))+sin(radians(x+240))

dot orange : sin(x*PI()/180)+sin((x+120)*PI()/180)+sin((x+240)*PI()/180)

where x is A2 to A1442 (value 0 to 1440)

the result:

 

orange is worse than blue, thus radian exchange is not equal in radians formula to PI()/180 on CPU loading because the results are different (attached sin_recalc.png).

 

Thus Kevin, "trusted ways of calculation of ordinal high-voltage line short-circuit" failed to proof zero-value in the range of plus to minus 180 degree range what-so-ever on the x86-based systems (P4=32bit, U3400=64bit, athlon=32bit). I have no chance to know whether RISC (IRIX, Solaris etc) or 68-based old Mac. It truely failed to give. As one of chemists, I wonder if this error value (although it would be 0.1ppb order) affects like ancient floating point defect (that gave ocasionally ppm-order error though). And as a chemist, I know sin() function handles radians not degrees (thus converting radians to degree by using radians() function inside.

 

 

first error value could be obtained in 1 increments from 0 is 112, sin(radians(112))+sin(radians(232))+sin(radians(352))=-5.82867087928207E-016

Kevin's PI() method gave first error at 110 (error value was -7.49400541621981E-016), but at 112 the error was -5.82867087928207E-016 (same as above). Followed was 116, 117, 119, 120, 121, 122, 125, 126, till 180 angle degree (Kevin's way gave additional 113, 118, 128, 132 angle degrees, but all radians() error angles gave error values with sometimes different value (closely twice, but not exactly twice).

 

sin(radians(A2*sin(A2))) like floating values also give some error values similar to those in 0.1 increments.

 

 

# if you missed to give radians() function or PI()/180, you would obtain at x=0 sin(0)+sin(120)+sin(240)=1.5260563391. It is not an error level from zero :-)


Viewing all articles
Browse latest Browse all 18672

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>