Average Error: 0.5 → 0.2
Time: 9.0s
Precision: 64
\[\frac{x \cdot 100}{x + y}\]
\[\frac{100}{x + y} \cdot x\]
\frac{x \cdot 100}{x + y}
\frac{100}{x + y} \cdot x
double f(double x, double y) {
        double r29195609 = x;
        double r29195610 = 100.0;
        double r29195611 = r29195609 * r29195610;
        double r29195612 = y;
        double r29195613 = r29195609 + r29195612;
        double r29195614 = r29195611 / r29195613;
        return r29195614;
}

double f(double x, double y) {
        double r29195615 = 100.0;
        double r29195616 = x;
        double r29195617 = y;
        double r29195618 = r29195616 + r29195617;
        double r29195619 = r29195615 / r29195618;
        double r29195620 = r29195619 * r29195616;
        return r29195620;
}

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

Derivation

  1. Initial program 0.5

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

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

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

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

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

Reproduce

herbie shell --seed 2019172 +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)))