From 9cb997e2c16af566f8955ab6517c36cc3b9e62b7 Mon Sep 17 00:00:00 2001 From: Mikael Muszynski Date: Sat, 8 Jun 2024 17:18:25 +0200 Subject: [PATCH] Update algorithm to match the latest Glicko-2 documentation On 2022-03-22, the Glicko-2 algorithm was updated, with the following line being added to the [Glicko web page][1]: > This document has been revised on March 22, 2022, to replace a "<" > with "<=" in item 4(b) of Step 5 (page 3). See the [Glicko-2 document][2] for details. Tests for this change are missing, as at the time of writing I couldn't figure out a test that only made use of the current public interface. [1]: http://glicko.net/glicko.html [2]: http://glicko.net/glicko/glicko2.pdf --- lib/glicko.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/glicko.ex b/lib/glicko.ex index 6c1ab8c..6548887 100644 --- a/lib/glicko.ex +++ b/lib/glicko.ex @@ -268,7 +268,7 @@ defmodule Glicko do fc = calc_f(alpha, delta, player_pre_rd_sq, variance_est, sys_const, c) {a, fa} = - if fc * fb < 0 do + if fc * fb <= 0 do {b, fb} else {a, fa / 2}