Average Error: 0.0 → 0.0
Time: 13.6s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{y + x} - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{y + x}\right)\right)\]
\frac{x - y}{x + y}
\frac{x}{y + x} - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{y + x}\right)\right)
double f(double x, double y) {
        double r41449688 = x;
        double r41449689 = y;
        double r41449690 = r41449688 - r41449689;
        double r41449691 = r41449688 + r41449689;
        double r41449692 = r41449690 / r41449691;
        return r41449692;
}

double f(double x, double y) {
        double r41449693 = x;
        double r41449694 = y;
        double r41449695 = r41449694 + r41449693;
        double r41449696 = r41449693 / r41449695;
        double r41449697 = r41449694 / r41449695;
        double r41449698 = log1p(r41449697);
        double r41449699 = expm1(r41449698);
        double r41449700 = r41449696 - r41449699;
        return r41449700;
}

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.0
Target0.0
Herbie0.0
\[\frac{x}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{x + y}\]
  2. Using strategy rm
  3. Applied div-sub0.0

    \[\leadsto \color{blue}{\frac{x}{x + y} - \frac{y}{x + y}}\]
  4. Using strategy rm
  5. Applied expm1-log1p-u0.0

    \[\leadsto \frac{x}{x + y} - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{x + y}\right)\right)}\]
  6. Final simplification0.0

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

Reproduce

herbie shell --seed 2019158 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, D"

  :herbie-target
  (- (/ x (+ x y)) (/ y (+ x y)))

  (/ (- x y) (+ x y)))