Skip to content

simple-spacer: compute rod_force exactly

Han-Wen Nienhuys requested to merge dev/hanwen/exact-rod-force into master

Before, the force equivalent reaching the rod length was calculated by bisection until a tolerance of 1-e6. As this is roughly 2^{-20}, this incurred at least 20 loop iterations with a calculation over all the springs affected.

For the mozart-hrn-3 score, this code became a hot spot at ~3% of execution time.

Since simple-spacer already contains the machinery to calculate the distance/force relation exactly, use that machinery instead.

Merge request reports