g | x | w | all
Bytes Lang Time Link
097APLNARS250628T040659ZRosario
093APL Dyalog Unicode210107T085349ZRazetime
068CJam151202T055015ZReto Kor

APL(NARS), 97 chars

{z←' ',⍨⊃⍵,¨' '⍴⍨¨∊(k←⍴↑⍵)-⍴¨⍵⋄z[1;k,k+1]←'∣'(↑z[1;k])⋄z}∘{⍵,¨⌽+\↑¨¯1⌽¨⌽⍵}∘{1≥≢∪⍵:⊂⍵⋄(⊂⍵),∇-2-/⍵}

The problem was the align of the columns, so in pratice, align of column using matrix representation of the system, for me that takes more chars that the function that calculate result as vector that would be this (39 chars)

{⍵,¨⌽+\↑¨¯1⌽¨⌽⍵}∘{1≥≢∪⍵:⊂⍵⋄(⊂⍵),∇-2-/⍵}

Test:

  h←{z←' ',⍨⊃⍵,¨' '⍴⍨¨∊(k←⍴↑⍵)-⍴¨⍵⋄z[1;k,k+1]←'∣'(↑z[1;k])⋄z}∘{⍵,¨⌽+\↑¨¯1⌽¨⌽⍵}∘{1≥≢∪⍵:⊂⍵⋄(⊂⍵),∇-2-/⍵}
  h 4 8 15 16 23 42 
  4   8  15  16  23 42 ∣ 46
  4   7   1   7  19  4     
  3  ¯6   6  12 ¯15        
 ¯9  12   6 ¯27            
 21  ¯6 ¯33                
¯27 ¯27                    
  h 2 5 10 17 26
2 5 10 17 26 ∣ 37
3 5  7  9 11     
2 2  2  2        
  h 1 2 
1 2 ∣ 3
1 1    

APL (Dyalog Unicode), 93 bytes

{↑⍕¨¨{(⊂1⌽'|',⍨¯1⌽⊃⍵),(¯1↓1↓⍵),⊂(⊢,⊢/)⊃⌽⍵}⊃{(⊂⍺,(⊃⌽⍺)+⊃⌽⊃⍵),⍵}/⌽⊂@1⌽{⍵,⊂-2-/⊃⌽⍵}⍣{1≥≢∪⊃⌽⍺}⊂⍵}

Try it online!

The output format is a bit annoying, and takes up most of the space here.

CJam, 74 73 71 68 bytes

q~]{_2ew::-Wf*_)-}g0]W%{_W=@W=++_}*;)"|"\++]W%z{:s_:,$W=)f{Se]}}%zN*

Try it online

The latest version uses the middle section of @MartinBüttner's proposed solution, which is 3 bytes shorter than what I had. The first part for calculating the difference rows was identical. The part for the final formatting was the same length, so I kept my original version. Martin's savings came from making the sum part of the list while the new values are calculated, and using a * instead of a % loop. That also simplified the insertion of the "|".

Explanation:

l       Get one line of input.
~]      Interpret input and wrap in list.
{       While loop to construct additional lines.
  _2ew    Copy and build pairs of subsequent numbers.
  ::-     Reduce all number pairs by subtraction.
  Wf*     Multiply all of them by -1, since the reduction calculated 1st minus 2nd,
          but we need 2nd minus 1st.
  _)-     Check if all numbers in list are equal by popping off last and removing
          value from the list. This is truthy if all numbers are not equal.
}g      End of while loop to construct additional lines.
0       Add a 0 at the end, which will be the starting point of the sum for
        calculating the new values.
]       Wrap all lines in a list.
W%      Revert order of list, since adding the additional numbers in each row
        goes in bottom-up order.
{       Start of loop over rows.
  _W=     Get last value of row.
  @       Rotate previous row to top.
  W=      Extract last value as new increment. For the 0 that was added as an
          additional row, this is a comparison with -1, which gives the desired
          value of 0.
  +       Add increment to last value.
  +       Append value to list.
  _       Copy row for use in next loop iteration.
}*      End of loop over rows.
;       Remove extra copy of last row.
)       Pop off last value of last row.
"|"     Push the vertical bar.
\       Swap vertical bar and last value.
++      Concatenate the 3 parts.
W%      Revert order of list, to get the rows back in original order.
z       Transpose list for handling column alignment.
{       Loop over columns.
  :s      Convert values to strings.
  _:,     Copy and calculate the length of all values.
  $W=     Get maximum length by sorting and getting last value.
  )       Increment to add space between columns.
  f{      Apply to all values.
    Se]     Right pad to column width with spaces.
  }       End apply to all values.
}%      End loop over columns.
z       Transpose back to row order.
N*      Join rows with newlines.