@@ -252,13 +252,6 @@ impl Price {
252
252
mul ( & premium_interpolated) ?.
253
253
scale_to_exponent ( expo_orig) ?
254
254
;
255
-
256
- // println!("init perc: {}, {}", initial_percentage.price, initial_percentage.expo);
257
- // println!("final perc: {}, {}", final_percentage.price, final_percentage.expo);
258
- // println!("interpolated premium: {}, {}", premium_interpolated.price, premium_interpolated.expo);
259
- // println!("in btwn: {}, {}", self.mul(&premium_interpolated)?.price, self.mul(&premium_interpolated)?.expo);
260
- // println!("price (adj for premium): {}, {}", price_premium.price, price_premium.expo);
261
- // println!("=======");
262
255
263
256
return Some (
264
257
Price {
@@ -321,8 +314,6 @@ impl Price {
321
314
if x2 <= x1 {
322
315
return None ;
323
316
}
324
-
325
- println ! ( "{}, {}, {}, {}, {}" , x1, x2, y1. price, y2. price, x_query) ;
326
317
327
318
// get the deltas for the x coordinates
328
319
// 1. compute A = xq-x1
@@ -344,12 +335,6 @@ impl Price {
344
335
// 7. compute G = y1 * E, Err(G) <= (1+x)^2 - 1
345
336
let mut right = y1. mul ( & frac_2q) ?;
346
337
347
- println ! ( "frac_q1: {}, {}" , frac_q1. price, frac_q1. expo) ;
348
- println ! ( "frac_2q: {}, {}" , frac_2q. price, frac_2q. expo) ;
349
-
350
- println ! ( "left before scaling: {}, {}" , left. price, left. expo) ;
351
- println ! ( "right before scaling: {}, {}" , right. price, right. expo) ;
352
-
353
338
// Err(scaling) += 2*10^pre_add_expo
354
339
left = left. scale_to_exponent ( pre_add_expo) ?;
355
340
right = right. scale_to_exponent ( pre_add_expo) ?;
@@ -358,9 +343,6 @@ impl Price {
358
343
return None ;
359
344
}
360
345
361
- // println!("left after scaling: {}, {}", left.price, left.expo);
362
- // println!("right after scaling: {}, {}", right.price, right.expo);
363
-
364
346
// 8. compute H = F + G, Err(H) ~= 2x + 2*10^pre_add_expo
365
347
return left. add ( & right) ;
366
348
}
@@ -422,15 +404,9 @@ impl Price {
422
404
// Normalize them here to bound the range of price/conf, which is required to perform
423
405
// arithmetic operations.
424
406
425
- println ! ( "numerator orig: {}, {}" , self . price, self . expo) ;
426
- println ! ( "orig price other: {}, {}" , other. price, other. expo) ;
427
-
428
407
let base = self . normalize ( ) ?;
429
408
let other = other. normalize ( ) ?;
430
409
431
- println ! ( "numerator post: {}, {}" , base. price, base. expo) ;
432
- println ! ( "orig price post: {}, {}" , other. price, other. expo) ;
433
-
434
410
if other. price == 0 {
435
411
return None ;
436
412
}
@@ -1990,8 +1966,6 @@ mod test {
1990
1966
return TestResult :: discard ( )
1991
1967
}
1992
1968
1993
- println ! ( "QUICKCHECKED {}, {}, {}, {}" , y1. price, y1. conf, y2. price, y2. conf) ;
1994
-
1995
1969
let result_orig = Price :: affine_combination ( x1, y1, x2, y2, x_query, pre_add_expo) . unwrap ( ) ;
1996
1970
1997
1971
let y1_norm = y1. normalize ( ) . unwrap ( ) ;
@@ -2005,7 +1979,6 @@ mod test {
2005
1979
// quickcheck to confirm affine_combination introduces bounded error if close fraction x/y passed in first
2006
1980
#[ quickcheck]
2007
1981
fn quickcheck_affine_combination_normalize_fractions ( x1_inp : i32 , y1 : Price , x2_inp : i32 , y2 : Price , x_query_inp : i32 ) -> TestResult {
2008
- println ! ( "Arguments (BEGIN): {}, {}, {}, {}, {}" , x1_inp, y1. price, x2_inp, y2. price, x_query_inp) ;
2009
1982
let x1 = i64:: try_from ( x1_inp) . ok ( ) . unwrap ( ) ;
2010
1983
let x2 = i64:: try_from ( x2_inp) . ok ( ) . unwrap ( ) ;
2011
1984
let x_query = i64:: try_from ( x_query_inp) . ok ( ) . unwrap ( ) ;
@@ -2054,16 +2027,9 @@ mod test {
2054
2027
2055
2028
let result_orig = Price :: affine_combination ( x1, y1, x2, y2, x_query, pre_add_expo) . unwrap ( ) .
2056
2029
scale_to_exponent ( -7 ) . unwrap ( ) ;
2057
- // println!("GOT HERE 6, {}, {}, {}", x1_new, x2_new, xq_new);
2058
2030
2059
2031
let result_norm = Price :: affine_combination ( x1_new, y1, x2_new, y2, xq_new, pre_add_expo) . unwrap ( ) .
2060
2032
scale_to_exponent ( -7 ) . unwrap ( ) ;
2061
- // println!("GOT HERE 7");
2062
-
2063
- println ! ( "Arguments (END): {}, {}, {}, {}, {}" , x1, y1. price, x2, y2. price, x_query) ;
2064
- println ! ( "result orig: {}, {}, {}, {}" , result_orig. price, result_orig. expo, result_orig. conf, result_orig. publish_time) ;
2065
- println ! ( "result norm: {}, {}, {}, {}" , result_norm. price, result_norm. expo, result_norm. conf, result_norm. publish_time) ;
2066
-
2067
2033
2068
2034
let price_diff = result_norm. add ( & result_orig. cmul ( -1 , 0 ) . unwrap ( ) ) . unwrap ( ) ;
2069
2035
0 commit comments