Average Error: 0.2 → 0.2
Time: 40.2s
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(3 + a\right)\right)\right) - 1\]
\[\mathsf{fma}\left(\left(\sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}, 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\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(3 + a\right)\right)\right) - 1
\mathsf{fma}\left(\left(\sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(3 + a, b \cdot b, \left(a \cdot a\right) \cdot \left(1 - a\right)\right)}, 4, {\left(\mathsf{fma}\left(b, b, a \cdot a\right)\right)}^{2} - 1\right)
double f(double a, double b) {
        double r10585629 = a;
        double r10585630 = r10585629 * r10585629;
        double r10585631 = b;
        double r10585632 = r10585631 * r10585631;
        double r10585633 = r10585630 + r10585632;
        double r10585634 = 2.0;
        double r10585635 = pow(r10585633, r10585634);
        double r10585636 = 4.0;
        double r10585637 = 1.0;
        double r10585638 = r10585637 - r10585629;
        double r10585639 = r10585630 * r10585638;
        double r10585640 = 3.0;
        double r10585641 = r10585640 + r10585629;
        double r10585642 = r10585632 * r10585641;
        double r10585643 = r10585639 + r10585642;
        double r10585644 = r10585636 * r10585643;
        double r10585645 = r10585635 + r10585644;
        double r10585646 = r10585645 - r10585637;
        return r10585646;
}

double f(double a, double b) {
        double r10585647 = 3.0;
        double r10585648 = a;
        double r10585649 = r10585647 + r10585648;
        double r10585650 = b;
        double r10585651 = r10585650 * r10585650;
        double r10585652 = r10585648 * r10585648;
        double r10585653 = 1.0;
        double r10585654 = r10585653 - r10585648;
        double r10585655 = r10585652 * r10585654;
        double r10585656 = fma(r10585649, r10585651, r10585655);
        double r10585657 = cbrt(r10585656);
        double r10585658 = r10585657 * r10585657;
        double r10585659 = r10585658 * r10585657;
        double r10585660 = 4.0;
        double r10585661 = fma(r10585650, r10585650, r10585652);
        double r10585662 = 2.0;
        double r10585663 = pow(r10585661, r10585662);
        double r10585664 = r10585663 - r10585653;
        double r10585665 = fma(r10585659, r10585660, r10585664);
        return r10585665;
}

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

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

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

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

Reproduce

herbie shell --seed 2019200 +o rules:numerics
(FPCore (a b)
  :name "Bouland and Aaronson, Equation (24)"
  (- (+ (pow (+ (* a a) (* b b)) 2.0) (* 4.0 (+ (* (* a a) (- 1.0 a)) (* (* b b) (+ 3.0 a))))) 1.0))