Average Error: 0.0 → 0.0
Time: 4.8s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{x}{x + y} - \frac{1}{\frac{x + y}{y}}\]
\frac{x - y}{x + y}
\frac{x}{x + y} - \frac{1}{\frac{x + y}{y}}
double f(double x, double y) {
        double r1007855 = x;
        double r1007856 = y;
        double r1007857 = r1007855 - r1007856;
        double r1007858 = r1007855 + r1007856;
        double r1007859 = r1007857 / r1007858;
        return r1007859;
}

double f(double x, double y) {
        double r1007860 = x;
        double r1007861 = y;
        double r1007862 = r1007860 + r1007861;
        double r1007863 = r1007860 / r1007862;
        double r1007864 = 1.0;
        double r1007865 = r1007862 / r1007861;
        double r1007866 = r1007864 / r1007865;
        double r1007867 = r1007863 - r1007866;
        return r1007867;
}

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}{x + y} - \frac{y}{x + y}\]

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{\frac{x}{x + y} - \frac{y}{x + y}}\]
  4. Using strategy rm
  5. Applied clear-num0.0

    \[\leadsto \frac{x}{x + y} - \color{blue}{\frac{1}{\frac{x + y}{y}}}\]
  6. Final simplification0.0

    \[\leadsto \frac{x}{x + y} - \frac{1}{\frac{x + y}{y}}\]

Reproduce

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

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

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