4 ms·
When transcoding the formulas from CAS (comptuer algebra), the Greeks are often already spelled out in English transliteration (phi, sigma). Even more, sometim
by zoomablemind 6y ago
When transcoding the formulas from CAS (comptuer algebra), the Greeks are often already spelled out in English transliteration (phi, sigma).
Even more, sometimes for clarity or performance reasons it may make sense to introduce interim variables, I often name those just as what they'd look like in formula, say, pi/2, would be PI_2; A*B is kept in AB, or AxB depending on context. So many times the encoded formulas end up hiding accidental errors resulting from a desire to use programmer's names. With scientific code, it's safer to stick to formulas, as it's just easier to eyeball them or outright copy and paste to/from CAS for cross-check.
Of course, it's paramount to have proper test-cases to make sure the encoded formulas match to the expected results.