Average Error: 0.2 → 0.0
Time: 18.7s
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 r8021849 = a;
        double r8021850 = r8021849 * r8021849;
        double r8021851 = b;
        double r8021852 = r8021851 * r8021851;
        double r8021853 = r8021850 + r8021852;
        double r8021854 = 2.0;
        double r8021855 = pow(r8021853, r8021854);
        double r8021856 = 4.0;
        double r8021857 = r8021856 * r8021852;
        double r8021858 = r8021855 + r8021857;
        double r8021859 = 1.0;
        double r8021860 = r8021858 - r8021859;
        return r8021860;
}

double f(double a, double b) {
        double r8021861 = b;
        double r8021862 = r8021861 * r8021861;
        double r8021863 = a;
        double r8021864 = r8021863 * r8021863;
        double r8021865 = r8021862 + r8021864;
        double r8021866 = sqrt(r8021865);
        double r8021867 = 4.0;
        double r8021868 = pow(r8021866, r8021867);
        double r8021869 = -1.0;
        double r8021870 = r8021868 + r8021869;
        double r8021871 = -4.0;
        double r8021872 = r8021871 * r8021862;
        double r8021873 = r8021870 - r8021872;
        return r8021873;
}

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 2019158 
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))