Average Error: 62.0 → 0
Time: 1.1s
Precision: 64
\[x = 10864 \land y = 18817\]
\[9 \cdot {x}^{4} - \left(y \cdot y\right) \cdot \left(y \cdot y - 2\right)\]
\[\mathsf{fma}\left(\sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, \sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, -{y}^{4}\right)\]
9 \cdot {x}^{4} - \left(y \cdot y\right) \cdot \left(y \cdot y - 2\right)
\mathsf{fma}\left(\sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, \sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, -{y}^{4}\right)
double f(double x, double y) {
        double r62589 = 9.0;
        double r62590 = x;
        double r62591 = 4.0;
        double r62592 = pow(r62590, r62591);
        double r62593 = r62589 * r62592;
        double r62594 = y;
        double r62595 = r62594 * r62594;
        double r62596 = 2.0;
        double r62597 = r62595 - r62596;
        double r62598 = r62595 * r62597;
        double r62599 = r62593 - r62598;
        return r62599;
}

double f(double x, double y) {
        double r62600 = x;
        double r62601 = 4.0;
        double r62602 = pow(r62600, r62601);
        double r62603 = 9.0;
        double r62604 = 2.0;
        double r62605 = y;
        double r62606 = r62605 * r62605;
        double r62607 = r62604 * r62606;
        double r62608 = fma(r62602, r62603, r62607);
        double r62609 = sqrt(r62608);
        double r62610 = 4.0;
        double r62611 = pow(r62605, r62610);
        double r62612 = -r62611;
        double r62613 = fma(r62609, r62609, r62612);
        return r62613;
}

Error

Derivation

  1. Initial program 62.0

    \[9 \cdot {x}^{4} - \left(y \cdot y\right) \cdot \left(y \cdot y - 2\right)\]
  2. Simplified62.0

    \[\leadsto \color{blue}{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right) - {y}^{4}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt62.0

    \[\leadsto \color{blue}{\sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)} \cdot \sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}} - {y}^{4}\]
  5. Applied fma-neg0

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, \sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, -{y}^{4}\right)}\]
  6. Final simplification0

    \[\leadsto \mathsf{fma}\left(\sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, \sqrt{\mathsf{fma}\left({x}^{4}, 9, 2 \cdot \left(y \cdot y\right)\right)}, -{y}^{4}\right)\]

Reproduce

herbie shell --seed 2020024 +o rules:numerics
(FPCore (x y)
  :name "From Rump in a 1983 paper, rewritten"
  :precision binary64
  :pre (and (== x 10864) (== y 18817))
  (- (* 9 (pow x 4)) (* (* y y) (- (* y y) 2))))