Average Error: 0.0 → 0.0
Time: 16.7s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x - y}{2 - \left(y + x\right)}\right)\right)\]
\frac{x - y}{2 - \left(x + y\right)}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x - y}{2 - \left(y + x\right)}\right)\right)
double f(double x, double y) {
        double r35390539 = x;
        double r35390540 = y;
        double r35390541 = r35390539 - r35390540;
        double r35390542 = 2.0;
        double r35390543 = r35390539 + r35390540;
        double r35390544 = r35390542 - r35390543;
        double r35390545 = r35390541 / r35390544;
        return r35390545;
}

double f(double x, double y) {
        double r35390546 = x;
        double r35390547 = y;
        double r35390548 = r35390546 - r35390547;
        double r35390549 = 2.0;
        double r35390550 = r35390547 + r35390546;
        double r35390551 = r35390549 - r35390550;
        double r35390552 = r35390548 / r35390551;
        double r35390553 = expm1(r35390552);
        double r35390554 = log1p(r35390553);
        return r35390554;
}

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

Reproduce

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

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

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