source:
CIVL/mods/dev.civl.com/examples/experimental/powerSimplify.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 203 bytes | |
| Rev | Line | |
|---|---|---|
| [51ba047] | 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.); | |
| [f8fb9a7] | 11 | $assert(y - 1>= 0); |
| [51ba047] | 12 | return (int)y; |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
