Average Error: 6.2 → 0.1
Time: 6.8s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + \frac{y}{z} \cdot y\]
x + \frac{y \cdot y}{z}
x + \frac{y}{z} \cdot y
double f(double x, double y, double z) {
        double r646677 = x;
        double r646678 = y;
        double r646679 = r646678 * r646678;
        double r646680 = z;
        double r646681 = r646679 / r646680;
        double r646682 = r646677 + r646681;
        return r646682;
}

double f(double x, double y, double z) {
        double r646683 = x;
        double r646684 = y;
        double r646685 = z;
        double r646686 = r646684 / r646685;
        double r646687 = r646686 * r646684;
        double r646688 = r646683 + r646687;
        return r646688;
}

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.2
Target0.1
Herbie0.1
\[x + y \cdot \frac{y}{z}\]

Derivation

  1. Initial program 6.2

    \[x + \frac{y \cdot y}{z}\]
  2. Using strategy rm
  3. Applied associate-/l*0.1

    \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{y}}}\]
  4. Using strategy rm
  5. Applied associate-/r/0.1

    \[\leadsto x + \color{blue}{\frac{y}{z} \cdot y}\]
  6. Final simplification0.1

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

Reproduce

herbie shell --seed 2019305 
(FPCore (x y z)
  :name "Crypto.Random.Test:calculate from crypto-random-0.0.9"
  :precision binary64

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

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