2 (** {1 Integer Cubic Root}
4 Simple computation of the integer cubic root, using a loop and two
5 auxiliary variables containing the square and the cube.
14 function cube (x: int) : int = x * x * x
16 let cubic_root (x: int) : int
18 ensures { cube (result - 1) <= x < cube result }
24 invariant { cube (b - 1) <= x }
25 invariant { y = cube b }
26 invariant { a = b * b }
28 y <- y + 3 * a + 3 * b + 1;