Skip to content

Commit 88bce75

Browse files
committed
added tuning formulas for sinu,cosu,tanu
1 parent 4e74d29 commit 88bce75

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

eval/tricks.rkt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,29 @@
378378
(define x (first srcs))
379379
(list (cons (+ (logspan x) 1) 0))]
380380

381+
[(ival-sinu ival-cosu)
382+
; Γ[sinu]'x = |x*pi/n * cos(x*pi/n) / sin(x*pi/n)|
383+
; Γ[cosu]'x = |x*pi/n * sin(x*pi/n) / cos(x*pi/n)|
384+
;
385+
; ↑ampl[sinu]'x = ↑ampl[sinu]'n = maxlog(x) - minlog(n) - minlog(z) + 2 (accounting for pi)
386+
; ↓ampl[sinu]'x = ↓ampl[sinu]'n = 0 <-- maybe can be better
387+
;
388+
; ↑ampl[cosu]'x = ↑ampl[cosu]'n = maxlog(x) - minlog(n) - minlog(z) + 2 (accounting for pi)
389+
; ↓ampl[cosu]'x = ↓ampl[cosu]'n = 0 <-- maybe can be better
390+
(define x (first srcs))
391+
(define n (second srcs))
392+
(list (make-list 2 (cons (- (maxlog x) (minlog n) (minlog z) -2) 0)))]
393+
394+
[(ival-tanu)
395+
; Γ[tanu]'x = |x*pi/n * (1 / cos^2(x*pi/n)) / tan(x*pi/n)|
396+
; ↑ampl[tanu]'x = ↑ampl[tanu]'n = maxlog(x) - minlog(n) + max(|minlog(z)|, |maxlog(z)|) + 3 (accounting for pi)
397+
; ↓ampl[tanu]'x = ↓ampl[tanu]'n = 0 <-- maybe can be better
398+
(define x (first srcs))
399+
(define n (second srcs))
400+
(list (make-list 2
401+
(cons (- (maxlog x) (minlog n) (- (max (abs (maxlog z)) (abs (minlog z)))) -3)
402+
0)))]
403+
381404
; TODO
382405
; ↑ampl[...] = slack
383406
; ↓ampl[...] = 0

0 commit comments

Comments
 (0)