ts-fsrs 5.4.0 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -498,7 +498,7 @@ function alea(seed) {
498
498
  return prng;
499
499
  }
500
500
 
501
- const version="5.4.0";
501
+ const version="5.4.1";
502
502
 
503
503
  const default_request_retention = 0.9;
504
504
  const default_maximum_interval = 36500;
@@ -578,7 +578,11 @@ const clipParameters = (parameters, numRelearningSteps, enableShortTerm = defaul
578
578
  const w13 = clamp(parameters[13] || 0, clip[13][0], clip[13][1]);
579
579
  const w14 = clamp(parameters[14] || 0, clip[14][0], clip[14][1]);
580
580
  const value = -(Math.log(w11) + Math.log(Math.pow(2, w13) - 1) + w14 * 0.3) / numRelearningSteps;
581
- const w17_w18_ceiling = clamp(roundTo(value, 8), 0.01, W17_W18_Ceiling);
581
+ const w17_w18_ceiling = clamp(
582
+ roundTo(Math.sqrt(Math.max(value, 0)), 8),
583
+ 0.01,
584
+ W17_W18_Ceiling
585
+ );
582
586
  if (clip[17]) clip[17] = [clip[17][0], w17_w18_ceiling];
583
587
  if (clip[18]) clip[18] = [clip[18][0], w17_w18_ceiling];
584
588
  }