Skip to content

Commit

Permalink
Improve small-coefficients 2x2 fmpz_mat squaring (patch from Marco Bo…
Browse files Browse the repository at this point in the history
…drato)
  • Loading branch information
fredrik-johansson committed Feb 10, 2024
1 parent b96dd71 commit d887651
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/fmpz_mat/sqr_bodrato.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,11 @@ fmpz_mat_sqr_bodrato(fmpz_mat_t B, const fmpz_mat_t A)
smul_ppmm(u, v, b, c);
add_ssaaaa(s, t, s, t, u, v);
fmpz_set_signed_uiui(E(B, 0, 0), s, t);
smul_ppmm(s, t, a, b);
smul_ppmm(u, v, b, d);
add_ssaaaa(s, t, s, t, u, v);
smul_ppmm(s, t, a + d, b);
fmpz_set_signed_uiui(E(B, 0, 1), s, t);
smul_ppmm(s, t, a, c);
smul_ppmm(u, v, c, d);
add_ssaaaa(s, t, s, t, u, v);
smul_ppmm(s, t, a + d, c);
fmpz_set_signed_uiui(E(B, 1, 0), s, t);
smul_ppmm(s, t, b, c);
smul_ppmm(u, v, d, d);
smul_ppmm(s, t, d, d);
add_ssaaaa(s, t, s, t, u, v);
fmpz_set_signed_uiui(E(B, 1, 1), s, t);
}
Expand Down

0 comments on commit d887651

Please sign in to comment.