source:
CIVL/examples/experimental/powerSimplify.cvl@
189d0eb
| Last change on this file since 189d0eb was 51ba047, checked in by , 8 years ago | |
|---|---|
|
|
| File size: 200 bytes | |
| Line | |
|---|---|
| 1 | #include "math.h" |
| 2 | |
| 3 | $input double x; |
| 4 | $assume(-10 < x && x < 10); |
| 5 | |
| 6 | int main() { |
| 7 | double y = -2. * ((-x / 5.) - 1./3.); |
| 8 | |
| 9 | $assume(y != 0); |
| 10 | y = pow(y, 1./2.); |
| 11 | $assert(y >= 0); |
| 12 | return (int)y; |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
