Average Error: 0.0 → 0.0
Time: 3.7s
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 r828014 = x;
        double r828015 = y;
        double r828016 = r828014 - r828015;
        double r828017 = 2.0;
        double r828018 = r828014 + r828015;
        double r828019 = r828017 - r828018;
        double r828020 = r828016 / r828019;
        return r828020;
}

double f(double x, double y) {
        double r828021 = x;
        double r828022 = y;
        double r828023 = r828021 - r828022;
        double r828024 = 2.0;
        double r828025 = r828021 + r828022;
        double r828026 = r828024 - r828025;
        double r828027 = r828023 / r828026;
        double r828028 = expm1(r828027);
        double r828029 = log1p(r828028);
        return r828029;
}

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