Average Error: 0.4 → 0.2
Time: 6.5s
Precision: 64
\[\frac{x \cdot 100}{x + y}\]
\[\frac{x}{y + x} \cdot 100\]
\frac{x \cdot 100}{x + y}
\frac{x}{y + x} \cdot 100
double f(double x, double y) {
        double r497321 = x;
        double r497322 = 100.0;
        double r497323 = r497321 * r497322;
        double r497324 = y;
        double r497325 = r497321 + r497324;
        double r497326 = r497323 / r497325;
        return r497326;
}

double f(double x, double y) {
        double r497327 = x;
        double r497328 = y;
        double r497329 = r497328 + r497327;
        double r497330 = r497327 / r497329;
        double r497331 = 100.0;
        double r497332 = r497330 * r497331;
        return r497332;
}

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.4
Target0.2
Herbie0.2
\[\frac{x}{1} \cdot \frac{100}{x + y}\]

Derivation

  1. Initial program 0.4

    \[\frac{x \cdot 100}{x + y}\]
  2. Using strategy rm
  3. Applied associate-/l*0.2

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

    \[\leadsto \frac{x}{\color{blue}{\frac{y + x}{100}}}\]
  5. Using strategy rm
  6. Applied associate-/r/0.2

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

    \[\leadsto \frac{x}{y + x} \cdot 100\]

Reproduce

herbie shell --seed 2019196 
(FPCore (x y)
  :name "Development.Shake.Progress:message from shake-0.15.5"

  :herbie-target
  (* (/ x 1.0) (/ 100.0 (+ x y)))

  (/ (* x 100.0) (+ x y)))