Average Error: 3.7 → 2.8
Time: 9.1s
Precision: 64
Internal precision: 384
\[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2\]
\[\left(a + \left(\left(b + c\right) + d\right)\right) \cdot 2\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Target

Original3.7
Comparison3.8
Herbie2.8
\[ \left(a + b\right) \cdot 2 + \left(c + d\right) \cdot 2 \]

Derivation

  1. Initial program 3.7

    \[\left(a + \left(b + \left(c + d\right)\right)\right) \cdot 2\]
  2. Using strategy rm
  3. Applied associate-+r+ 2.8

    \[\leadsto \left(a + \color{blue}{\left(\left(b + c\right) + d\right)}\right) \cdot 2\]
  4. Removed slow pow expressions

Runtime

Time bar (total: 9.1s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (a b c d)
  :name "Expression, p6"
  :pre (and (<= -14 a -13) (<= -3 b -2) (<= 3 c 3.5) (<= 12.5 d 13.5))

  :target
  (+ (* (+ a b) 2) (* (+ c d) 2))

  (* (+ a (+ b (+ c d))) 2))