Skip to content

Commit 73d67df

Browse files
authored
Merge pull request #132 from herbie-fp/monotonic-bang
Monotonic mutating functions
2 parents af06bc2 + cdf7789 commit 73d67df

File tree

4 files changed

+168
-73
lines changed

4 files changed

+168
-73
lines changed

eval/compile.rkt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,37 @@
3535

3636
[(list 'if c y f) (list ival-if c y f)]
3737

38-
[(list 'neg x) (list ival-neg x)]
39-
[(list 'acos x) (list ival-acos x)]
40-
[(list 'acosh x) (list ival-acosh x)]
41-
[(list 'asin x) (list ival-asin x)]
42-
[(list 'asinh x) (list ival-asinh x)]
43-
[(list 'atan x) (list ival-atan x)]
44-
[(list 'atanh x) (list ival-atanh x)]
45-
[(list 'cbrt x) (list ival-cbrt x)]
38+
[(list 'neg x) (list ival-neg! (alloc-outreg!) x)]
39+
[(list 'acos x) (list ival-acos! (alloc-outreg!) x)]
40+
[(list 'acosh x) (list ival-acosh! (alloc-outreg!) x)]
41+
[(list 'asin x) (list ival-asin! (alloc-outreg!) x)]
42+
[(list 'asinh x) (list ival-asinh! (alloc-outreg!) x)]
43+
[(list 'atan x) (list ival-atan! (alloc-outreg!) x)]
44+
[(list 'atanh x) (list ival-atanh! (alloc-outreg!) x)]
45+
[(list 'cbrt x) (list ival-cbrt! (alloc-outreg!) x)]
4646
[(list 'ceil x) (list ival-ceil x)]
4747
[(list 'cos x) (list ival-cos x)]
48-
[(list 'cosh x) (list ival-cosh x)]
49-
[(list 'erf x) (list ival-erf x)]
50-
[(list 'erfc x) (list ival-erfc x)]
51-
[(list 'exp x) (list ival-exp x)]
52-
[(list 'exp2 x) (list ival-exp2 x)]
53-
[(list 'expm1 x) (list ival-expm1 x)]
48+
[(list 'cosh x) (list ival-cosh! (alloc-outreg!) x)]
49+
[(list 'erf x) (list ival-erf! (alloc-outreg!) x)]
50+
[(list 'erfc x) (list ival-erfc! (alloc-outreg!) x)]
51+
[(list 'exp x) (list ival-exp! (alloc-outreg!) x)]
52+
[(list 'exp2 x) (list ival-exp2! (alloc-outreg!) x)]
53+
[(list 'expm1 x) (list ival-expm1! (alloc-outreg!) x)]
5454
[(list 'fabs x) (list ival-fabs x)]
5555
[(list 'floor x) (list ival-floor x)]
5656
[(list 'lgamma x) (list ival-lgamma x)]
57-
[(list 'log x) (list ival-log x)]
58-
[(list 'log10 x) (list ival-log10 x)]
59-
[(list 'log1p x) (list ival-log1p x)]
60-
[(list 'log2 x) (list ival-log2 x)]
57+
[(list 'log x) (list ival-log! (alloc-outreg!) x)]
58+
[(list 'log10 x) (list ival-log10! (alloc-outreg!) x)]
59+
[(list 'log1p x) (list ival-log1p! (alloc-outreg!) x)]
60+
[(list 'log2 x) (list ival-log2! (alloc-outreg!) x)]
6161
[(list 'logb x) (list ival-logb x)]
62-
[(list 'rint x) (list ival-rint x)]
62+
[(list 'rint x) (list ival-rint! (alloc-outreg!) x)]
6363
[(list 'round x) (list ival-round x)]
6464
[(list 'sin x) (list ival-sin x)]
65-
[(list 'sinh x) (list ival-sinh x)]
66-
[(list 'sqrt x) (list ival-sqrt x)]
65+
[(list 'sinh x) (list ival-sinh! (alloc-outreg!) x)]
66+
[(list 'sqrt x) (list ival-sqrt! (alloc-outreg!) x)]
6767
[(list 'tan x) (list ival-tan x)]
68-
[(list 'tanh x) (list ival-tanh x)]
68+
[(list 'tanh x) (list ival-tanh! (alloc-outreg!) x)]
6969
[(list 'tgamma x) (list ival-tgamma x)]
7070
[(list 'trunc x) (list ival-trunc x)]
7171

ops/all.rkt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,33 @@
2222
ival-sub
2323
ival-sub!
2424
ival-neg
25+
ival-neg!
2526
ival-mult
2627
ival-mult!
2728
ival-div
2829
ival-div!
2930
ival-fma
3031
ival-fabs
3132
ival-sqrt
33+
ival-sqrt!
3234
ival-cbrt
35+
ival-cbrt!
3336
ival-hypot
3437
ival-hypot!
3538
ival-exp
39+
ival-exp!
3640
ival-exp2
41+
ival-exp2!
3742
ival-expm1
43+
ival-expm1!
3844
ival-log
45+
ival-log!
3946
ival-log2
47+
ival-log2!
4048
ival-log10
49+
ival-log10!
4150
ival-log1p
51+
ival-log1p!
4252
ival-logb
4353
ival-pow
4454
ival-pow2
@@ -49,22 +59,34 @@
4959
ival-sinu
5060
ival-tanu
5161
ival-asin
62+
ival-asin!
5263
ival-acos
64+
ival-acos!
5365
ival-atan
66+
ival-atan!
5467
ival-atan2
5568
ival-sinh
69+
ival-sinh!
5670
ival-cosh
71+
ival-cosh!
5772
ival-tanh
73+
ival-tanh!
5874
ival-asinh
75+
ival-asinh!
5976
ival-acosh
77+
ival-acosh!
6078
ival-atanh
79+
ival-atanh!
6180
ival-erf
81+
ival-erf!
6282
ival-erfc
83+
ival-erfc!
6384
ival-lgamma
6485
ival-tgamma
6586
ival-fmod
6687
ival-remainder
6788
ival-rint
89+
ival-rint!
6890
ival-round
6991
ival-ceil
7092
ival-floor

0 commit comments

Comments
 (0)