Average Error: 0.3 → 0.2
Time: 7.5s
Precision: 64
\[\frac{x \cdot 100}{x + y}\]
\[\frac{x}{x + y} \cdot 100\]
\frac{x \cdot 100}{x + y}
\frac{x}{x + y} \cdot 100
double f(double x, double y) {
        double r558414 = x;
        double r558415 = 100.0;
        double r558416 = r558414 * r558415;
        double r558417 = y;
        double r558418 = r558414 + r558417;
        double r558419 = r558416 / r558418;
        return r558419;
}

double f(double x, double y) {
        double r558420 = x;
        double r558421 = y;
        double r558422 = r558420 + r558421;
        double r558423 = r558420 / r558422;
        double r558424 = 100.0;
        double r558425 = r558423 * r558424;
        return r558425;
}

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}{x + y}\]

Derivation

  1. Initial program 0.3

    \[\frac{x \cdot 100}{x + y}\]
  2. Using strategy rm
  3. Applied clear-num0.7

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

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

    \[\leadsto \frac{1}{\color{blue}{\frac{y + x}{x} \cdot \frac{1}{100}}}\]
  7. Applied add-sqr-sqrt0.5

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{\frac{y + x}{x} \cdot \frac{1}{100}}\]
  8. Applied times-frac0.5

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

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

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

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

Reproduce

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