Average Error: 0.4 → 0.2
Time: 7.6s
Precision: 64
\[\frac{x \cdot 100}{x + y}\]
\[100 \cdot \frac{x}{x + y}\]
\frac{x \cdot 100}{x + y}
100 \cdot \frac{x}{x + y}
double f(double x, double y) {
        double r530662 = x;
        double r530663 = 100.0;
        double r530664 = r530662 * r530663;
        double r530665 = y;
        double r530666 = r530662 + r530665;
        double r530667 = r530664 / r530666;
        return r530667;
}

double f(double x, double y) {
        double r530668 = 100.0;
        double r530669 = x;
        double r530670 = y;
        double r530671 = r530669 + r530670;
        double r530672 = r530669 / r530671;
        double r530673 = r530668 * r530672;
        return r530673;
}

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. Using strategy rm
  3. Applied associate-/l*0.2

    \[\leadsto \color{blue}{\frac{x}{\frac{x + y}{100}}}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.2

    \[\leadsto \frac{x}{\frac{x + y}{\color{blue}{\sqrt{100} \cdot \sqrt{100}}}}\]
  6. Applied *-un-lft-identity0.2

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

    \[\leadsto \frac{x}{\color{blue}{\frac{1}{\sqrt{100}} \cdot \frac{x + y}{\sqrt{100}}}}\]
  8. Applied *-un-lft-identity0.4

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

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

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

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

Reproduce

herbie shell --seed 2019297 
(FPCore (x y)
  :name "Development.Shake.Progress:message from shake-0.15.5"
  :precision binary64

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

  (/ (* x 100) (+ x y)))