Skip to main content

cot

Function cot 

Source
pub fn cot(x: f64) -> f64
Expand description

The cotangent, written once and called from both engines.

Every other function here is one libm call and rounds the same way wherever it is written. This one is a division of two of them, and that does not survive being written twice: the same expression in the row engine’s crate and in this one comes out one place apart at 0.75, the optimizer being free to fold the pair of calls together in one and not in the other. Which of the two is the better answer is not the question. Nothing in a statement says which engine takes it, so the two have to agree, and the way to make two crates agree on a float is to give them one function rather than one formula.