Average Error: 7.3 → 7.3
Time: 15.4s
Precision: 64
\[\frac{x + y}{1 - \frac{y}{z}}\]
\[\frac{y + x}{1 - \frac{y}{z}}\]
\frac{x + y}{1 - \frac{y}{z}}
\frac{y + x}{1 - \frac{y}{z}}
double f(double x, double y, double z) {
        double r28367429 = x;
        double r28367430 = y;
        double r28367431 = r28367429 + r28367430;
        double r28367432 = 1.0;
        double r28367433 = z;
        double r28367434 = r28367430 / r28367433;
        double r28367435 = r28367432 - r28367434;
        double r28367436 = r28367431 / r28367435;
        return r28367436;
}

double f(double x, double y, double z) {
        double r28367437 = y;
        double r28367438 = x;
        double r28367439 = r28367437 + r28367438;
        double r28367440 = 1.0;
        double r28367441 = z;
        double r28367442 = r28367437 / r28367441;
        double r28367443 = r28367440 - r28367442;
        double r28367444 = r28367439 / r28367443;
        return r28367444;
}

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.3
Target3.9
Herbie7.3
\[\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.3

    \[\frac{x + y}{1 - \frac{y}{z}}\]
  2. Final simplification7.3

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

Reproduce

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

  :herbie-target
  (if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))

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