Average Error: 0.1 → 0.1
Time: 12.2s
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 r79950 = x;
        double r79951 = 1.0;
        double r79952 = y;
        double r79953 = r79950 * r79952;
        double r79954 = r79951 - r79953;
        double r79955 = r79950 * r79954;
        return r79955;
}

double f(double x, double y) {
        double r79956 = x;
        double r79957 = y;
        double r79958 = -r79957;
        double r79959 = 1.0;
        double r79960 = cbrt(r79959);
        double r79961 = 3.0;
        double r79962 = pow(r79960, r79961);
        double r79963 = fma(r79958, r79956, r79962);
        double r79964 = r79956 - r79956;
        double r79965 = r79964 * r79957;
        double r79966 = r79963 + r79965;
        double r79967 = r79956 * r79966;
        return r79967;
}

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 2020047 +o rules:numerics
(FPCore (x y)
  :name "Numeric.SpecFunctions:log1p from math-functions-0.1.5.2, A"
  :precision binary64
  (* x (- 1 (* x y))))