Average Error: 0.0 → 0.0
Time: 572.0ms
Precision: 64
\[\left(1 - x\right) - y\]
\[1 + \left(-\left(x + y\right)\right)\]
\left(1 - x\right) - y
1 + \left(-\left(x + y\right)\right)
double f(double x, double y) {
        double r276864 = 1.0;
        double r276865 = x;
        double r276866 = r276864 - r276865;
        double r276867 = y;
        double r276868 = r276866 - r276867;
        return r276868;
}

double f(double x, double y) {
        double r276869 = 1.0;
        double r276870 = x;
        double r276871 = y;
        double r276872 = r276870 + r276871;
        double r276873 = -r276872;
        double r276874 = r276869 + r276873;
        return r276874;
}

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

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

    \[\leadsto \color{blue}{\left(1 + \left(-x\right)\right)} - y\]
  4. Applied associate--l+0.0

    \[\leadsto \color{blue}{1 + \left(\left(-x\right) - y\right)}\]
  5. Simplified0.0

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

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

Reproduce

herbie shell --seed 2019356 
(FPCore (x y)
  :name "Data.Colour.CIE.Chromaticity:chromaCoords from colour-2.3.3"
  :precision binary64
  (- (- 1 x) y))