Average Error: 0.0 → 0.0
Time: 9.8s
Precision: 64
Internal Precision: 128
\[a \cdot \left(\left(b + c\right) + d\right)\]
\[b \cdot a + \left(d + c\right) \cdot a\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Bits error versus d

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 0.0

    \[a \cdot \left(\left(b + c\right) + d\right)\]
  2. Taylor expanded around -inf 0.0

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

    \[\leadsto \color{blue}{a \cdot \left(b + \left(d + c\right)\right)}\]
  4. Using strategy rm
  5. Applied distribute-rgt-in0.0

    \[\leadsto \color{blue}{b \cdot a + \left(d + c\right) \cdot a}\]
  6. Final simplification0.0

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

Reproduce

herbie shell --seed 2019026 
(FPCore (a b c d)
  :name "Expression, p14"
  :pre (and (<= 56789 a 98765) (<= 0 b 1) (<= 0 c 0.0016773) (<= 0 d 0.0016773))

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

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