Average Error: 0.2 → 0.0
Time: 18.1s
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 r9132024 = a;
        double r9132025 = r9132024 * r9132024;
        double r9132026 = b;
        double r9132027 = r9132026 * r9132026;
        double r9132028 = r9132025 + r9132027;
        double r9132029 = 2.0;
        double r9132030 = pow(r9132028, r9132029);
        double r9132031 = 4.0;
        double r9132032 = r9132031 * r9132027;
        double r9132033 = r9132030 + r9132032;
        double r9132034 = 1.0;
        double r9132035 = r9132033 - r9132034;
        return r9132035;
}

double f(double a, double b) {
        double r9132036 = b;
        double r9132037 = r9132036 * r9132036;
        double r9132038 = a;
        double r9132039 = r9132038 * r9132038;
        double r9132040 = r9132037 + r9132039;
        double r9132041 = sqrt(r9132040);
        double r9132042 = 4.0;
        double r9132043 = pow(r9132041, r9132042);
        double r9132044 = -1.0;
        double r9132045 = r9132043 + r9132044;
        double r9132046 = -4.0;
        double r9132047 = r9132046 * r9132037;
        double r9132048 = r9132045 - r9132047;
        return r9132048;
}

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(\left(b \cdot b + a \cdot a\right) \cdot \color{blue}{\left(\sqrt{b \cdot b + a \cdot a} \cdot \sqrt{b \cdot b + a \cdot a}\right)} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  5. Applied associate-*r*0.1

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

    \[\leadsto \left(\left(\left(b \cdot b + a \cdot a\right) \cdot \sqrt{b \cdot b + a \cdot a}\right) \cdot \color{blue}{{\left(\sqrt{b \cdot b + a \cdot a}\right)}^{1}} + -1\right) - -4 \cdot \left(b \cdot b\right)\]
  8. Applied add-sqr-sqrt0.1

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

    \[\leadsto \left(\color{blue}{{\left(\sqrt{b \cdot b + a \cdot a}\right)}^{3}} \cdot {\left(\sqrt{b \cdot b + a \cdot a}\right)}^{1} + -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(3 + 1\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 2019163 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))