Average Error: 0.4 → 0.2
Time: 7.5s
Precision: 64
\[\frac{x \cdot 100}{x + y}\]
\[\frac{\frac{x}{y + x}}{\frac{1}{100}}\]
\frac{x \cdot 100}{x + y}
\frac{\frac{x}{y + x}}{\frac{1}{100}}
double f(double x, double y) {
        double r459370 = x;
        double r459371 = 100.0;
        double r459372 = r459370 * r459371;
        double r459373 = y;
        double r459374 = r459370 + r459373;
        double r459375 = r459372 / r459374;
        return r459375;
}

double f(double x, double y) {
        double r459376 = x;
        double r459377 = y;
        double r459378 = r459377 + r459376;
        double r459379 = r459376 / r459378;
        double r459380 = 1.0;
        double r459381 = 100.0;
        double r459382 = r459380 / r459381;
        double r459383 = r459379 / r459382;
        return r459383;
}

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. Simplified0.4

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

    \[\leadsto \color{blue}{\frac{x}{\frac{y + x}{100}}}\]
  5. Using strategy rm
  6. Applied div-inv0.2

    \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \frac{1}{100}}}\]
  7. Applied associate-/r*0.2

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

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

Reproduce

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