Average Error: 0.1 → 0.1
Time: 2.6s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[x \cdot \left(\mathsf{fma}\left(-y, x, {\left(\sqrt[3]{1}\right)}^{3}\right) + \mathsf{fma}\left(-y, x, y \cdot x\right)\right)\]
x \cdot \left(1 - x \cdot y\right)
x \cdot \left(\mathsf{fma}\left(-y, x, {\left(\sqrt[3]{1}\right)}^{3}\right) + \mathsf{fma}\left(-y, x, y \cdot x\right)\right)
double f(double x, double y) {
        double r63563 = x;
        double r63564 = 1.0;
        double r63565 = y;
        double r63566 = r63563 * r63565;
        double r63567 = r63564 - r63566;
        double r63568 = r63563 * r63567;
        return r63568;
}

double f(double x, double y) {
        double r63569 = x;
        double r63570 = y;
        double r63571 = -r63570;
        double r63572 = 1.0;
        double r63573 = cbrt(r63572);
        double r63574 = 3.0;
        double r63575 = pow(r63573, r63574);
        double r63576 = fma(r63571, r63569, r63575);
        double r63577 = r63570 * r63569;
        double r63578 = fma(r63571, r63569, r63577);
        double r63579 = r63576 + r63578;
        double r63580 = r63569 * r63579;
        return r63580;
}

Error

Bits error versus x

Bits error versus y

Derivation

  1. Initial program 0.1

    \[x \cdot \left(1 - x \cdot y\right)\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.1

    \[\leadsto x \cdot \left(\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}} - x \cdot y\right)\]
  4. Applied prod-diff0.1

    \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -y \cdot x\right) + \mathsf{fma}\left(-y, x, y \cdot x\right)\right)}\]
  5. Simplified0.1

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

    \[\leadsto x \cdot \left(\mathsf{fma}\left(-y, x, {\left(\sqrt[3]{1}\right)}^{3}\right) + \mathsf{fma}\left(-y, x, y \cdot x\right)\right)\]

Reproduce

herbie shell --seed 2020046 +o rules:numerics
(FPCore (x y)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
  :precision binary64
  (* x (- 1 (* x y))))