Typed Racket and Flonums

Is Typed Racket able to replace functions such as +, sqrt and sin with their fl equivalents when all the arguments are Flonums? For example, is TR able to transform the code below:

(: radians->chlen (-> Flonum Flonum))
(define (radians->chlen r)
  (* 2.0 (sin (* 0.5 (min pi r))))))

Into:

(: radians->chlen (-> Flonum Flonum))
(define (radians->chlen r)
  (fl* 2.0 (flsin (fl* 0.5 (flmin pi r))))))

Alex.

Yes, you can use the macro stepper to check that.

3 Likes