Average Error: 0.0 → 0.0
Time: 4.5s
Precision: 64
\[\frac{x + y}{y + y}\]
\[\left(1 + \frac{x}{y}\right) \cdot \frac{1}{2}\]
\frac{x + y}{y + y}
\left(1 + \frac{x}{y}\right) \cdot \frac{1}{2}
double f(double x, double y) {
        double r628723 = x;
        double r628724 = y;
        double r628725 = r628723 + r628724;
        double r628726 = r628724 + r628724;
        double r628727 = r628725 / r628726;
        return r628727;
}

double f(double x, double y) {
        double r628728 = 1.0;
        double r628729 = x;
        double r628730 = y;
        double r628731 = r628729 / r628730;
        double r628732 = r628728 + r628731;
        double r628733 = 0.5;
        double r628734 = r628732 * r628733;
        return r628734;
}

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.0
Target0.0
Herbie0.0
\[0.5 \cdot \frac{x}{y} + 0.5\]

Derivation

  1. Initial program 0.0

    \[\frac{x + y}{y + y}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{y + x}{y + y}}\]
  3. Taylor expanded around 0 0.0

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

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

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

Reproduce

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

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

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