Average Error: 0.0 → 0.0
Time: 7.1s
Precision: 64
\[x \cdot y - x\]
\[\left(y - 1\right) \cdot x\]
x \cdot y - x
\left(y - 1\right) \cdot x
double f(double x, double y) {
        double r21279495 = x;
        double r21279496 = y;
        double r21279497 = r21279495 * r21279496;
        double r21279498 = r21279497 - r21279495;
        return r21279498;
}

double f(double x, double y) {
        double r21279499 = y;
        double r21279500 = 1.0;
        double r21279501 = r21279499 - r21279500;
        double r21279502 = x;
        double r21279503 = r21279501 * r21279502;
        return r21279503;
}

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.0

    \[x \cdot y - x\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto x \cdot y - \color{blue}{1 \cdot x}\]
  4. Applied *-commutative0.0

    \[\leadsto \color{blue}{y \cdot x} - 1 \cdot x\]
  5. Applied distribute-rgt-out--0.0

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

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

Reproduce

herbie shell --seed 2019158 
(FPCore (x y)
  :name "Data.Histogram.Bin.LogBinD:$cbinSizeN from histogram-fill-0.8.4.1"
  (- (* x y) x))