Average Error: 0.4 → 0.2
Time: 36.1s
Precision: 64
\[\frac{x \cdot 100.0}{x + y}\]
\[\frac{100.0}{x + y} \cdot x\]
\frac{x \cdot 100.0}{x + y}
\frac{100.0}{x + y} \cdot x
double f(double x, double y) {
        double r35821111 = x;
        double r35821112 = 100.0;
        double r35821113 = r35821111 * r35821112;
        double r35821114 = y;
        double r35821115 = r35821111 + r35821114;
        double r35821116 = r35821113 / r35821115;
        return r35821116;
}

double f(double x, double y) {
        double r35821117 = 100.0;
        double r35821118 = x;
        double r35821119 = y;
        double r35821120 = r35821118 + r35821119;
        double r35821121 = r35821117 / r35821120;
        double r35821122 = r35821121 * r35821118;
        return r35821122;
}

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.0} \cdot \frac{100.0}{x + y}\]

Derivation

  1. Initial program 0.4

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

    \[\leadsto \frac{x \cdot 100.0}{\color{blue}{1 \cdot \left(x + y\right)}}\]
  4. Applied times-frac0.2

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

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

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

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(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)))