]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
Fix comments in logsumexp.
authorTaylor R Campbell <campbell+mit-scheme@mumble.net>
Thu, 11 Feb 2021 04:58:13 +0000 (04:58 +0000)
committerTaylor R Campbell <campbell+mit-scheme@mumble.net>
Thu, 11 Feb 2021 05:04:36 +0000 (05:04 +0000)
(cherry picked from commit 270906e82f3bd3e6dfd9892d2fb085576e321a75)

src/runtime/arith.scm

index dee4d70d21588c34e9e8c396aea7986392253156..e8adb7dd40a71d778f63d26c04b3ab994feda6d9 100644 (file)
@@ -2526,13 +2526,10 @@ USA.
   ;;
   ;; 1. No inputs.  Empty sum is zero, so yield log(0) = -inf.
   ;; 2. One input.  Computation is exact.  Preserve it.
-  ;; 3. Maximum is infinite:
-  ;;    - if +inf, sum overflows, so +inf.
-  ;;    - if -inf, all inputs are -inf, so -inf.
-  ;; 4. NaN among the inputs: invalid operation; result is NaN.
+  ;; 3. Maximum +inf.  Sum overflows, so yield it (unless NaN).
   ;;
   ;; Most likely all the inputs are finite, so prioritize that case by
-  ;; checking for an infinity first -- if there is a NaN, the usual
+  ;; checking for +inf first -- if there is a NaN, the usual
   ;; computation will propagate it.
   ;;
   ;; Overflow is not possible because everything is normalized to be