Average Error: 0.0 → 0.0
Time: 35.7s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\frac{1}{\frac{x - y}{y + x}}\]
\frac{x + y}{x - y}
\frac{1}{\frac{x - y}{y + x}}
double f(double x, double y) {
        double r27129963 = x;
        double r27129964 = y;
        double r27129965 = r27129963 + r27129964;
        double r27129966 = r27129963 - r27129964;
        double r27129967 = r27129965 / r27129966;
        return r27129967;
}

double f(double x, double y) {
        double r27129968 = 1.0;
        double r27129969 = x;
        double r27129970 = y;
        double r27129971 = r27129969 - r27129970;
        double r27129972 = r27129970 + r27129969;
        double r27129973 = r27129971 / r27129972;
        double r27129974 = r27129968 / r27129973;
        return r27129974;
}

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

Reproduce

herbie shell --seed 2019200 
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, A"

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

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