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 r57212 = 9.0;
        double r57213 = x;
        double r57214 = 4.0;
        double r57215 = pow(r57213, r57214);
        double r57216 = r57212 * r57215;
        double r57217 = y;
        double r57218 = r57217 * r57217;
        double r57219 = 2.0;
        double r57220 = r57218 - r57219;
        double r57221 = r57218 * r57220;
        double r57222 = r57216 - r57221;
        return r57222;
}

double f(double x, double y) {
        double r57223 = x;
        double r57224 = 4.0;
        double r57225 = pow(r57223, r57224);
        double r57226 = 9.0;
        double r57227 = 2.0;
        double r57228 = y;
        double r57229 = r57228 * r57228;
        double r57230 = r57227 * r57229;
        double r57231 = fma(r57225, r57226, r57230);
        double r57232 = sqrt(r57231);
        double r57233 = 4.0;
        double r57234 = pow(r57228, r57233);
        double r57235 = -r57234;
        double r57236 = fma(r57232, r57232, r57235);
        return r57236;
}

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