Average Error: 0.0 → 0.0
Time: 17.6s
Precision: 64
Internal Precision: 128
\[\left(a + b\right) \cdot \left(a + b\right)\]
\[\left(\left(b \cdot a\right) \cdot 2 + {b}^{2}\right) + {a}^{2}\]

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.0
Target0.0
Herbie0.0
\[\left(\left(b \cdot a + b \cdot b\right) + b \cdot a\right) + a \cdot a\]

Derivation

  1. Initial program 0.0

    \[\left(a + b\right) \cdot \left(a + b\right)\]
  2. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{{a}^{2} + \left({b}^{2} + 2 \cdot \left(a \cdot b\right)\right)}\]
  3. Final simplification0.0

    \[\leadsto \left(\left(b \cdot a\right) \cdot 2 + {b}^{2}\right) + {a}^{2}\]

Reproduce

herbie shell --seed 2019008 
(FPCore (a b)
  :name "Expression 4, p15"
  :pre (and (<= 5 a 10) (<= 0 b 0.001))

  :herbie-target
  (+ (+ (+ (* b a) (* b b)) (* b a)) (* a a))

  (* (+ a b) (+ a b)))

Details

Time bar (total: 17.1s)Debug log

sample21.0ms

Algorithm
intervals

simplify15.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

15.0ms
(* (+ a b) (+ a b))

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 1 expressions with local error:

0.0b
(* (+ a b) (+ a b))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 30
Calls

1 calls. Slowest were:

4.0ms
(* (+ a b) (+ a b))

series10.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

9.0ms
(* (+ a b) (+ a b))

simplify2.2s

Counts
28 → 33
Calls

28 calls. Slowest were:

366.0ms
(* (- (* a a) (* b b)) (+ a b))
321.0ms
(* (+ (* a a) (- (* b b) (* a b))) (- a b))
305.0ms
(* (+ (* a a) (- (* b b) (* a b))) (+ (* a a) (- (* b b) (* a b))))

prune288.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize34.0ms

Local error

Found 2 expressions with local error:

0.0b
(+ (pow b 2) (* 2 (* a b)))
0.0b
(+ (pow a 2) (+ (pow b 2) (* 2 (* a b))))

rewrite24.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

16.0ms
(+ (pow a 2) (+ (pow b 2) (* 2 (* a b))))
7.0ms
(+ (pow b 2) (* 2 (* a b)))

series60.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

35.0ms
(+ (pow b 2) (* 2 (* a b)))
24.0ms
(+ (pow a 2) (+ (pow b 2) (* 2 (* a b))))

simplify506.0ms

Counts
11 → 31
Calls

11 calls. Slowest were:

135.0ms
(* (exp (pow a 2)) (exp (+ (pow b 2) (* 2 (* a b)))))
111.0ms
(* (exp (pow a 2)) (* (exp (pow b 2)) (exp (* 2 (* a b)))))
51.0ms
(* (exp (pow b 2)) (exp (* 2 (* a b))))

prune322.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize31.0ms

Local error

Found 4 expressions with local error:

0.7b
(pow (pow a 2) 3)
0.5b
(* (pow a 2) (pow a 2))
0.4b
(/ (+ (pow (pow a 2) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3)) (+ (* (pow a 2) (pow a 2)) (- (* (+ (pow b 2) (* 2 (* a b))) (+ (pow b 2) (* 2 (* a b)))) (* (pow a 2) (+ (pow b 2) (* 2 (* a b)))))))
0.3b
(* (pow a 2) (+ (pow b 2) (* 2 (* a b))))

rewrite112.0ms

Algorithm
rewrite-expression-head
Counts
4 → 123
Calls

4 calls. Slowest were:

101.0ms
(/ (+ (pow (pow a 2) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3)) (+ (* (pow a 2) (pow a 2)) (- (* (+ (pow b 2) (* 2 (* a b))) (+ (pow b 2) (* 2 (* a b)))) (* (pow a 2) (+ (pow b 2) (* 2 (* a b)))))))
6.0ms
(* (pow a 2) (+ (pow b 2) (* 2 (* a b))))
3.0ms
(* (pow a 2) (pow a 2))

series188.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

90.0ms
(/ (+ (pow (pow a 2) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3)) (+ (* (pow a 2) (pow a 2)) (- (* (+ (pow b 2) (* 2 (* a b))) (+ (pow b 2) (* 2 (* a b)))) (* (pow a 2) (+ (pow b 2) (* 2 (* a b)))))))
47.0ms
(* (pow a 2) (+ (pow b 2) (* 2 (* a b))))
29.0ms
(pow (pow a 2) 3)
22.0ms
(* (pow a 2) (pow a 2))

simplify9.9s

Counts
117 → 135
Calls

117 calls. Slowest were:

590.0ms
(- (* (pow (pow a 2) 3) (pow (pow a 2) 3)) (* (pow (+ (pow b 2) (* 2 (* a b))) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3)))
398.0ms
(/ (* (* (+ (pow (pow a 2) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3)) (+ (pow (pow a 2) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3))) (+ (pow (pow a 2) 3) (pow (+ (pow b 2) (* 2 (* a b))) 3))) (* (* (+ (* (pow a 2) (pow a 2)) (- (* (+ (pow b 2) (* 2 (* a b))) (+ (pow b 2) (* 2 (* a b)))) (* (pow a 2) (+ (pow b 2) (* 2 (* a b)))))) (+ (* (pow a 2) (pow a 2)) (- (* (+ (pow b 2) (* 2 (* a b))) (+ (pow b 2) (* 2 (* a b)))) (* (pow a 2) (+ (pow b 2) (* 2 (* a b))))))) (+ (* (pow a 2) (pow a 2)) (- (* (+ (pow b 2) (* 2 (* a b))) (+ (pow b 2) (* 2 (* a b)))) (* (pow a 2) (+ (pow b 2) (* 2 (* a b))))))))
255.0ms
(+ (* (pow b 2) (pow b 2)) (- (* (* 2 (* a b)) (* 2 (* a b))) (* (pow b 2) (* 2 (* a b)))))

prune2.1s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes93.0ms

Accuracy

0% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 0.0b

bsearch2.0ms

end0.0ms

sample1.2s

Algorithm
intervals