Average Error: 0.5 → 0.2
Time: 2.5s
Precision: 64
\[\frac{x \cdot 100}{x + y}\]
\[\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right)}{\frac{1}{100}}\]
\frac{x \cdot 100}{x + y}
\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right)}{\frac{1}{100}}
double f(double x, double y) {
        double r738936 = x;
        double r738937 = 100.0;
        double r738938 = r738936 * r738937;
        double r738939 = y;
        double r738940 = r738936 + r738939;
        double r738941 = r738938 / r738940;
        return r738941;
}

double f(double x, double y) {
        double r738942 = x;
        double r738943 = y;
        double r738944 = r738942 + r738943;
        double r738945 = r738942 / r738944;
        double r738946 = expm1(r738945);
        double r738947 = log1p(r738946);
        double r738948 = 1.0;
        double r738949 = 100.0;
        double r738950 = r738948 / r738949;
        double r738951 = r738947 / r738950;
        return r738951;
}

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 associate-/l*0.2

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{1}{100}}}\]
  7. Using strategy rm
  8. Applied log1p-expm1-u0.2

    \[\leadsto \frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right)}}{\frac{1}{100}}\]
  9. Final simplification0.2

    \[\leadsto \frac{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{x + y}\right)\right)}{\frac{1}{100}}\]

Reproduce

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