anchor.diff:    areEqual (optim 5 exp1) <@@ fun a -> 1. / (a + 1.) @@>
     let exp2 = <@ fun a -> (1. / a + 1.) * a @>
     areEqual (optim 5 exp2) <@@ fun a -> 1. + a @@>
  +  let exp3 = <@ fun a -> (1. / (a*a) + 1.) * (a*a) @>
  +  areEqual (optim 5 exp3) <@@ fun a -> 1. + a*a @@>
  +  let exp4 = <@ fun a b -> (1. / (a*b) + 1.) * (a*b) @>
  +  areEqual (optim 5 exp4) <@@ fun a b -> 1. + a*b @@>
  +  let exp5 = <@ fun a -> (1. / (1. + 1. / a)) @>
  +  areEqual (optim 6 exp5) <@@ fun a -> a / (a + 1.) @@>
  +  let exp6 = <@ fun a -> (1. - a) * (1. + a) @>
  +  areEqual (optim 10 exp6) <@@ fun a -> 1. - a*a @@>
   
   let training_generator_k (init: unit -> unit) (cont1: int -> Expr -> unit) (cont2: int -> Expr -> unit): unit = 
     let trainingBase = "training_base"
  
positive.code:   //       )  
    steps
  
  
  let log_optimize (e: Expr) (rs: List<Rule>) (logger: string -> unit)= 
    let debug = false
  
negative.code: 
  [<Test>]
  let testSearchOnHardProgram () = 
    let comp = ruleengine.compilePatternToRule
    let rs = algebraicRulesScalarAll
    let debug = true
    let debugger = Logging.consoleLogger debug
    //let reporter = Logging.completeReporter (ccodegen.prettyprint) debugger
    //let children = optimizer.examineAllRules rs
    //let costModel = cost.fopCost
    let reporter = Logging.completeReporter (fun (e, _) -> ccodegen.prettyprint e) debugger
    let children (e, historyRules) =
      let applicableRules = examineAllRulesPositioned rs e
      applicableRules |> List.map (fun r -> applyRuleAtParticularPosition e r, r :: historyRules)
    let costModel = fun e -> e |> fst |> cost.fopCost
    let optim levels e = 
      //let init = e
      //let equals a b = alphaEquals a b Map.empty
      //let exprHash e = (exprPreorderString e).GetHashCode()
      //let extractExp e = e |> fst
      let init = (e, [])
      let equals a b = alphaEquals (fst a) (fst b) Map.empty
      let exprHash e = e |> fst |> exprHashCode
      let extractExp e = e |> fst |> fst
      let t = tic()
      //let algo levels = bfs levels
      let algo levels = 
        fastBfs levels equals exprHash
      let o = algo levels reporter init children costModel 
      printfn "rules: %A" (o |> fst |> snd |> List.rev)
      toc t "BFS"
      o |> extractExp
    let areEqual e1 e2 =
      let isEqual = transformer.alphaEquals e1 e2 Map.empty
      Assert.IsTrue(isEqual, sprintf "Expected: %A\nActual: %A" e2 e1)
  