Average Error: 0.0 → 0.0
Time: 30.4s
Precision: 64
\[\frac{x - y}{x + y}\]
\[\frac{1}{\frac{x + y}{x - y}}\]
\frac{x - y}{x + y}
\frac{1}{\frac{x + y}{x - y}}
double f(double x, double y) {
        double r26272205 = x;
        double r26272206 = y;
        double r26272207 = r26272205 - r26272206;
        double r26272208 = r26272205 + r26272206;
        double r26272209 = r26272207 / r26272208;
        return r26272209;
}

double f(double x, double y) {
        double r26272210 = 1.0;
        double r26272211 = x;
        double r26272212 = y;
        double r26272213 = r26272211 + r26272212;
        double r26272214 = r26272211 - r26272212;
        double r26272215 = r26272213 / r26272214;
        double r26272216 = r26272210 / r26272215;
        return r26272216;
}

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 clear-num0.0

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

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

Reproduce

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

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

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