Average Error: 0.0 → 0.0
Time: 3.8s
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 r888583 = x;
        double r888584 = y;
        double r888585 = r888583 - r888584;
        double r888586 = 2.0;
        double r888587 = r888583 + r888584;
        double r888588 = r888586 - r888587;
        double r888589 = r888585 / r888588;
        return r888589;
}

double f(double x, double y) {
        double r888590 = x;
        double r888591 = y;
        double r888592 = r888590 - r888591;
        double r888593 = 2.0;
        double r888594 = r888590 + r888591;
        double r888595 = r888593 - r888594;
        double r888596 = r888592 / r888595;
        double r888597 = expm1(r888596);
        double r888598 = log1p(r888597);
        return r888598;
}

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))))