Average Error: 0.0 → 0.0
Time: 4.1s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{2 - \left(x + y\right)}\right)\right) - \frac{y}{2 - \left(x + y\right)}\]
\frac{x - y}{2 - \left(x + y\right)}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{2 - \left(x + y\right)}\right)\right) - \frac{y}{2 - \left(x + y\right)}
double f(double x, double y) {
        double r886851 = x;
        double r886852 = y;
        double r886853 = r886851 - r886852;
        double r886854 = 2.0;
        double r886855 = r886851 + r886852;
        double r886856 = r886854 - r886855;
        double r886857 = r886853 / r886856;
        return r886857;
}

double f(double x, double y) {
        double r886858 = x;
        double r886859 = 2.0;
        double r886860 = y;
        double r886861 = r886858 + r886860;
        double r886862 = r886859 - r886861;
        double r886863 = r886858 / r886862;
        double r886864 = expm1(r886863);
        double r886865 = log1p(r886864);
        double r886866 = r886860 / r886862;
        double r886867 = r886865 - r886866;
        return r886867;
}

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 div-sub0.0

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

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

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

Reproduce

herbie shell --seed 2020060 +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))))