Average Error: 0.2 → 0.0
Time: 19.5s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left({\left(\sqrt{b \cdot b + a \cdot a}\right)}^{4} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left({\left(\sqrt{b \cdot b + a \cdot a}\right)}^{4} + -1\right) - -4 \cdot \left(b \cdot b\right)
double f(double a, double b) {
        double r7644464 = a;
        double r7644465 = r7644464 * r7644464;
        double r7644466 = b;
        double r7644467 = r7644466 * r7644466;
        double r7644468 = r7644465 + r7644467;
        double r7644469 = 2.0;
        double r7644470 = pow(r7644468, r7644469);
        double r7644471 = 4.0;
        double r7644472 = r7644471 * r7644467;
        double r7644473 = r7644470 + r7644472;
        double r7644474 = 1.0;
        double r7644475 = r7644473 - r7644474;
        return r7644475;
}

double f(double a, double b) {
        double r7644476 = b;
        double r7644477 = r7644476 * r7644476;
        double r7644478 = a;
        double r7644479 = r7644478 * r7644478;
        double r7644480 = r7644477 + r7644479;
        double r7644481 = sqrt(r7644480);
        double r7644482 = 4.0;
        double r7644483 = pow(r7644481, r7644482);
        double r7644484 = -1.0;
        double r7644485 = r7644483 + r7644484;
        double r7644486 = -4.0;
        double r7644487 = r7644486 * r7644477;
        double r7644488 = r7644485 - r7644487;
        return r7644488;
}

Error

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  2. Simplified0.2

    \[\leadsto \color{blue}{\left(\left(b \cdot b + a \cdot a\right) \cdot \left(b \cdot b + a \cdot a\right) + -1\right) - -4 \cdot \left(b \cdot b\right)}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.2

    \[\leadsto \left(\color{blue}{\left(\sqrt{b \cdot b + a \cdot a} \cdot \sqrt{b \cdot b + a \cdot a}\right)} \cdot \left(b \cdot b + a \cdot a\right) + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  5. Applied associate-*l*0.1

    \[\leadsto \left(\color{blue}{\sqrt{b \cdot b + a \cdot a} \cdot \left(\sqrt{b \cdot b + a \cdot a} \cdot \left(b \cdot b + a \cdot a\right)\right)} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.1

    \[\leadsto \left(\sqrt{b \cdot b + a \cdot a} \cdot \left(\sqrt{b \cdot b + a \cdot a} \cdot \color{blue}{\left(\sqrt{b \cdot b + a \cdot a} \cdot \sqrt{b \cdot b + a \cdot a}\right)}\right) + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  8. Applied cube-unmult0.1

    \[\leadsto \left(\sqrt{b \cdot b + a \cdot a} \cdot \color{blue}{{\left(\sqrt{b \cdot b + a \cdot a}\right)}^{3}} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  9. Applied pow10.1

    \[\leadsto \left(\color{blue}{{\left(\sqrt{b \cdot b + a \cdot a}\right)}^{1}} \cdot {\left(\sqrt{b \cdot b + a \cdot a}\right)}^{3} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  10. Applied pow-prod-up0.0

    \[\leadsto \left(\color{blue}{{\left(\sqrt{b \cdot b + a \cdot a}\right)}^{\left(1 + 3\right)}} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  11. Simplified0.0

    \[\leadsto \left({\left(\sqrt{b \cdot b + a \cdot a}\right)}^{\color{blue}{4}} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  12. Final simplification0.0

    \[\leadsto \left({\left(\sqrt{b \cdot b + a \cdot a}\right)}^{4} + -1\right) - -4 \cdot \left(b \cdot b\right)\]

Reproduce

herbie shell --seed 2019162 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))