Click here to Skip to main content
15,879,535 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: [Chortle] Pin
CPallini15-Feb-22 22:43
mveCPallini15-Feb-22 22:43 
GeneralRe: [Chortle] Pin
den2k8815-Feb-22 22:46
professionalden2k8815-Feb-22 22:46 
GeneralRe: [Chortle] Pin
Daniel Pfeffer15-Feb-22 21:07
professionalDaniel Pfeffer15-Feb-22 21:07 
GeneralRe: [Chortle] Pin
den2k8815-Feb-22 22:32
professionalden2k8815-Feb-22 22:32 
GeneralRe: [Chortle] Pin
Daniel Pfeffer15-Feb-22 23:00
professionalDaniel Pfeffer15-Feb-22 23:00 
GeneralRe: [Chortle] Pin
den2k8815-Feb-22 23:06
professionalden2k8815-Feb-22 23:06 
GeneralRe: [Chortle] Pin
Peter_in_278015-Feb-22 23:53
professionalPeter_in_278015-Feb-22 23:53 
GeneralRe: [Chortle] Pin
Daniel Pfeffer16-Feb-22 0:39
professionalDaniel Pfeffer16-Feb-22 0:39 
In order to calculate sin(x), you must first reduce the argument by calculating y = fmod(x, Pi/2). This entails subtraction of two numbers that may be very close to each other, i.e. you may get catastrophic cancellation and loss of accuracy. In order to avoid this (even for relatively small numbers), you must use a more accurate version of Pi than can be contained in a double.

A high-quality floating-point library will perform the reduction at the highest accuracy for all finite values representable by double. This may be overkill for some embedded software (where, as you say, the angles may be small), but in that case there should be a way of indicating whether the result has any significance. Failure to do so can lead to some rather odd results...

(The article I referred to in my earlier post (https://www.csee.umbc.edu/~phatak/645/supl/Ng-ArgReduction.pdf) has a table showing how different compilers miscalculated sin(10^22) and cos(10^22))
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

GeneralRe: [Chortle] Pin
honey the codewitch16-Feb-22 1:52
mvahoney the codewitch16-Feb-22 1:52 
GeneralRe: [Chortle] Pin
DRHuff16-Feb-22 4:58
DRHuff16-Feb-22 4:58 
JokeWelp, my friend couldn't believe it... Pin
oofalladeez34315-Feb-22 15:54
professionaloofalladeez34315-Feb-22 15:54 
GeneralWhat to sous vide? Pin
Andreas Mertens15-Feb-22 14:14
professionalAndreas Mertens15-Feb-22 14:14 
GeneralRe: What to sous vide? Pin
Peter_in_278015-Feb-22 14:33
professionalPeter_in_278015-Feb-22 14:33 
GeneralRe: What to sous vide? Pin
Andreas Mertens15-Feb-22 14:42
professionalAndreas Mertens15-Feb-22 14:42 
GeneralRe: What to sous vide? Pin
PIEBALDconsult15-Feb-22 14:51
mvePIEBALDconsult15-Feb-22 14:51 
NewsRe: What to sous vide? Pin
Randor 15-Feb-22 15:51
professional Randor 15-Feb-22 15:51 
GeneralRe: What to sous vide? Pin
oofalladeez34315-Feb-22 15:52
professionaloofalladeez34315-Feb-22 15:52 
GeneralRe: What to sous vide? Pin
Randor 15-Feb-22 16:20
professional Randor 15-Feb-22 16:20 
GeneralRe: What to sous vide? Pin
Andreas Mertens15-Feb-22 16:18
professionalAndreas Mertens15-Feb-22 16:18 
GeneralRe: What to sous vide? Pin
Randor 15-Feb-22 19:51
professional Randor 15-Feb-22 19:51 
GeneralRe: What to sous vide? Pin
Chris Maunder16-Feb-22 3:45
cofounderChris Maunder16-Feb-22 3:45 
GeneralRe: What to sous vide? Pin
Mycroft Holmes16-Feb-22 11:43
professionalMycroft Holmes16-Feb-22 11:43 
GeneralRe: What to sous vide? Pin
Andreas Mertens16-Feb-22 16:30
professionalAndreas Mertens16-Feb-22 16:30 
GeneralRe: What to sous vide? Pin
Randor 18-Feb-22 6:41
professional Randor 18-Feb-22 6:41 
GeneralRe: What to sous vide? Pin
Chris Maunder18-Feb-22 13:15
cofounderChris Maunder18-Feb-22 13:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.