Average Error: 0.3 → 0.2
Time: 10.3s
Precision: 64
\[\frac{x \cdot 100.0}{x + y}\]
\[\frac{x}{y + x} \cdot 100.0\]
\frac{x \cdot 100.0}{x + y}
\frac{x}{y + x} \cdot 100.0
double f(double x, double y) {
        double r25179079 = x;
        double r25179080 = 100.0;
        double r25179081 = r25179079 * r25179080;
        double r25179082 = y;
        double r25179083 = r25179079 + r25179082;
        double r25179084 = r25179081 / r25179083;
        return r25179084;
}

double f(double x, double y) {
        double r25179085 = x;
        double r25179086 = y;
        double r25179087 = r25179086 + r25179085;
        double r25179088 = r25179085 / r25179087;
        double r25179089 = 100.0;
        double r25179090 = r25179088 * r25179089;
        return r25179090;
}

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

Derivation

  1. Initial program 0.3

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

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

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

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x y)
  :name "Development.Shake.Progress:message from shake-0.15.5"

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

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