Skip to content

Commit

Permalink
log/exp
Browse files Browse the repository at this point in the history
  • Loading branch information
bhargavkulk committed Sep 23, 2024
1 parent 0216676 commit 91466d4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/core/explain.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
(define x (exacts-ref x-ex))
(define xlog (logfls-ref x-ex))
(match-define (logfl xfl xs xe) xlog)
(define cond-num.l (logabs (log/ (lf 1.0) xlog)))
(define cond-num.l (logabs (log/ 1.l xlog)))
(define cond-num (abs (/ 1.0 xfl)))

(cond
Expand All @@ -436,8 +436,8 @@

; High Condition Number:
; CN(log, x) = |1 / log(x)|
[(> cond-num 100) (mark-erroneous! subexpr 'sensitivity)]
[(> cond-num 32) (mark-maybe! subexpr 'sensitivity)]
[(log> cond-num.l 100.l) (mark-erroneous! subexpr 'sensitivity)]
[(log> cond-num.l 32.l) (mark-maybe! subexpr 'sensitivity)]

[else #f])]

Expand All @@ -459,9 +459,9 @@

; High Condition Number:
; CN(exp, x) = |x|
[(> (abs xfl) 100) (mark-erroneous! subexpr 'sensitivity)]
[(log> (logabs xlog) 100.l) (mark-erroneous! subexpr 'sensitivity)]

[(> (abs xfl) 32) (mark-maybe! subexpr 'sensitivity)]
[(log> (logabs xlog) 32.l) (mark-maybe! subexpr 'sensitivity)]

[else #f])]

Expand Down

0 comments on commit 91466d4

Please sign in to comment.