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 r792084 = x;
        double r792085 = y;
        double r792086 = r792084 - r792085;
        double r792087 = 2.0;
        double r792088 = r792084 + r792085;
        double r792089 = r792087 - r792088;
        double r792090 = r792086 / r792089;
        return r792090;
}

double f(double x, double y) {
        double r792091 = x;
        double r792092 = y;
        double r792093 = r792091 - r792092;
        double r792094 = 2.0;
        double r792095 = r792091 + r792092;
        double r792096 = r792094 - r792095;
        double r792097 = r792093 / r792096;
        double r792098 = expm1(r792097);
        double r792099 = log1p(r792098);
        return r792099;
}

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