Average Error: 62.0 → 0
Time: 1.3s
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 r30852 = 9.0;
        double r30853 = x;
        double r30854 = 4.0;
        double r30855 = pow(r30853, r30854);
        double r30856 = r30852 * r30855;
        double r30857 = y;
        double r30858 = r30857 * r30857;
        double r30859 = 2.0;
        double r30860 = r30858 - r30859;
        double r30861 = r30858 * r30860;
        double r30862 = r30856 - r30861;
        return r30862;
}

double f(double x, double y) {
        double r30863 = x;
        double r30864 = 4.0;
        double r30865 = pow(r30863, r30864);
        double r30866 = 9.0;
        double r30867 = 2.0;
        double r30868 = y;
        double r30869 = r30868 * r30868;
        double r30870 = r30867 * r30869;
        double r30871 = fma(r30865, r30866, r30870);
        double r30872 = sqrt(r30871);
        double r30873 = 4.0;
        double r30874 = pow(r30868, r30873);
        double r30875 = -r30874;
        double r30876 = fma(r30872, r30872, r30875);
        return r30876;
}

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