Skip to content

Commit

Permalink
lower bound mistake for untuned formulas
Browse files Browse the repository at this point in the history
  • Loading branch information
AYadrov committed Oct 23, 2024
1 parent 37cc3e7 commit b1d8fc4
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions eval/tricks.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
[4 4096]
[5 8192]))

(define (prev-iter)
(- (*sampling-iteration*) 1))

(define (crosses-zero? x)
(not (equal? (mpfr-sign (ival-lo x)) (mpfr-sign (ival-hi x)))))

Expand Down Expand Up @@ -196,8 +193,7 @@

(define x (first srcs))
(list (if (>= (maxlog z) 1)
(cons (get-slack)
(get-slack (prev-iter))) ; assumes that log[1-x^2]/2 is equal to slack
(cons (get-slack) 0) ; assumes that log[1-x^2]/2 is equal to slack
(cons 1 0)))]

[(ival-acos)
Expand All @@ -208,8 +204,7 @@

(define x (first srcs))
(list (if (>= (maxlog x) 0)
(cons (get-slack)
(get-slack (prev-iter))) ; assumes that log[1-x^2]/2 is equal to slack
(cons (get-slack) 0) ; assumes that log[1-x^2]/2 is equal to slack
(cons 0 0)))]

[(ival-atan)
Expand Down Expand Up @@ -279,7 +274,7 @@
; a possible uncertainty
(define x (first srcs))
(list (if (>= (maxlog x) 1)
(cons (get-slack) (get-slack (prev-iter)))
(cons (get-slack) 0)
(cons 1 0)))]

[(ival-acosh)
Expand All @@ -295,10 +290,8 @@
(list (cons (+ (logspan x) 1) 0))]

; TODO
[(ival-erfc ival-erf ival-lgamma ival-tgamma ival-asinh ival-logb)
(list (cons (get-slack) (get-slack (prev-iter))))]
[(ival-erfc ival-erf ival-lgamma ival-tgamma ival-asinh ival-logb) (list (cons (get-slack) 0))]
; TODO
[(ival-ceil ival-floor ival-rint ival-round ival-trunc)
(list (cons (get-slack) (get-slack (prev-iter))))]
[(ival-ceil ival-floor ival-rint ival-round ival-trunc) (list (cons (get-slack) 0))]

[else (map (λ (_) (cons 0 0)) srcs)])) ; exponents for arguments

0 comments on commit b1d8fc4

Please sign in to comment.