65 inline static void accumulate(ContainerOverSubrelations& evals,
66 const AllEntities& in,
68 const FF& scaling_factor)
71 using CoefficientAccumulator =
typename Accumulator::CoefficientAccumulator;
73 auto w_l_m = CoefficientAccumulator(in.w_l);
74 auto w_4_m = CoefficientAccumulator(in.w_4);
75 auto q_arith_m = CoefficientAccumulator(in.q_arith);
76 auto q_m_m = CoefficientAccumulator(in.q_m);
78 auto q_arith_sub_1 = q_arith_m -
FF(1);
79 auto scaled_q_arith = q_arith_m * scaling_factor;
84 auto w_4_shift_m = CoefficientAccumulator(in.w_4_shift);
85 auto w_r_m = CoefficientAccumulator(in.w_r);
86 auto w_o_m = CoefficientAccumulator(in.w_o);
87 auto q_l_m = CoefficientAccumulator(in.q_l);
88 auto q_r_m = CoefficientAccumulator(in.q_r);
89 auto q_o_m = CoefficientAccumulator(in.q_o);
90 auto q_4_m = CoefficientAccumulator(in.q_4);
91 auto q_c_m = CoefficientAccumulator(in.q_c);
93 static const FF neg_half =
FF(-2).invert();
95 auto tmp0 = Accumulator(w_r_m * w_l_m * neg_half) * Accumulator((q_arith_m - 3) * q_m_m);
96 auto tmp1 = (q_l_m * w_l_m) + (q_r_m * w_r_m) + (q_o_m * w_o_m) + (q_4_m * w_4_m) + q_c_m;
97 tmp1 += q_arith_sub_1 * w_4_shift_m;
99 std::get<0>(evals) += (tmp0 + Accumulator(tmp1)) * Accumulator(scaled_q_arith);
105 auto w_l_shift_m = CoefficientAccumulator(in.w_l_shift);
107 auto tmp_0 = w_l_m + w_4_m - w_l_shift_m + q_m_m;
108 auto tmp_1 = tmp_0 * (q_arith_m -
FF(2));
109 auto tmp_2 = q_arith_sub_1 * scaled_q_arith;
110 std::get<1>(evals) += ShortAccumulator(tmp_1) * ShortAccumulator(tmp_2);