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 r33384846 = x;
        double r33384847 = y;
        double r33384848 = r33384846 - r33384847;
        double r33384849 = 2.0;
        double r33384850 = r33384846 + r33384847;
        double r33384851 = r33384849 - r33384850;
        double r33384852 = r33384848 / r33384851;
        return r33384852;
}

double f(double x, double y) {
        double r33384853 = x;
        double r33384854 = 2.0;
        double r33384855 = y;
        double r33384856 = r33384853 + r33384855;
        double r33384857 = r33384854 - r33384856;
        double r33384858 = r33384853 / r33384857;
        double r33384859 = r33384855 / r33384857;
        double r33384860 = expm1(r33384859);
        double r33384861 = log1p(r33384860);
        double r33384862 = r33384858 - r33384861;
        return r33384862;
}

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