From 0266de60b31cbe4a32abe91024a711cd4dc6b953 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Wed, 27 Dec 2023 10:26:58 +0800 Subject: [PATCH] use new formula to calc ivl in getRetentionWarning (#2911) * use new formula to calc ivl in getRetentionWarning * format * Use consistent casing (dae) --- ts/deck-options/FsrsOptions.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/deck-options/FsrsOptions.svelte b/ts/deck-options/FsrsOptions.svelte index d7373a11a..46745104f 100644 --- a/ts/deck-options/FsrsOptions.svelte +++ b/ts/deck-options/FsrsOptions.svelte @@ -64,7 +64,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } function getRetentionWarning(retention: number): string { - const days = Math.round(9 * 100 * (1.0 / retention - 1.0)); + const decay = -0.5; + const factor = 0.9 ** (1 / decay) - 1; + const stability = 100; + const days = Math.round( + (stability / factor) * (Math.pow(retention, 1 / decay) - 1), + ); if (days === 100) { return ""; }