Average Error: 0.4 → 0.3
Time: 23.3s
Precision: 64
Internal Precision: 128
\[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
\[\left(d + a\right) + \left(c + \left(b + e\right)\right)\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Bits error versus e

Target

Original0.4
Target0.2
Herbie0.3
\[\left(d + \left(c + \left(a + b\right)\right)\right) + e\]

Derivation

  1. Initial program 0.4

    \[\left(\left(\left(e + d\right) + c\right) + b\right) + a\]
  2. Using strategy rm
  3. Applied associate-+l+0.4

    \[\leadsto \left(\color{blue}{\left(e + \left(d + c\right)\right)} + b\right) + a\]
  4. Applied associate-+l+0.3

    \[\leadsto \color{blue}{\left(e + \left(\left(d + c\right) + b\right)\right)} + a\]
  5. Applied associate-+l+0.3

    \[\leadsto \color{blue}{e + \left(\left(\left(d + c\right) + b\right) + a\right)}\]
  6. Using strategy rm
  7. Applied +-commutative0.3

    \[\leadsto e + \left(\color{blue}{\left(b + \left(d + c\right)\right)} + a\right)\]
  8. Applied associate-+l+0.3

    \[\leadsto e + \color{blue}{\left(b + \left(\left(d + c\right) + a\right)\right)}\]
  9. Applied associate-+r+0.3

    \[\leadsto \color{blue}{\left(e + b\right) + \left(\left(d + c\right) + a\right)}\]
  10. Using strategy rm
  11. Applied +-commutative0.3

    \[\leadsto \left(e + b\right) + \left(\color{blue}{\left(c + d\right)} + a\right)\]
  12. Applied associate-+l+0.2

    \[\leadsto \left(e + b\right) + \color{blue}{\left(c + \left(d + a\right)\right)}\]
  13. Applied associate-+r+0.3

    \[\leadsto \color{blue}{\left(\left(e + b\right) + c\right) + \left(d + a\right)}\]
  14. Final simplification0.3

    \[\leadsto \left(d + a\right) + \left(c + \left(b + e\right)\right)\]

Reproduce

herbie shell --seed 2019088 
(FPCore (a b c d e)
  :name "Expression 1, p15"
  :pre (<= 1 a 2 b 4 c 8 d 16 e 32)

  :herbie-target
  (+ (+ d (+ c (+ a b))) e)

  (+ (+ (+ (+ e d) c) b) a))