File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 510510
511511(define (taylor-log var arg)
512512 ;(-> symbol? term? term?)
513- (match-define (cons shift coeffs) (normalize-series arg))
513+ (define normalized (normalize-series arg))
514+ (define shift (series-offset normalized))
515+ (define coeffs (series-function normalized))
514516 (define negate? (and (number? (deref (coeffs 0 ))) (not (positive? (deref (coeffs 0 ))))))
515517 (define (maybe-negate x)
516518 (if negate?
560562 [add (λ (x) (batch-add! batch x))])
561563 (define brfs* (map (expand-taylor! batch) brfs))
562564 (define brf (car brfs*))
563- (match- define fn (zero-series ((taylor 'x batch) brf)))
565+ (define fn (zero-series ((taylor 'x batch) brf)))
564566 (map batch-pull (build-list n fn))))
565567 (check-equal? (coeffs '(sin x)) '(0 1 0 -1/6 0 1/120 0 ))
566568 (check-equal? (coeffs '(sqrt (+ 1 x))) '(1 1/2 -1/8 1/16 -5/128 7/256 -21/1024 ))
You can’t perform that action at this time.
0 commit comments