Average Error: 0.0 → 0.1
Time: 1.7s
Precision: 64
\[\frac{x + y}{y + 1}\]
\[\left(x + y\right) \cdot \frac{1}{y + 1}\]
\frac{x + y}{y + 1}
\left(x + y\right) \cdot \frac{1}{y + 1}
double f(double x, double y) {
        double r196119 = x;
        double r196120 = y;
        double r196121 = r196119 + r196120;
        double r196122 = 1.0;
        double r196123 = r196120 + r196122;
        double r196124 = r196121 / r196123;
        return r196124;
}

double f(double x, double y) {
        double r196125 = x;
        double r196126 = y;
        double r196127 = r196125 + r196126;
        double r196128 = 1.0;
        double r196129 = 1.0;
        double r196130 = r196126 + r196129;
        double r196131 = r196128 / r196130;
        double r196132 = r196127 * r196131;
        return r196132;
}

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 div-inv0.1

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

    \[\leadsto \left(x + y\right) \cdot \frac{1}{y + 1}\]

Reproduce

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