Average Error: 0.2 → 0.0
Time: 19.8s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left({\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{4} + \left(b \cdot b\right) \cdot 4\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left({\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{4} + \left(b \cdot b\right) \cdot 4\right) - 1
double f(double a, double b) {
        double r5708846 = a;
        double r5708847 = r5708846 * r5708846;
        double r5708848 = b;
        double r5708849 = r5708848 * r5708848;
        double r5708850 = r5708847 + r5708849;
        double r5708851 = 2.0;
        double r5708852 = pow(r5708850, r5708851);
        double r5708853 = 4.0;
        double r5708854 = r5708853 * r5708849;
        double r5708855 = r5708852 + r5708854;
        double r5708856 = 1.0;
        double r5708857 = r5708855 - r5708856;
        return r5708857;
}

double f(double a, double b) {
        double r5708858 = a;
        double r5708859 = b;
        double r5708860 = r5708859 * r5708859;
        double r5708861 = fma(r5708858, r5708858, r5708860);
        double r5708862 = sqrt(r5708861);
        double r5708863 = 4.0;
        double r5708864 = pow(r5708862, r5708863);
        double r5708865 = r5708860 * r5708863;
        double r5708866 = r5708864 + r5708865;
        double r5708867 = 1.0;
        double r5708868 = r5708866 - r5708867;
        return r5708868;
}

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(b \cdot b\right)\right) - 1\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.2

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

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

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

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

    \[\leadsto \left(1 \cdot \left(\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)} \cdot \mathsf{fma}\left(a, a, b \cdot b\right)\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  9. Applied associate-*l*0.1

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

    \[\leadsto \left(1 \cdot \left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}\right)\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  12. Applied cube-unmult0.1

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

    \[\leadsto \left(1 \cdot \left(\color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{1}} \cdot {\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{3}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  14. Applied pow-prod-up0.0

    \[\leadsto \left(1 \cdot \color{blue}{{\left(\sqrt{\mathsf{fma}\left(a, a, b \cdot b\right)}\right)}^{\left(1 + 3\right)}} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  15. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (26)"
  (- (+ (pow (+ (* a a) (* b b)) 2) (* 4 (* b b))) 1))