Average Error: 0.1 → 0.1
Time: 16.2s
Precision: 64
\[x \cdot \left(1 - x \cdot y\right)\]
\[1 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)\]
x \cdot \left(1 - x \cdot y\right)
1 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)
double f(double x, double y) {
        double r2661952 = x;
        double r2661953 = 1.0;
        double r2661954 = y;
        double r2661955 = r2661952 * r2661954;
        double r2661956 = r2661953 - r2661955;
        double r2661957 = r2661952 * r2661956;
        return r2661957;
}

double f(double x, double y) {
        double r2661958 = 1.0;
        double r2661959 = x;
        double r2661960 = r2661958 * r2661959;
        double r2661961 = y;
        double r2661962 = r2661961 * r2661959;
        double r2661963 = -r2661959;
        double r2661964 = r2661962 * r2661963;
        double r2661965 = r2661960 + r2661964;
        return r2661965;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[x \cdot \left(1 - x \cdot y\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.1

    \[\leadsto x \cdot \color{blue}{\left(1 + \left(-x \cdot y\right)\right)}\]
  4. Applied distribute-rgt-in0.1

    \[\leadsto \color{blue}{1 \cdot x + \left(-x \cdot y\right) \cdot x}\]
  5. Final simplification0.1

    \[\leadsto 1 \cdot x + \left(y \cdot x\right) \cdot \left(-x\right)\]

Reproduce

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