Average Error: 0.2 → 0.1
Time: 23.0s
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 r7203469 = a;
        double r7203470 = r7203469 * r7203469;
        double r7203471 = b;
        double r7203472 = r7203471 * r7203471;
        double r7203473 = r7203470 + r7203472;
        double r7203474 = 2.0;
        double r7203475 = pow(r7203473, r7203474);
        double r7203476 = 4.0;
        double r7203477 = 1.0;
        double r7203478 = r7203477 + r7203469;
        double r7203479 = r7203470 * r7203478;
        double r7203480 = 3.0;
        double r7203481 = r7203480 * r7203469;
        double r7203482 = r7203477 - r7203481;
        double r7203483 = r7203472 * r7203482;
        double r7203484 = r7203479 + r7203483;
        double r7203485 = r7203476 * r7203484;
        double r7203486 = r7203475 + r7203485;
        double r7203487 = r7203486 - r7203477;
        return r7203487;
}

double f(double a, double b) {
        double r7203488 = 4.0;
        double r7203489 = 1.0;
        double r7203490 = a;
        double r7203491 = r7203489 + r7203490;
        double r7203492 = r7203490 * r7203490;
        double r7203493 = r7203491 * r7203492;
        double r7203494 = b;
        double r7203495 = r7203494 * r7203494;
        double r7203496 = 3.0;
        double r7203497 = r7203490 * r7203496;
        double r7203498 = r7203489 - r7203497;
        double r7203499 = r7203495 * r7203498;
        double r7203500 = r7203493 + r7203499;
        double r7203501 = r7203488 * r7203500;
        double r7203502 = pow(r7203490, r7203488);
        double r7203503 = 2.0;
        double r7203504 = r7203492 * r7203503;
        double r7203505 = r7203495 + r7203504;
        double r7203506 = sqrt(r7203505);
        double r7203507 = sqrt(r7203506);
        double r7203508 = r7203507 * r7203495;
        double r7203509 = r7203508 * r7203507;
        double r7203510 = r7203506 * r7203509;
        double r7203511 = r7203502 + r7203510;
        double r7203512 = r7203501 + r7203511;
        double r7203513 = r7203512 - r7203489;
        return r7203513;
}

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))