local t = tex.getbox(a)
local x = {}
for n in node.traverse_id(node.id('hlist'), t.head) do
- local b = n.glue_order>0 and 0 or math.floor(100*math.pow(n.glue_set, 3)+0.5);
+ local b = n.glue_order>0 and 0 or math.floor(100*n.glue_set^3+0.5);
if b<=12 then x[#x+1]={2,b} % decent
elseif n.glue_sign==1 and b>=100 then x[#x+1]={0,b} %very loose
elseif n.glue_sign==1 then x[#x+1]={1,b} % loose
x[0]={2, 0}
local d = 0
for i=1,#x do
- d = d + math.floor(math.pow(tex.linepenalty + x[i][2], 2)+0.5)
+ d = d + math.floor((tex.linepenalty + x[i][2])^2+0.5)
if math.abs(x[i][1]-x[i-1][1])>=1 then d = d + tex.adjdemerits end
end
tex.sprint(-2,tostring(d) )