Average Error: 0.0 → 0.0
Time: 23.2s
Precision: 64
\[\frac{x - y}{2 - \left(x + y\right)}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\right)\right)\]
\frac{x - y}{2 - \left(x + y\right)}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{x}{2 - \left(x + y\right)} - \frac{y}{2 - \left(x + y\right)}\right)\right)
double f(double x, double y) {
        double r597255 = x;
        double r597256 = y;
        double r597257 = r597255 - r597256;
        double r597258 = 2.0;
        double r597259 = r597255 + r597256;
        double r597260 = r597258 - r597259;
        double r597261 = r597257 / r597260;
        return r597261;
}

double f(double x, double y) {
        double r597262 = x;
        double r597263 = 2.0;
        double r597264 = y;
        double r597265 = r597262 + r597264;
        double r597266 = r597263 - r597265;
        double r597267 = r597262 / r597266;
        double r597268 = r597264 / r597266;
        double r597269 = r597267 - r597268;
        double r597270 = expm1(r597269);
        double r597271 = log1p(r597270);
        return r597271;
}

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)} - \frac{y}{2 - \left(x + y\right)}\right)\right)}\]
  6. Final simplification0.0

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

Reproduce

herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y)
  :name "Data.Colour.RGB:hslsv from colour-2.3.3, C"

  :herbie-target
  (- (/ x (- 2.0 (+ x y))) (/ y (- 2.0 (+ x y))))

  (/ (- x y) (- 2.0 (+ x y))))