<div dir="ltr"><div class="gmail_default" style="font-size:small">Hello,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;m a student at the University of Washington working on numerical accuracy, and I&#39;ve been looking into GROMACS as an example of a beloved and important large numerical program. Browsing through the code base, I was struck by the computation of the dihedral angle in <u>bonded.c</u>, at line 1569 (in GROMACS 5.1.4).</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I wonder if it is possible for the <u>sign</u> variable to get the wrong value, if the input points are close to one another or have some other reason to experience cancellation when doing the cross product. I think this is fixable using an adaptive algorithm. Could changing the sign of the angle computed by <u>dih_angle</u> affect GROMACS&#39;s results?<br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">More broadly, has anyone ever had numerical accuracy issues with GROMACS? Would there be interest in reviewing a patch that improved the accuracy (for edge case inputs) for the dihedral angle computation?<br></div><div class="gmail_default" style="font-size:small"><br clear="all"></div><div><div class="m_3853295731210088818gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">—Pavel Panchekha</div></div></div>
</div>