Average Error: 7.3 → 0.0
Time: 11.0s
Precision: 64
\[\frac{x \cdot y}{y + 1.0}\]
\[\frac{y - 1.0}{y + 1.0} \cdot \left(\frac{y}{y - 1.0} \cdot x\right)\]
\frac{x \cdot y}{y + 1.0}
\frac{y - 1.0}{y + 1.0} \cdot \left(\frac{y}{y - 1.0} \cdot x\right)
double f(double x, double y) {
        double r36237589 = x;
        double r36237590 = y;
        double r36237591 = r36237589 * r36237590;
        double r36237592 = 1.0;
        double r36237593 = r36237590 + r36237592;
        double r36237594 = r36237591 / r36237593;
        return r36237594;
}

double f(double x, double y) {
        double r36237595 = y;
        double r36237596 = 1.0;
        double r36237597 = r36237595 - r36237596;
        double r36237598 = r36237595 + r36237596;
        double r36237599 = r36237597 / r36237598;
        double r36237600 = r36237595 / r36237597;
        double r36237601 = x;
        double r36237602 = r36237600 * r36237601;
        double r36237603 = r36237599 * r36237602;
        return r36237603;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.3
Target0.0
Herbie0.0
\[\begin{array}{l} \mathbf{if}\;y \lt -3693.8482788297247:\\ \;\;\;\;\frac{x}{y \cdot y} - \left(\frac{x}{y} - x\right)\\ \mathbf{elif}\;y \lt 6799310503.41891:\\ \;\;\;\;\frac{x \cdot y}{y + 1.0}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y} - \left(\frac{x}{y} - x\right)\\ \end{array}\]

Derivation

  1. Initial program 7.3

    \[\frac{x \cdot y}{y + 1.0}\]
  2. Using strategy rm
  3. Applied flip-+17.1

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

    \[\leadsto \color{blue}{\frac{x \cdot y}{y \cdot y - 1.0 \cdot 1.0} \cdot \left(y - 1.0\right)}\]
  5. Simplified7.3

    \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{y - 1.0}}{1.0 + y}} \cdot \left(y - 1.0\right)\]
  6. Using strategy rm
  7. Applied div-inv7.3

    \[\leadsto \color{blue}{\left(\left(x \cdot \frac{y}{y - 1.0}\right) \cdot \frac{1}{1.0 + y}\right)} \cdot \left(y - 1.0\right)\]
  8. Applied associate-*l*0.1

    \[\leadsto \color{blue}{\left(x \cdot \frac{y}{y - 1.0}\right) \cdot \left(\frac{1}{1.0 + y} \cdot \left(y - 1.0\right)\right)}\]
  9. Simplified0.0

    \[\leadsto \left(x \cdot \frac{y}{y - 1.0}\right) \cdot \color{blue}{\frac{y - 1.0}{y + 1.0}}\]
  10. Final simplification0.0

    \[\leadsto \frac{y - 1.0}{y + 1.0} \cdot \left(\frac{y}{y - 1.0} \cdot x\right)\]

Reproduce

herbie shell --seed 2019168 
(FPCore (x y)
  :name "Diagrams.Trail:splitAtParam  from diagrams-lib-1.3.0.3, B"

  :herbie-target
  (if (< y -3693.8482788297247) (- (/ x (* y y)) (- (/ x y) x)) (if (< y 6799310503.41891) (/ (* x y) (+ y 1.0)) (- (/ x (* y y)) (- (/ x y) x))))

  (/ (* x y) (+ y 1.0)))