Average Error: 0.0 → 0.0
Time: 19.8s
Precision: 64
\[\frac{x - y}{2.0 - \left(x + y\right)}\]
\[\frac{x}{2.0 - \left(x + y\right)} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{2.0 - \left(x + y\right)}\right)\right)\]
\frac{x - y}{2.0 - \left(x + y\right)}
\frac{x}{2.0 - \left(x + y\right)} - \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{y}{2.0 - \left(x + y\right)}\right)\right)
double f(double x, double y) {
        double r37947194 = x;
        double r37947195 = y;
        double r37947196 = r37947194 - r37947195;
        double r37947197 = 2.0;
        double r37947198 = r37947194 + r37947195;
        double r37947199 = r37947197 - r37947198;
        double r37947200 = r37947196 / r37947199;
        return r37947200;
}

double f(double x, double y) {
        double r37947201 = x;
        double r37947202 = 2.0;
        double r37947203 = y;
        double r37947204 = r37947201 + r37947203;
        double r37947205 = r37947202 - r37947204;
        double r37947206 = r37947201 / r37947205;
        double r37947207 = r37947203 / r37947205;
        double r37947208 = expm1(r37947207);
        double r37947209 = log1p(r37947208);
        double r37947210 = r37947206 - r37947209;
        return r37947210;
}

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

Derivation

  1. Initial program 0.0

    \[\frac{x - y}{2.0 - \left(x + y\right)}\]
  2. Using strategy rm
  3. Applied div-sub0.0

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

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

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

Reproduce

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