> restart:

First note how cost counts:

> C:=x+y;

C := x+y

> codegen[cost](C);

additions

> C1:=x+y+z;

C1 := x+y+z

> codegen[cost](C1);

2*additions

> interface(labelling=false):

> grtw();

`GRTensorII Version 1.80-pre2 (R6)`

`2 March 2001`

`Developed by Peter Musgrave, Denis Pollney and Kay...

`Copyright 1994-2001 by the authors.`

`Latest version available from: http://grtensor.phy...

`e:/Grtii(6)/Metrics`

Load the dimension

> qload(fived);

`Default spacetime` = fived

sig has not been calculated.

`For the fived spacetime:`

Coordinates*`:`*x(up)

`x `^a = vector([x1, x2, x3, x4, x5])

`Line element`*`:`*ds

` ds`^2 = a(x1,x2,x3,x4,x5)*` d`*x1^`2 `+2*b(x1,x2,...
` ds`^2 = a(x1,x2,x3,x4,x5)*` d`*x1^`2 `+2*b(x1,x2,...
` ds`^2 = a(x1,x2,x3,x4,x5)*` d`*x1^`2 `+2*b(x1,x2,...
` ds`^2 = a(x1,x2,x3,x4,x5)*` d`*x1^`2 `+2*b(x1,x2,...

> grOptionDefaultSimp:=0:

> grdef(`RR11:=g{^c ^d}*R{c $x1 $x1 d}`):

Created definition for RR11

> grdef(`RR12:=g{^c ^d}*R{c $x1 $x2 d}`):

Created definition for RR12

> grcalc(RR11):

`CPU Time ` = 2.804

> codegen[cost](numer(grcomponent(RR11,[])));

298133*additions+3003051*functions+2968596*multipli...

298133*additions =298134 terms

> grcalc(RR12):

`CPU Time ` = .550

> codegen[cost](numer(grcomponent(RR12,[])));

410972*additions+4150197*functions+4072962*multipli...

410972*additions = 410973 terms