Average Error: 0.2 → 0.0
Time: 4.8s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left({1}^{2} \cdot {\left(\mathsf{hypot}\left(a, b\right)\right)}^{\left(2 \cdot 2\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left({1}^{2} \cdot {\left(\mathsf{hypot}\left(a, b\right)\right)}^{\left(2 \cdot 2\right)} + 4 \cdot \left(b \cdot b\right)\right) - 1
double f(double a, double b) {
        double r373243 = a;
        double r373244 = r373243 * r373243;
        double r373245 = b;
        double r373246 = r373245 * r373245;
        double r373247 = r373244 + r373246;
        double r373248 = 2.0;
        double r373249 = pow(r373247, r373248);
        double r373250 = 4.0;
        double r373251 = r373250 * r373246;
        double r373252 = r373249 + r373251;
        double r373253 = 1.0;
        double r373254 = r373252 - r373253;
        return r373254;
}

double f(double a, double b) {
        double r373255 = 1.0;
        double r373256 = 2.0;
        double r373257 = pow(r373255, r373256);
        double r373258 = a;
        double r373259 = b;
        double r373260 = hypot(r373258, r373259);
        double r373261 = 2.0;
        double r373262 = r373261 * r373256;
        double r373263 = pow(r373260, r373262);
        double r373264 = r373257 * r373263;
        double r373265 = 4.0;
        double r373266 = r373259 * r373259;
        double r373267 = r373265 * r373266;
        double r373268 = r373264 + r373267;
        double r373269 = 1.0;
        double r373270 = r373268 - r373269;
        return r373270;
}

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. Using strategy rm
  3. Applied add-sqr-sqrt0.2

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

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

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

    \[\leadsto \left({\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} \cdot \color{blue}{{\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.2

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

    \[\leadsto \left(\color{blue}{\left({1}^{2} \cdot {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2}\right)} \cdot {\left(\mathsf{hypot}\left(a, b\right)\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  10. Applied associate-*l*0.2

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

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

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

Reproduce

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