<commit_before>(a+b)^2 = a^2+b^2+2*a*b
(a-b)^2 = a^2+b^2-2*a*b

4*a*b = (a+b)^2-(a-b)^2

a*b = (a+b)^2/4 - (a-b)^2/4

-3  9 2
-2  4 1
-1  1 0
 0  0 0
 1  1 0
 2  4 1
 3  9 2
 4 16 4
 5 25 6
 6 36 9

0*0 = 0^2/4 -  0^2/4 = 0 - 0 = 0
0*1 = 1^2/4 - -1^2/4 = 0 - 0 = 0
0*2 = 2^2/4 - -2^2/4 = 1 - 1 = 0
0*3 = 3^2/4 - -3^2/4 = 2 - 2 = 0
1*0 = 1^2/4 -  1^2/4 = 0 - 0 = 0
1*1 = 2^2/4 -  0^2/4 = 1 - 0 = 1
1*2 = 3^2/4 - -1^2/4 = 2 - 0 = 2
1*3 = 4^2/4 - -2^2/4 = 4 - 1 = 3
2*0 = 2^2/4 -  2^2/4 = 1 - 1 = 0
2*1 = 3^2/4 -  1^2/4 = 2 - 0 = 2
2*2 = 4^2/4 -  0^2/4 = 4 - 0 = 4
2*3 = 5^2/4 - -1^2/4 = 6 - 0 = 6
3*0 = 3^2/4 -  3^2/4 = 2 - 2 = 0
3*1 = 4^2/4 -  2^2/4 = 4 - 1 = 3
3*2 = 5^2/4 -  1^2/4 = 6 - 0 = 6
3*3 = 6^2/4 -  0^2/4 = 9 - 0 = 9



  ; inputs in bx and cx
  mov si,offset table  ; 3 0 12  4
  shl bx,1             ; 2 0  8  2
  shl cx,1             ; 2 0  8  2
  add bx,cx            ; 2 0  8  3
  mov ax,[si+bx]       ; 2 2 16 19
  sub bx,cx            ; 2 0  8  3
  sub bx,cx            ; 2 0  8  3
  sub ax,[si+bx]       ; 2 2 16 20

  add bl,cl            ; 2 0  8  3
  mov al,[si+bx]       ; 2 2 12 15
  sub bl,cl            ; 2 0  8  3
  sub bl,cl            ; 2 0  8  3
  sub al,[si+bx]       ; 2 2 12 16



  mov al,[bx]
  mov




<commit_msg>Multiplication by squaring improvements<commit_after>(a+b)^2 = a^2+b^2+2*a*b
(a-b)^2 = a^2+b^2-2*a*b

4*a*b = (a+b)^2-(a-b)^2

a*b = (a+b)^2/4 - (a-b)^2/4

-3  9 2
-2  4 1
-1  1 0
 0  0 0
 1  1 0
 2  4 1
 3  9 2
 4 16 4
 5 25 6
 6 36 9

0*0 = 0^2/4 -  0^2/4 = 0 - 0 = 0
0*1 = 1^2/4 - -1^2/4 = 0 - 0 = 0
0*2 = 2^2/4 - -2^2/4 = 1 - 1 = 0
0*3 = 3^2/4 - -3^2/4 = 2 - 2 = 0
1*0 = 1^2/4 -  1^2/4 = 0 - 0 = 0
1*1 = 2^2/4 -  0^2/4 = 1 - 0 = 1
1*2 = 3^2/4 - -1^2/4 = 2 - 0 = 2
1*3 = 4^2/4 - -2^2/4 = 4 - 1 = 3
2*0 = 2^2/4 -  2^2/4 = 1 - 1 = 0
2*1 = 3^2/4 -  1^2/4 = 2 - 0 = 2
2*2 = 4^2/4 -  0^2/4 = 4 - 0 = 4
2*3 = 5^2/4 - -1^2/4 = 6 - 0 = 6
3*0 = 3^2/4 -  3^2/4 = 2 - 2 = 0
3*1 = 4^2/4 -  2^2/4 = 4 - 1 = 3
3*2 = 5^2/4 -  1^2/4 = 6 - 0 = 6
3*3 = 6^2/4 -  0^2/4 = 9 - 0 = 9



  ; inputs in bx and cx
  mov si,offset table  ; 3 0 12  4
  shl bx,1             ; 2 0  8  2
  shl cx,1             ; 2 0  8  2
  add bx,cx            ; 2 0  8  3
  mov ax,[si+bx]       ; 2 2 16 19
  sub bx,cx            ; 2 0  8  3
  sub bx,cx            ; 2 0  8  3
  sub ax,[si+bx]       ; 2 2 16 20

  ; inputs in bx and cx
  mov si,offset table  ; 3 0 12  4
  shl cx,1             ; 2 0  8  2
  add si,cx            ; 2 0  8  3
  mov ax,[si+bx]       ; 2 2 16 19
  neg bx               ; 2 0  8  3
  sub ax,[si+bx]       ; 2 2 16 20
  sub si,cx            ; 2 0  8  3

  ; Inputs in bx and cx
  add bx,cx            ; 2 0  8  3
  mov al,[si+bx]       ; 2 2 12 15
  sub bx,cx            ; 2 0  8  3
  sub bx,cx            ; 2 0  8  3
  sub al,[si+bx]       ; 2 2 12 16

  ; Inputs in bx and cx
  add si,cx            ; 2 0  8  3
  mov al,[si+bx]       ; 2 2 12 15
  neg bx               ; 2 0  8  3
  sub al,[si+bx]       ; 2 2 12 16
  sub si,cx            ; 2 0  8  3

{'fraction_non_alphanumeric': 0.1858910063523905, 'fraction_numerical': 0.21130056837178202, 'mean_word_length': 1.0507196710075395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '632414', 'n_tokens_mistral': 1992, 'n_tokens_neox': 1645, 'n_words': 532}