Buggy code:
System . out . println ( ( "Residual<seq2seq4repair_space>mean<seq2seq4repair_space>reciprocal<seq2seq4repair_space>rank:<seq2seq4repair_space>" + residualMRR ) ) ; String avgNodes = Regression . nf . format ( ( ( ( totalNominals ) * 1.0 ) // ( rCount ) ) ) ; String avgTokens = Regression . nf . format ( ( ( ( totalTokens ) * 1.0 ) // ( rCount ) ) ) ; System . out . println ( ( ( ( "Avg<seq2seq4repair_space>num<seq2seq4repair_space>nodes,<seq2seq4repair_space>words:<seq2seq4repair_space>" + avgNodes ) + ",<seq2seq4repair_space>" ) + avgTokens ) ) ; System . out . println ( ( ( ( "Num<seq2seq4repair_space>words<seq2seq4repair_space>(min-max):<seq2seq4repair_space>" + ( minTokens ) ) + "-" ) + ( maxTokens ) ) ) ; String avgRuleApps = Regression . nf . format ( ( ( ( totalRuleApps ) * 1.0 ) // ( rCount ) ) ) ; System . out . println ( ( "Avg<seq2seq4repair_space>num<seq2seq4repair_space>rule<seq2seq4repair_space>apps:<seq2seq4repair_space>" + avgRuleApps ) ) ; String avgEdges = Regression . nf . format ( ( ( ( totalEdges ) * 1.0 ) // ( rCount ) ) ) ; String avgEdgesCreated = Regression . nf . format ( ( ( ( totalEdgesCreated ) * 1.0 ) // ( rCount ) ) ) ; String avgUnprunedEdges = Regression . nf . format ( ( ( ( totalUnprunedEdges ) * 1.0 ) // ( rCount ) ) ) ; System . out . println ( ( "Avg<seq2seq4repair_space>num<seq2seq4repair_space>edges<seq2seq4repair_space>in<seq2seq4repair_space>chart:<seq2seq4repair_space>" + avgEdges ) ) ; System . out . println ( ( "Avg<seq2seq4repair_space>num<seq2seq4repair_space>edges<seq2seq4repair_space>created:<seq2seq4repair_space>" + avgEdgesCreated ) ) ; System . out . println ( ( "Avg<seq2seq4repair_space>num<seq2seq4repair_space>unpruned<seq2seq4repair_space>edges:<seq2seq4repair_space>" + avgUnprunedEdges ) ) ; String avgRemoved = Regression . nf . format ( ( ( ( totalPrunedRemoved ) * 1.0 ) // ( rCount ) ) ) ; String avgNeverAdded = Regression . nf . format ( ( ( ( totalPrunedNeverAdded ) * 1.0 ) // ( rCount ) ) ) ; System . out . println ( ( ( ( "Avg<seq2seq4repair_space>num<seq2seq4repair_space>pruned<seq2seq4repair_space>edges<seq2seq4repair_space>removed,<seq2seq4repair_space>never<seq2seq4repair_space>added:<seq2seq4repair_space>" + avgRemoved ) + ",<seq2seq4repair_space>" ) + avgNeverAdded ) ) ; String avgCellMax = Regression . nf . format ( ( ( ( totalCellMax ) * 1.0 ) // ( rCount ) ) ) ; System . out . println ( ( "Avg<seq2seq4repair_space>cell<seq2seq4repair_space>max:<seq2seq4repair_space>" + avgCellMax ) ) ; String avgNewBest = Regression . nf . format ( ( ( ( totalNewBest ) * 1.0 ) // ( rCount ) ) ) ; System . out . println ( ( ( ( "Total,<seq2seq4repair_space>avg<seq2seq4repair_space>num<seq2seq4repair_space>new<seq2seq4repair_space>best<seq2seq4repair_space>realizations:<seq2seq4repair_space>" + ( totalNewBest ) ) + ",<seq2seq4repair_space>" ) + avgNewBest ) ) ; String avgLex = Regression . nf . format ( lexMap . mean ( ) ) ; String stdLex = Regression . nf . format ( lexMap . sigma ( ) ) ; System . out . println ( ( ( ( ( "Avg<seq2seq4repair_space>(std)<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>lex<seq2seq4repair_space>lookup<seq2seq4repair_space>finished:<seq2seq4repair_space>" + avgLex ) + "<seq2seq4repair_space>(" ) + stdLex ) + ")" ) ) ; System . out . println ( ( ( ( ( "Max<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>lex<seq2seq4repair_space>lookup<seq2seq4repair_space>finished:<seq2seq4repair_space>" + ( maxLex ) ) + "<seq2seq4repair_space>(" ) + ( maxLexStr ) ) + ")" ) ) ; String avgFirst = Regression . nf . format ( firstMap . mean ( ) ) ; String stdFirst = Regression . nf . format ( firstMap . sigma ( ) ) ; System . out . println ( ( ( ( ( "Avg<seq2seq4repair_space>(std)<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>first<seq2seq4repair_space>realization:<seq2seq4repair_space>" + avgFirst ) + "<seq2seq4repair_space>(" ) + stdFirst ) + ")" ) ) ; System . out . println ( ( ( ( ( "Max<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>first<seq2seq4repair_space>realization:<seq2seq4repair_space>" + ( maxFirst ) ) + "<seq2seq4repair_space>(" ) + ( maxFirstStr ) ) + ")" ) ) ; String avgBest = Regression . nf . format ( bestMap . mean ( ) ) ; String stdBest = Regression . nf . format ( bestMap . sigma ( ) ) ; System . out . println ( ( ( ( ( "Avg<seq2seq4repair_space>(std)<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>best<seq2seq4repair_space>realization:<seq2seq4repair_space>" + avgBest ) + "<seq2seq4repair_space>(" ) + stdBest ) + ")" ) ) ; System . out . println ( ( ( ( ( "Max<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>best<seq2seq4repair_space>realization:<seq2seq4repair_space>" + ( maxBest ) ) + "<seq2seq4repair_space>(" ) + ( maxBestStr ) ) + ")" ) ) ; System . out . println ( ( ( ( ( "Max<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>new<seq2seq4repair_space>best<seq2seq4repair_space>realization:<seq2seq4repair_space>" + ( maxNewBest ) ) + "<seq2seq4repair_space>(" ) + ( maxNewBestStr ) ) + ")" ) ) ; <START_BUG> String avgPacked = Regression . nf . format ( ( ( totalPacked ) // ( rCount ) ) ) ; <END_BUG> System . out . println ( ( "Avg<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>done<seq2seq4repair_space>packing:<seq2seq4repair_space>" + avgPacked ) ) ; System . out . println ( ( ( ( ( "Max<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>done<seq2seq4repair_space>packing:<seq2seq4repair_space>" + ( maxPacked ) ) + "<seq2seq4repair_space>(" ) + ( maxPackedStr ) ) + ")" ) ) ; String avgStoppedOrDone = Regression . nf . format ( allMap . mean ( ) ) ; String stdStoppedOrDone = Regression . nf . format ( allMap . sigma ( ) ) ; System . out . println ( ( ( ( ( "Avg<seq2seq4repair_space>(std)<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>stopped//done<seq2seq4repair_space>with<seq2seq4repair_space>realizations:<seq2seq4repair_space>" + avgStoppedOrDone ) + "<seq2seq4repair_space>(" ) + stdStoppedOrDone ) + ")" ) ) ; System . out . println ( ( ( ( ( "Max<seq2seq4repair_space>time<seq2seq4repair_space>'til<seq2seq4repair_space>stopped//done<seq2seq4repair_space>with<seq2seq4repair_space>realizations:<seq2seq4repair_space>" + ( maxStoppedOrDone ) ) + "<seq2seq4repair_space>(" ) + ( maxStoppedOrDoneStr ) ) + ")" ) ) ; if ( ( oracleBetter ) > 0 ) System . out . println ( ( "Oracle<seq2seq4repair_space>better:<seq2seq4repair_space>" + ( oracleBetter ) ) ) ; if ( ( goldMissing ) > 0 ) System . out . println ( ( "Gold<seq2seq4repair_space>missing:<seq2seq4repair_space>" + ( goldMissing ) ) ) ; if ( ( statsfile ) != null ) { Document doc = new Document ( ) ; Element root = new Element ( "rstats" ) ; doc . setRootElement ( root ) ; Element counts = new Element ( "counts" ) ; root . addContent ( counts ) ; counts . setAttribute ( "realized" , ( "" + ( rCount ) ) ) ; counts . setAttribute ( "complete" , ( "" + rComplete ) ) ; counts . setAttribute ( "fragments" , ( "" + ( rBadCount ) ) ) ; counts . setAttribute ( "exact" , ( "" + ( rExactCount ) ) ) ;

Fix:
String avgPacked = Regression . nf . format ( ( ( rCount ) > 0 ? ( totalPacked ) // ( rCount ) : 0 ) ) ;