package forecast func DifferenceAtLeast(previous float64, current float64, threshold float64) bool { return abs(current-previous) >= threshold } func CrossesAtOrAbove(previous float64, current float64, threshold float64) bool { return previous < threshold && current >= threshold } func CrossesBelow(previous float64, current float64, threshold float64) bool { return previous >= threshold && current < threshold } func abs(value float64) float64 { if value < 0 { return -value } return value }