Average Error: 0.0 → 0.1
Time: 9.4s
Precision: 64
\[\frac{x + y}{y + 1}\]
\[\frac{1}{\frac{y + 1}{x + y}}\]
\frac{x + y}{y + 1}
\frac{1}{\frac{y + 1}{x + y}}
double f(double x, double y) {
        double r306302 = x;
        double r306303 = y;
        double r306304 = r306302 + r306303;
        double r306305 = 1.0;
        double r306306 = r306303 + r306305;
        double r306307 = r306304 / r306306;
        return r306307;
}

double f(double x, double y) {
        double r306308 = 1.0;
        double r306309 = y;
        double r306310 = 1.0;
        double r306311 = r306309 + r306310;
        double r306312 = x;
        double r306313 = r306312 + r306309;
        double r306314 = r306311 / r306313;
        double r306315 = r306308 / r306314;
        return r306315;
}

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

    \[\frac{x + y}{y + 1}\]
  2. Using strategy rm
  3. Applied clear-num0.1

    \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{x + y}}}\]
  4. Final simplification0.1

    \[\leadsto \frac{1}{\frac{y + 1}{x + y}}\]

Reproduce

herbie shell --seed 2019350 
(FPCore (x y)
  :name "Data.Colour.SRGB:invTransferFunction from colour-2.3.3"
  :precision binary64
  (/ (+ x y) (+ y 1)))