Average Error: 12.8 → 3.3
Time: 9.1s
Precision: 64
\[\frac{x \cdot \left(y + z\right)}{z}\]
\[\frac{x}{\frac{z}{y + z}}\]
\frac{x \cdot \left(y + z\right)}{z}
\frac{x}{\frac{z}{y + z}}
double f(double x, double y, double z) {
        double r291477 = x;
        double r291478 = y;
        double r291479 = z;
        double r291480 = r291478 + r291479;
        double r291481 = r291477 * r291480;
        double r291482 = r291481 / r291479;
        return r291482;
}

double f(double x, double y, double z) {
        double r291483 = x;
        double r291484 = z;
        double r291485 = y;
        double r291486 = r291485 + r291484;
        double r291487 = r291484 / r291486;
        double r291488 = r291483 / r291487;
        return r291488;
}

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

Original12.8
Target3.3
Herbie3.3
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Initial program 12.8

    \[\frac{x \cdot \left(y + z\right)}{z}\]
  2. Using strategy rm
  3. Applied associate-/l*3.3

    \[\leadsto \color{blue}{\frac{x}{\frac{z}{y + z}}}\]
  4. Final simplification3.3

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

Reproduce

herbie shell --seed 2019297 
(FPCore (x y z)
  :name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
  :precision binary64

  :herbie-target
  (/ x (/ z (+ y z)))

  (/ (* x (+ y z)) z))