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 r44148 = 9.0;
        double r44149 = x;
        double r44150 = 4.0;
        double r44151 = pow(r44149, r44150);
        double r44152 = r44148 * r44151;
        double r44153 = y;
        double r44154 = r44153 * r44153;
        double r44155 = 2.0;
        double r44156 = r44154 - r44155;
        double r44157 = r44154 * r44156;
        double r44158 = r44152 - r44157;
        return r44158;
}

double f(double x, double y) {
        double r44159 = x;
        double r44160 = 4.0;
        double r44161 = pow(r44159, r44160);
        double r44162 = 9.0;
        double r44163 = 2.0;
        double r44164 = y;
        double r44165 = r44164 * r44164;
        double r44166 = r44163 * r44165;
        double r44167 = fma(r44161, r44162, r44166);
        double r44168 = sqrt(r44167);
        double r44169 = 4.0;
        double r44170 = pow(r44164, r44169);
        double r44171 = -r44170;
        double r44172 = fma(r44168, r44168, r44171);
        return r44172;
}

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