> 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(threed);

`Default spacetime` = threed

`For the threed spacetime:`

Coordinates

x(up)

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

`Line element`

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

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

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

415*additions+2420*multiplications+2788*functions

415 additions=416 terms

> grcalc(RR12):

`CPU Time ` = 0.

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

518*additions+2952*multiplications+3518*functions

518 additions=519 terms

>