@@ -61,10 +61,7 @@ fn check_integral() {
6161 let f = |x : f64 | x. cos ( ) + 0.25 * x * x;
6262 for & n in & [ 15_usize , 21 , 31 , 41 , 51 , 61 ] {
6363 let r: f64 = kronrod_quadrature ( f, n, ( 0.0 , 1.7 ) ) ;
64- print_kv (
65- & format ! ( "kronrod_quadrature n={}" , n) ,
66- format ! ( "{r:.17e}" ) ,
67- ) ;
64+ print_kv ( & format ! ( "kronrod_quadrature n={}" , n) , format ! ( "{r:.17e}" ) ) ;
6865 // also exercise with a different smooth integrand to widen coverage
6966 let r2: f64 = kronrod_quadrature ( |x : f64 | ( -x * x) . exp ( ) , n, ( -2.5 , 1.5 ) ) ;
7067 print_kv (
@@ -78,17 +75,17 @@ fn check_chebyshev_lagrange() {
7875 // chebyshev_nodes carries one of the affected loops directly.
7976 for & n in & [ 4_usize , 8 , 16 , 32 ] {
8077 let nodes = chebyshev_nodes ( n, -2.0 , 3.5 ) ;
81- print_kv (
82- & format ! ( "chebyshev_nodes(n={n}) hash" ) ,
83- hash_f64s ( & nodes) ,
84- ) ;
78+ print_kv ( & format ! ( "chebyshev_nodes(n={n}) hash" ) , hash_f64s ( & nodes) ) ;
8579 }
8680 // lagrange_polynomial uses divided-difference loops touched by clippy.
8781 let xs = vec ! [ 0.0_f64 , 0.5 , 1.1 , 1.7 , 2.4 , 3.0 ] ;
8882 let ys: Vec < f64 > = xs. iter ( ) . map ( |x| x. sin ( ) + 0.5 * x) . collect ( ) ;
8983 let p = lagrange_polynomial ( xs. clone ( ) , ys. clone ( ) ) ;
9084 for & q in & [ 0.1_f64 , 0.7 , 1.3 , 1.9 , 2.5 ] {
91- print_kv ( & format ! ( "lagrange.eval({q})" ) , format ! ( "{:.17e}" , p. eval( q) ) ) ;
85+ print_kv (
86+ & format ! ( "lagrange.eval({q})" ) ,
87+ format ! ( "{:.17e}" , p. eval( q) ) ,
88+ ) ;
9289 }
9390 print_kv (
9491 "lagrange.derivative coeffs" ,
@@ -212,10 +209,7 @@ fn check_polynomial() {
212209 print_kv ( "poly.derivative" , hash_f64s ( & p. derivative ( ) . coef ) ) ;
213210 print_kv ( "poly.integral" , hash_f64s ( & p. integral ( ) . coef ) ) ;
214211 for & x in & [ -1.0_f64 , -0.25 , 0.0 , 0.5 , 1.5 , 2.7 ] {
215- print_kv (
216- & format ! ( "poly.eval({x})" ) ,
217- format ! ( "{:.17e}" , p. eval( x) ) ,
218- ) ;
212+ print_kv ( & format ! ( "poly.eval({x})" ) , format ! ( "{:.17e}" , p. eval( x) ) ) ;
219213 }
220214}
221215
0 commit comments