Average Error: 13.1 → 2.9
Time: 8.4s
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 r600328 = x;
        double r600329 = y;
        double r600330 = z;
        double r600331 = r600329 + r600330;
        double r600332 = r600328 * r600331;
        double r600333 = r600332 / r600330;
        return r600333;
}

double f(double x, double y, double z) {
        double r600334 = x;
        double r600335 = z;
        double r600336 = y;
        double r600337 = r600336 + r600335;
        double r600338 = r600335 / r600337;
        double r600339 = r600334 / r600338;
        return r600339;
}

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

Original13.1
Target2.9
Herbie2.9
\[\frac{x}{\frac{z}{y + z}}\]

Derivation

  1. Initial program 13.1

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

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

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

Reproduce

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