Average Error: 6.8 → 6.8
Time: 14.5s
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 r32339058 = x;
        double r32339059 = y;
        double r32339060 = r32339058 + r32339059;
        double r32339061 = 1.0;
        double r32339062 = z;
        double r32339063 = r32339059 / r32339062;
        double r32339064 = r32339061 - r32339063;
        double r32339065 = r32339060 / r32339064;
        return r32339065;
}

double f(double x, double y, double z) {
        double r32339066 = y;
        double r32339067 = x;
        double r32339068 = r32339066 + r32339067;
        double r32339069 = 1.0;
        double r32339070 = z;
        double r32339071 = r32339066 / r32339070;
        double r32339072 = r32339069 - r32339071;
        double r32339073 = r32339068 / r32339072;
        return r32339073;
}

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))))