> restart:

> grtw();

`GRTensorII Version 1.79 (R6)`

`2 February 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`

> with(codegen,cost):

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):

>

> qload(twodg1);

`Default spacetime` = twodg1

`For the twodg1 spacetime:`

Coordinates

x(up)

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

`Line element`

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

> 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 ` = .10e-1

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

45*multiplications+79*functions+16*additions

16 additions=17 terms

> grcalc(RR12):

`CPU Time ` = 0.

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

44*multiplications+79*functions+17*additions

16 additions=17 terms

>