Average Error: 0.0 → 0.0
Time: 2.4s
Precision: 64
\[\frac{x + y}{x - y}\]
\[\sqrt[3]{{\left(\frac{x}{x - y}\right)}^{3}} + \frac{y}{x - y}\]
\frac{x + y}{x - y}
\sqrt[3]{{\left(\frac{x}{x - y}\right)}^{3}} + \frac{y}{x - y}
double f(double x, double y) {
        double r547040 = x;
        double r547041 = y;
        double r547042 = r547040 + r547041;
        double r547043 = r547040 - r547041;
        double r547044 = r547042 / r547043;
        return r547044;
}

double f(double x, double y) {
        double r547045 = x;
        double r547046 = y;
        double r547047 = r547045 - r547046;
        double r547048 = r547045 / r547047;
        double r547049 = 3.0;
        double r547050 = pow(r547048, r547049);
        double r547051 = cbrt(r547050);
        double r547052 = r547046 / r547047;
        double r547053 = r547051 + r547052;
        return r547053;
}

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 flip--31.2

    \[\leadsto \frac{x + y}{\color{blue}{\frac{x \cdot x - y \cdot y}{x + y}}}\]
  4. Applied associate-/r/31.3

    \[\leadsto \color{blue}{\frac{x + y}{x \cdot x - y \cdot y} \cdot \left(x + y\right)}\]
  5. Simplified0.2

    \[\leadsto \color{blue}{\frac{1}{x - y}} \cdot \left(x + y\right)\]
  6. Using strategy rm
  7. Applied distribute-lft-in0.2

    \[\leadsto \color{blue}{\frac{1}{x - y} \cdot x + \frac{1}{x - y} \cdot y}\]
  8. Simplified0.1

    \[\leadsto \color{blue}{\frac{x}{x - y}} + \frac{1}{x - y} \cdot y\]
  9. Simplified0.0

    \[\leadsto \frac{x}{x - y} + \color{blue}{\frac{y}{x - y}}\]
  10. Using strategy rm
  11. Applied add-cbrt-cube23.9

    \[\leadsto \frac{x}{\color{blue}{\sqrt[3]{\left(\left(x - y\right) \cdot \left(x - y\right)\right) \cdot \left(x - y\right)}}} + \frac{y}{x - y}\]
  12. Applied add-cbrt-cube27.9

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(x \cdot x\right) \cdot x}}}{\sqrt[3]{\left(\left(x - y\right) \cdot \left(x - y\right)\right) \cdot \left(x - y\right)}} + \frac{y}{x - y}\]
  13. Applied cbrt-undiv27.9

    \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(x \cdot x\right) \cdot x}{\left(\left(x - y\right) \cdot \left(x - y\right)\right) \cdot \left(x - y\right)}}} + \frac{y}{x - y}\]
  14. Simplified0.0

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{x}{x - y}\right)}^{3}}} + \frac{y}{x - y}\]
  15. Final simplification0.0

    \[\leadsto \sqrt[3]{{\left(\frac{x}{x - y}\right)}^{3}} + \frac{y}{x - y}\]

Reproduce

herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y)
  :name "Linear.Projection:perspective from linear-1.19.1.3, A"
  :precision binary64

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

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