Average Error: 0.1 → 0.0
Time: 1.5s
Precision: 64
\[\frac{x + y}{y + y}\]
\[\frac{\frac{x + y}{2}}{y}\]
\frac{x + y}{y + y}
\frac{\frac{x + y}{2}}{y}
double f(double x, double y) {
        double r701040 = x;
        double r701041 = y;
        double r701042 = r701040 + r701041;
        double r701043 = r701041 + r701041;
        double r701044 = r701042 / r701043;
        return r701044;
}

double f(double x, double y) {
        double r701045 = x;
        double r701046 = y;
        double r701047 = r701045 + r701046;
        double r701048 = 2.0;
        double r701049 = r701047 / r701048;
        double r701050 = r701049 / r701046;
        return r701050;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.0
Herbie0.0
\[0.5 \cdot \frac{x}{y} + 0.5\]

Derivation

  1. Initial program 0.1

    \[\frac{x + y}{y + y}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.1

    \[\leadsto \frac{x + y}{\color{blue}{1 \cdot y} + y}\]
  4. Applied distribute-lft1-in0.1

    \[\leadsto \frac{x + y}{\color{blue}{\left(1 + 1\right) \cdot y}}\]
  5. Applied associate-/r*0.0

    \[\leadsto \color{blue}{\frac{\frac{x + y}{1 + 1}}{y}}\]
  6. Simplified0.0

    \[\leadsto \frac{\color{blue}{\frac{x + y}{2}}}{y}\]
  7. Final simplification0.0

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

Reproduce

herbie shell --seed 2019322 
(FPCore (x y)
  :name "Data.Random.Distribution.T:$ccdf from random-fu-0.2.6.2"
  :precision binary64

  :herbie-target
  (+ (* 0.5 (/ x y)) 0.5)

  (/ (+ x y) (+ y y)))