Average Error: 0.0 → 0.0
Time: 11.3s
Precision: 64
Internal Precision: 128
\[\left(a + b\right) \cdot \left(a + b\right)\]
\[(\left((2 \cdot a + b)_*\right) \cdot b + \left(a \cdot a\right))_*\]

Error

Bits error versus a

Bits error versus b

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 inf 0.0

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

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

    \[\leadsto (\left((2 \cdot a + b)_*\right) \cdot b + \left(a \cdot a\right))_*\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(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: 10.9s)Debug log

sample18.0ms

Algorithm
intervals

simplify19.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

19.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 → 32
Calls

1 calls. Slowest were:

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

series15.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify2.3s

Counts
28 → 35
Calls

28 calls. Slowest were:

359.0ms
(* (+ (* a a) (- (* b b) (* a b))) (+ (* a a) (- (* b b) (* a b))))
356.0ms
(* (- (* a a) (* b b)) (+ (pow a 3) (pow b 3)))
235.0ms
(* (+ (pow a 3) (pow b 3)) (+ a b))

prune190.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize9.0ms

Local error

Found 1 expressions with local error:

0.0b
(fma (fma 2 a b) b (* a a))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 10
Calls

1 calls. Slowest were:

0.0ms
(fma (fma 2 a b) b (* a a))

series16.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

16.0ms
(fma (fma 2 a b) b (* a a))

simplify172.0ms

Counts
3 → 13
Calls

3 calls. Slowest were:

61.0ms
(+ (pow a 2) (+ (pow b 2) (* 2 (* a b))))
57.0ms
(+ (pow a 2) (+ (pow b 2) (* 2 (* a b))))
54.0ms
(+ (pow a 2) (+ (pow b 2) (* 2 (* a b))))

prune79.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize9.0ms

Local error

Found 3 expressions with local error:

0.9b
(exp (log (* (+ a b) (+ a b))))
0.1b
(log (* (+ a b) (+ a b)))
0.0b
(* (+ a b) (+ a b))

rewrite29.0ms

Algorithm
rewrite-expression-head
Counts
3 → 84
Calls

3 calls. Slowest were:

15.0ms
(exp (log (* (+ a b) (+ a b))))
8.0ms
(log (* (+ a b) (+ a b)))
6.0ms
(* (+ a b) (+ a b))

series73.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

50.0ms
(log (* (+ a b) (+ a b)))
13.0ms
(* (+ a b) (+ a b))
10.0ms
(exp (log (* (+ a b) (+ a b))))

simplify5.9s

Counts
65 → 93
Calls

65 calls. Slowest were:

394.0ms
(log (* (+ a b) (- (* a a) (* b b))))
388.0ms
(* (- (* a a) (* b b)) (+ (pow a 3) (pow b 3)))
321.0ms
(exp (log (* (+ a b) (- (* a a) (* b b)))))

prune739.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes114.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample1.2s

Algorithm
intervals