Average Error: 0.2 → 0.1
Time: 23.4s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\left(4 \cdot \left(\left(1 + a\right) \cdot \left(a \cdot a\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right) + \left({a}^{4} + \sqrt{b \cdot b + \left(a \cdot a\right) \cdot 2} \cdot \left(\left(\sqrt{\sqrt{b \cdot b + \left(a \cdot a\right) \cdot 2}} \cdot \left(b \cdot b\right)\right) \cdot \sqrt{\sqrt{b \cdot b + \left(a \cdot a\right) \cdot 2}}\right)\right)\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1
\left(4 \cdot \left(\left(1 + a\right) \cdot \left(a \cdot a\right) + \left(b \cdot b\right) \cdot \left(1 - a \cdot 3\right)\right) + \left({a}^{4} + \sqrt{b \cdot b + \left(a \cdot a\right) \cdot 2} \cdot \left(\left(\sqrt{\sqrt{b \cdot b + \left(a \cdot a\right) \cdot 2}} \cdot \left(b \cdot b\right)\right) \cdot \sqrt{\sqrt{b \cdot b + \left(a \cdot a\right) \cdot 2}}\right)\right)\right) - 1
double f(double a, double b) {
        double r6096231 = a;
        double r6096232 = r6096231 * r6096231;
        double r6096233 = b;
        double r6096234 = r6096233 * r6096233;
        double r6096235 = r6096232 + r6096234;
        double r6096236 = 2.0;
        double r6096237 = pow(r6096235, r6096236);
        double r6096238 = 4.0;
        double r6096239 = 1.0;
        double r6096240 = r6096239 + r6096231;
        double r6096241 = r6096232 * r6096240;
        double r6096242 = 3.0;
        double r6096243 = r6096242 * r6096231;
        double r6096244 = r6096239 - r6096243;
        double r6096245 = r6096234 * r6096244;
        double r6096246 = r6096241 + r6096245;
        double r6096247 = r6096238 * r6096246;
        double r6096248 = r6096237 + r6096247;
        double r6096249 = r6096248 - r6096239;
        return r6096249;
}

double f(double a, double b) {
        double r6096250 = 4.0;
        double r6096251 = 1.0;
        double r6096252 = a;
        double r6096253 = r6096251 + r6096252;
        double r6096254 = r6096252 * r6096252;
        double r6096255 = r6096253 * r6096254;
        double r6096256 = b;
        double r6096257 = r6096256 * r6096256;
        double r6096258 = 3.0;
        double r6096259 = r6096252 * r6096258;
        double r6096260 = r6096251 - r6096259;
        double r6096261 = r6096257 * r6096260;
        double r6096262 = r6096255 + r6096261;
        double r6096263 = r6096250 * r6096262;
        double r6096264 = pow(r6096252, r6096250);
        double r6096265 = 2.0;
        double r6096266 = r6096254 * r6096265;
        double r6096267 = r6096257 + r6096266;
        double r6096268 = sqrt(r6096267);
        double r6096269 = sqrt(r6096268);
        double r6096270 = r6096269 * r6096257;
        double r6096271 = r6096270 * r6096269;
        double r6096272 = r6096268 * r6096271;
        double r6096273 = r6096264 + r6096272;
        double r6096274 = r6096263 + r6096273;
        double r6096275 = r6096274 - r6096251;
        return r6096275;
}

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(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
  2. Taylor expanded around 0 0.0

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot \color{blue}{\left(\sqrt{b \cdot b + 2 \cdot \left(a \cdot a\right)} \cdot \sqrt{b \cdot b + 2 \cdot \left(a \cdot a\right)}\right)} + {a}^{4}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
  15. Applied associate-*r*0.1

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

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

    \[\leadsto \left(\left(\left(\left(b \cdot b\right) \cdot \color{blue}{\left(\sqrt{\sqrt{b \cdot b + 2 \cdot \left(a \cdot a\right)}} \cdot \sqrt{\sqrt{b \cdot b + 2 \cdot \left(a \cdot a\right)}}\right)}\right) \cdot \sqrt{b \cdot b + 2 \cdot \left(a \cdot a\right)} + {a}^{4}\right) + 4 \cdot \left(\left(a \cdot a\right) \cdot \left(1 + a\right) + \left(b \cdot b\right) \cdot \left(1 - 3 \cdot a\right)\right)\right) - 1\]
  19. Applied associate-*r*0.1

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

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

Reproduce

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