Average Error: 0.1 → 0.0
Time: 11.7s
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 r465079 = x;
        double r465080 = y;
        double r465081 = r465079 + r465080;
        double r465082 = r465080 + r465080;
        double r465083 = r465081 / r465082;
        return r465083;
}

double f(double x, double y) {
        double r465084 = x;
        double r465085 = y;
        double r465086 = r465084 + r465085;
        double r465087 = 2.0;
        double r465088 = r465086 / r465087;
        double r465089 = r465088 / r465085;
        return r465089;
}

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)))