Average Error: 0.2 → 0.1
Time: 31.3s
Precision: 64
\[\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1\]
\[\left(\left(b \cdot b\right) \cdot 4 + \left({a}^{4} + b \cdot \left(\left(\left(a \cdot a + a \cdot a\right) + b \cdot b\right) \cdot b\right)\right)\right) - 1\]
\left({\left(a \cdot a + b \cdot b\right)}^{2} + 4 \cdot \left(b \cdot b\right)\right) - 1
\left(\left(b \cdot b\right) \cdot 4 + \left({a}^{4} + b \cdot \left(\left(\left(a \cdot a + a \cdot a\right) + b \cdot b\right) \cdot b\right)\right)\right) - 1
double f(double a, double b) {
        double r7279589 = a;
        double r7279590 = r7279589 * r7279589;
        double r7279591 = b;
        double r7279592 = r7279591 * r7279591;
        double r7279593 = r7279590 + r7279592;
        double r7279594 = 2.0;
        double r7279595 = pow(r7279593, r7279594);
        double r7279596 = 4.0;
        double r7279597 = r7279596 * r7279592;
        double r7279598 = r7279595 + r7279597;
        double r7279599 = 1.0;
        double r7279600 = r7279598 - r7279599;
        return r7279600;
}

double f(double a, double b) {
        double r7279601 = b;
        double r7279602 = r7279601 * r7279601;
        double r7279603 = 4.0;
        double r7279604 = r7279602 * r7279603;
        double r7279605 = a;
        double r7279606 = pow(r7279605, r7279603);
        double r7279607 = r7279605 * r7279605;
        double r7279608 = r7279607 + r7279607;
        double r7279609 = r7279608 + r7279602;
        double r7279610 = r7279609 * r7279601;
        double r7279611 = r7279601 * r7279610;
        double r7279612 = r7279606 + r7279611;
        double r7279613 = r7279604 + r7279612;
        double r7279614 = 1.0;
        double r7279615 = r7279613 - r7279614;
        return r7279615;
}

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.0

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \left(\left(\color{blue}{\left(b \cdot b\right) \cdot \left(\left(a \cdot a + a \cdot a\right) + b \cdot b\right)} + {a}^{4}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  16. Using strategy rm
  17. Applied associate-*l*0.1

    \[\leadsto \left(\left(\color{blue}{b \cdot \left(b \cdot \left(\left(a \cdot a + a \cdot a\right) + b \cdot b\right)\right)} + {a}^{4}\right) + 4 \cdot \left(b \cdot b\right)\right) - 1\]
  18. Final simplification0.1

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

Reproduce

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