Average Error: 0.2 → 0.6
Time: 23.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(1 - 3 \cdot a\right)\right)\right) - 1\]
\[\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)\right)\right)\]
\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
\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right)\right) \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)\right)\right)
double f(double a, double b) {
        double r8481782 = a;
        double r8481783 = r8481782 * r8481782;
        double r8481784 = b;
        double r8481785 = r8481784 * r8481784;
        double r8481786 = r8481783 + r8481785;
        double r8481787 = 2.0;
        double r8481788 = pow(r8481786, r8481787);
        double r8481789 = 4.0;
        double r8481790 = 1.0;
        double r8481791 = r8481790 + r8481782;
        double r8481792 = r8481783 * r8481791;
        double r8481793 = 3.0;
        double r8481794 = r8481793 * r8481782;
        double r8481795 = r8481790 - r8481794;
        double r8481796 = r8481785 * r8481795;
        double r8481797 = r8481792 + r8481796;
        double r8481798 = r8481789 * r8481797;
        double r8481799 = r8481788 + r8481798;
        double r8481800 = r8481799 - r8481790;
        return r8481800;
}

double f(double a, double b) {
        double r8481801 = 4.0;
        double r8481802 = a;
        double r8481803 = fma(r8481801, r8481802, r8481801);
        double r8481804 = r8481802 * r8481802;
        double r8481805 = b;
        double r8481806 = r8481805 * r8481805;
        double r8481807 = -12.0;
        double r8481808 = fma(r8481802, r8481807, r8481801);
        double r8481809 = fma(r8481802, r8481802, r8481806);
        double r8481810 = -1.0;
        double r8481811 = fma(r8481809, r8481809, r8481810);
        double r8481812 = cbrt(r8481811);
        double r8481813 = r8481812 * r8481812;
        double r8481814 = cbrt(r8481813);
        double r8481815 = cbrt(r8481812);
        double r8481816 = r8481815 * r8481812;
        double r8481817 = r8481814 * r8481816;
        double r8481818 = r8481815 * r8481814;
        double r8481819 = r8481817 * r8481818;
        double r8481820 = fma(r8481806, r8481808, r8481819);
        double r8481821 = fma(r8481803, r8481804, r8481820);
        return r8481821;
}

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)\right)\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.5

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)\right)\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.5

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

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \color{blue}{\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)}\right)\right)\]
  8. Using strategy rm
  9. Applied add-cube-cbrt0.6

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

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(4, a, 4\right), a \cdot a, \mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(a, -12, 4\right), \left(\color{blue}{\left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}\right) \cdot \left(\sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)} \cdot \sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}} \cdot \sqrt[3]{\sqrt[3]{\mathsf{fma}\left(\mathsf{fma}\left(a, a, b \cdot b\right), \mathsf{fma}\left(a, a, b \cdot b\right), -1\right)}}\right)\right)\right)\]
  11. Applied associate-*l*0.6

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(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))