Average Error: 7.5 → 7.5
Time: 14.3s
Precision: 64
\[\frac{x + y}{1 - \frac{y}{z}}\]
\[\left(x + y\right) \cdot \frac{1}{1 - \frac{y}{z}}\]
\frac{x + y}{1 - \frac{y}{z}}
\left(x + y\right) \cdot \frac{1}{1 - \frac{y}{z}}
double f(double x, double y, double z) {
        double r690434 = x;
        double r690435 = y;
        double r690436 = r690434 + r690435;
        double r690437 = 1.0;
        double r690438 = z;
        double r690439 = r690435 / r690438;
        double r690440 = r690437 - r690439;
        double r690441 = r690436 / r690440;
        return r690441;
}

double f(double x, double y, double z) {
        double r690442 = x;
        double r690443 = y;
        double r690444 = r690442 + r690443;
        double r690445 = 1.0;
        double r690446 = 1.0;
        double r690447 = z;
        double r690448 = r690443 / r690447;
        double r690449 = r690446 - r690448;
        double r690450 = r690445 / r690449;
        double r690451 = r690444 * r690450;
        return r690451;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original7.5
Target3.9
Herbie7.5
\[\begin{array}{l} \mathbf{if}\;y \lt -3.742931076268985646434612946949172132145 \cdot 10^{171}:\\ \;\;\;\;\frac{y + x}{-y} \cdot z\\ \mathbf{elif}\;y \lt 3.553466245608673435460441960303815115662 \cdot 10^{168}:\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{-y} \cdot z\\ \end{array}\]

Derivation

  1. Initial program 7.5

    \[\frac{x + y}{1 - \frac{y}{z}}\]
  2. Using strategy rm
  3. Applied div-inv7.5

    \[\leadsto \color{blue}{\left(x + y\right) \cdot \frac{1}{1 - \frac{y}{z}}}\]
  4. Final simplification7.5

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

Reproduce

herbie shell --seed 2019209 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
  :precision binary64

  :herbie-target
  (if (< y -3.74293107626898565e171) (* (/ (+ y x) (- y)) z) (if (< y 3.55346624560867344e168) (/ (+ x y) (- 1 (/ y z))) (* (/ (+ y x) (- y)) z)))

  (/ (+ x y) (- 1 (/ y z))))