Average Error: 0.2 → 0.0
Time: 28.5s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left(4 \cdot \left(b \cdot b\right) + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{4}\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left(4 \cdot \left(b \cdot b\right) + {\left(\mathsf{hypot}\left(a, b\right)\right)}^{4}\right) - 1
double f(double a, double b) {
        double r7093686 = a;
        double r7093687 = r7093686 * r7093686;
        double r7093688 = b;
        double r7093689 = r7093688 * r7093688;
        double r7093690 = r7093687 + r7093689;
        double r7093691 = 2.0;
        double r7093692 = pow(r7093690, r7093691);
        double r7093693 = 4.0;
        double r7093694 = r7093693 * r7093689;
        double r7093695 = r7093692 + r7093694;
        double r7093696 = 1.0;
        double r7093697 = r7093695 - r7093696;
        return r7093697;
}

double f(double a, double b) {
        double r7093698 = 4.0;
        double r7093699 = b;
        double r7093700 = r7093699 * r7093699;
        double r7093701 = r7093698 * r7093700;
        double r7093702 = a;
        double r7093703 = hypot(r7093702, r7093699);
        double r7093704 = pow(r7093703, r7093698);
        double r7093705 = r7093701 + r7093704;
        double r7093706 = 1.0;
        double r7093707 = r7093705 - r7093706;
        return r7093707;
}

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(b \cdot b\right)\right) - 1\]
  2. Taylor expanded around inf 0.2

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

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

    \[\leadsto \left({\left(\color{blue}{{\left(\mathsf{hypot}\left(a, b\right)\right)}^{1}} \cdot \mathsf{hypot}\left(a, b\right)\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  6. Applied pow-plus0.2

    \[\leadsto \left({\color{blue}{\left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{\left(1 + 1\right)}\right)}}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  7. Applied pow-pow0.0

    \[\leadsto \left(\color{blue}{{\left(\mathsf{hypot}\left(a, b\right)\right)}^{\left(\left(1 + 1\right) \cdot 2\right)}} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  8. Simplified0.0

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

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

Reproduce

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