Average Error: 62.0 → 0
Time: 1.2s
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 r55517 = 9.0;
        double r55518 = x;
        double r55519 = 4.0;
        double r55520 = pow(r55518, r55519);
        double r55521 = r55517 * r55520;
        double r55522 = y;
        double r55523 = r55522 * r55522;
        double r55524 = 2.0;
        double r55525 = r55523 - r55524;
        double r55526 = r55523 * r55525;
        double r55527 = r55521 - r55526;
        return r55527;
}

double f(double x, double y) {
        double r55528 = x;
        double r55529 = 4.0;
        double r55530 = pow(r55528, r55529);
        double r55531 = 9.0;
        double r55532 = 2.0;
        double r55533 = y;
        double r55534 = r55533 * r55533;
        double r55535 = r55532 * r55534;
        double r55536 = fma(r55530, r55531, r55535);
        double r55537 = sqrt(r55536);
        double r55538 = 4.0;
        double r55539 = pow(r55533, r55538);
        double r55540 = -r55539;
        double r55541 = fma(r55537, r55537, r55540);
        return r55541;
}

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 2020049 +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))))