Skip to content

Commit

Permalink
Variary and/or in C compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
pavpanchekha committed Nov 7, 2017
1 parent cbd03b8 commit f6027dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions benchmarks/rosa.fpcore
Expand Up @@ -334,6 +334,7 @@
(< a c) (< b c))
:rosa-post (=> res (>= res 0))
:rosa-ensuring 2e-9
:example ((b 4.0) (c 8.5))
(if (< a b)
(/ (sqrt (* (* (* (+ c (+ b a)) (- a (- c b)))
(+ a (- c b))) (+ c (- b a))))
Expand Down
8 changes: 4 additions & 4 deletions tools/core2c.rkt
Expand Up @@ -38,10 +38,10 @@
(format "~a != ~a" (car args) b))
(loop (cdr args)))))
" && "))]
[(list 'and a b)
(format "(~a && ~a)" a b)]
[(list 'or a b)
(format "(~a || ~a)" a b)]
[(list 'and a ...)
(format "(~a)" (string-join (map ~a a) " && "))]
[(list 'or a ...)
(format "(~a)" (string-join (map ~a a) " || "))]
[(list (? operator? f) args ...)
(format "~a~a(~a)" f (type->suffix type) (string-join args ", "))]))

Expand Down

0 comments on commit f6027dc

Please sign in to comment.