Average Error: 0.0 → 0.0
Time: 1.6s
Precision: 64
\[5 \le a \le 10 \land 0.0 \le b \le 10^{-3}\]
\[\left(a + b\right) \cdot \left(a + b\right)\]
\[{a}^{2} + \log \left({\left(e^{b}\right)}^{\left(b + 2 \cdot a\right)}\right)\]
\left(a + b\right) \cdot \left(a + b\right)
{a}^{2} + \log \left({\left(e^{b}\right)}^{\left(b + 2 \cdot a\right)}\right)
double f(double a, double b) {
        double r95649 = a;
        double r95650 = b;
        double r95651 = r95649 + r95650;
        double r95652 = r95651 * r95651;
        return r95652;
}

double f(double a, double b) {
        double r95653 = a;
        double r95654 = 2.0;
        double r95655 = pow(r95653, r95654);
        double r95656 = b;
        double r95657 = exp(r95656);
        double r95658 = r95654 * r95653;
        double r95659 = r95656 + r95658;
        double r95660 = pow(r95657, r95659);
        double r95661 = log(r95660);
        double r95662 = r95655 + r95661;
        return r95662;
}

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. Using strategy rm
  3. Applied distribute-lft-in0.0

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

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

    \[\leadsto a \cdot \left(a + b\right) + \color{blue}{b \cdot \left(a + b\right)}\]
  6. Taylor expanded around 0 0.0

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020065 
(FPCore (a b)
  :name "Expression 4, p15"
  :precision binary64
  :pre (and (<= 5 a 10) (<= 0.0 b 0.001))

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

  (* (+ a b) (+ a b)))