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

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

    \[\leadsto \color{blue}{{a}^{2} + \left({b}^{2} + 2 \cdot \left(a \cdot b\right)\right)}\]
  3. Using strategy rm
  4. Applied add-log-exp0.0

    \[\leadsto {a}^{2} + \left({b}^{2} + \color{blue}{\log \left(e^{2 \cdot \left(a \cdot b\right)}\right)}\right)\]
  5. Applied add-log-exp0.0

    \[\leadsto {a}^{2} + \left(\color{blue}{\log \left(e^{{b}^{2}}\right)} + \log \left(e^{2 \cdot \left(a \cdot b\right)}\right)\right)\]
  6. Applied sum-log0.0

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

    \[\leadsto {a}^{2} + \log \color{blue}{\left({\left(e^{b}\right)}^{\left(\left(a + a\right) + b\right)}\right)}\]
  8. Taylor expanded around 0 0.0

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

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

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

Runtime

Time bar (total: 18.4s)Debug logProfile

herbie shell --seed 2018296 
(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)))