Average Error: 0.0 → 0.0
Time: 4.3s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x - y}{2 - \left(x + y\right)}\right)\right)\]
\frac{x - y}{2 - \left(x + y\right)}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x - y}{2 - \left(x + y\right)}\right)\right)
double f(double x, double y) {
        double r870721 = x;
        double r870722 = y;
        double r870723 = r870721 - r870722;
        double r870724 = 2.0;
        double r870725 = r870721 + r870722;
        double r870726 = r870724 - r870725;
        double r870727 = r870723 / r870726;
        return r870727;
}

double f(double x, double y) {
        double r870728 = x;
        double r870729 = y;
        double r870730 = r870728 - r870729;
        double r870731 = 2.0;
        double r870732 = r870728 + r870729;
        double r870733 = r870731 - r870732;
        double r870734 = r870730 / r870733;
        double r870735 = expm1(r870734);
        double r870736 = log1p(r870735);
        return r870736;
}

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}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\]

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{2 - \left(x + y\right)}\]
  2. Using strategy rm
  3. Applied log1p-expm1-u0.0

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

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

Reproduce

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

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

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