Average Error: 0.0 → 0.0
Time: 4.0s
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 r892096 = x;
        double r892097 = y;
        double r892098 = r892096 - r892097;
        double r892099 = 2.0;
        double r892100 = r892096 + r892097;
        double r892101 = r892099 - r892100;
        double r892102 = r892098 / r892101;
        return r892102;
}

double f(double x, double y) {
        double r892103 = x;
        double r892104 = y;
        double r892105 = r892103 - r892104;
        double r892106 = 2.0;
        double r892107 = r892103 + r892104;
        double r892108 = r892106 - r892107;
        double r892109 = r892105 / r892108;
        double r892110 = expm1(r892109);
        double r892111 = log1p(r892110);
        return r892111;
}

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