Average Error: 0.2 → 0.2
Time: 21.1s
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(3 + a\right)\right)\right) - 1\]
\[\left(\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(3 + a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(3 + a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(3 + a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\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(3 + a\right)\right)\right) - 1
\left(\sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(3 + a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(3 + a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)}}\right) \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 1 - a, \left(b \cdot b\right) \cdot \left(3 + a\right)\right), 4, {\left(\mathsf{fma}\left(a, a, b \cdot b\right)\right)}^{2}\right)} - 1
double f(double a, double b) {
        double r165736 = a;
        double r165737 = r165736 * r165736;
        double r165738 = b;
        double r165739 = r165738 * r165738;
        double r165740 = r165737 + r165739;
        double r165741 = 2.0;
        double r165742 = pow(r165740, r165741);
        double r165743 = 4.0;
        double r165744 = 1.0;
        double r165745 = r165744 - r165736;
        double r165746 = r165737 * r165745;
        double r165747 = 3.0;
        double r165748 = r165747 + r165736;
        double r165749 = r165739 * r165748;
        double r165750 = r165746 + r165749;
        double r165751 = r165743 * r165750;
        double r165752 = r165742 + r165751;
        double r165753 = r165752 - r165744;
        return r165753;
}

double f(double a, double b) {
        double r165754 = a;
        double r165755 = r165754 * r165754;
        double r165756 = 1.0;
        double r165757 = r165756 - r165754;
        double r165758 = b;
        double r165759 = r165758 * r165758;
        double r165760 = 3.0;
        double r165761 = r165760 + r165754;
        double r165762 = r165759 * r165761;
        double r165763 = fma(r165755, r165757, r165762);
        double r165764 = 4.0;
        double r165765 = fma(r165754, r165754, r165759);
        double r165766 = 2.0;
        double r165767 = pow(r165765, r165766);
        double r165768 = fma(r165763, r165764, r165767);
        double r165769 = sqrt(r165768);
        double r165770 = sqrt(r165769);
        double r165771 = r165770 * r165770;
        double r165772 = r165771 * r165769;
        double r165773 = r165772 - r165756;
        return r165773;
}

Error

Bits error versus a

Bits error versus b

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(3 + a\right)\right)\right) - 1\]
  2. Simplified0.2

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

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

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

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

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

Reproduce

herbie shell --seed 2019305 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (24)"
  :precision binary64
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (+ (* (* a a) (- 1 a)) (* (* b b) (+ 3 a))))) 1))