Average Error: 0.1 → 0.1
Time: 13.0s
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) + \left(x - x\right) \cdot y\right)\]
x \cdot \left(1 - x \cdot y\right)
x \cdot \left(\mathsf{fma}\left(-y, x, {\left(\sqrt[3]{1}\right)}^{3}\right) + \left(x - x\right) \cdot y\right)
double f(double x, double y) {
        double r73509 = x;
        double r73510 = 1.0;
        double r73511 = y;
        double r73512 = r73509 * r73511;
        double r73513 = r73510 - r73512;
        double r73514 = r73509 * r73513;
        return r73514;
}

double f(double x, double y) {
        double r73515 = x;
        double r73516 = y;
        double r73517 = -r73516;
        double r73518 = 1.0;
        double r73519 = cbrt(r73518);
        double r73520 = 3.0;
        double r73521 = pow(r73519, r73520);
        double r73522 = fma(r73517, r73515, r73521);
        double r73523 = r73515 - r73515;
        double r73524 = r73523 * r73516;
        double r73525 = r73522 + r73524;
        double r73526 = r73515 * r73525;
        return r73526;
}

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. Simplified0.1

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

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

Reproduce

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