Average Error: 6.8 → 6.8
Time: 13.7s
Precision: 64
\[\frac{x + y}{1.0 - \frac{y}{z}}\]
\[\frac{y + x}{1.0 - \frac{y}{z}}\]
\frac{x + y}{1.0 - \frac{y}{z}}
\frac{y + x}{1.0 - \frac{y}{z}}
double f(double x, double y, double z) {
        double r25900205 = x;
        double r25900206 = y;
        double r25900207 = r25900205 + r25900206;
        double r25900208 = 1.0;
        double r25900209 = z;
        double r25900210 = r25900206 / r25900209;
        double r25900211 = r25900208 - r25900210;
        double r25900212 = r25900207 / r25900211;
        return r25900212;
}

double f(double x, double y, double z) {
        double r25900213 = y;
        double r25900214 = x;
        double r25900215 = r25900213 + r25900214;
        double r25900216 = 1.0;
        double r25900217 = z;
        double r25900218 = r25900213 / r25900217;
        double r25900219 = r25900216 - r25900218;
        double r25900220 = r25900215 / r25900219;
        return r25900220;
}

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

Original6.8
Target3.9
Herbie6.8
\[\begin{array}{l} \mathbf{if}\;y \lt -3.7429310762689856 \cdot 10^{+171}:\\ \;\;\;\;\frac{y + x}{-y} \cdot z\\ \mathbf{elif}\;y \lt 3.5534662456086734 \cdot 10^{+168}:\\ \;\;\;\;\frac{x + y}{1.0 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{-y} \cdot z\\ \end{array}\]

Derivation

  1. Initial program 6.8

    \[\frac{x + y}{1.0 - \frac{y}{z}}\]
  2. Final simplification6.8

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

Reproduce

herbie shell --seed 2019162 
(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))))