Average Error: 13.1 → 2.9
Time: 1.8s
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 r551044 = x;
        double r551045 = y;
        double r551046 = z;
        double r551047 = r551045 + r551046;
        double r551048 = r551044 * r551047;
        double r551049 = r551048 / r551046;
        return r551049;
}

double f(double x, double y, double z) {
        double r551050 = x;
        double r551051 = z;
        double r551052 = y;
        double r551053 = r551052 + r551051;
        double r551054 = r551051 / r551053;
        double r551055 = r551050 / r551054;
        return r551055;
}

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