Average Error: 0.1 → 0.1
Time: 11.6s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[x \cdot \left(\mathsf{fma}\left(-x, y, {\left(\sqrt[3]{1}\right)}^{3}\right) + x \cdot \left(\left(-y\right) + y\right)\right)\]
x \cdot \left(1 - x \cdot y\right)
x \cdot \left(\mathsf{fma}\left(-x, y, {\left(\sqrt[3]{1}\right)}^{3}\right) + x \cdot \left(\left(-y\right) + y\right)\right)
double f(double x, double y) {
        double r72176 = x;
        double r72177 = 1.0;
        double r72178 = y;
        double r72179 = r72176 * r72178;
        double r72180 = r72177 - r72179;
        double r72181 = r72176 * r72180;
        return r72181;
}

double f(double x, double y) {
        double r72182 = x;
        double r72183 = -r72182;
        double r72184 = y;
        double r72185 = 1.0;
        double r72186 = cbrt(r72185);
        double r72187 = 3.0;
        double r72188 = pow(r72186, r72187);
        double r72189 = fma(r72183, r72184, r72188);
        double r72190 = -r72184;
        double r72191 = r72190 + r72184;
        double r72192 = r72182 * r72191;
        double r72193 = r72189 + r72192;
        double r72194 = r72182 * r72193;
        return r72194;
}

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(-x, y, {\left(\sqrt[3]{1}\right)}^{3}\right)} + \mathsf{fma}\left(-y, x, y \cdot x\right)\right)\]
  6. Simplified0.1

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

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

Reproduce

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