Average Error: 6.5 → 0.1
Time: 2.4s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + \frac{y}{\frac{z}{y}}\]
x + \frac{y \cdot y}{z}
x + \frac{y}{\frac{z}{y}}
double f(double x, double y, double z) {
        double r955992 = x;
        double r955993 = y;
        double r955994 = r955993 * r955993;
        double r955995 = z;
        double r955996 = r955994 / r955995;
        double r955997 = r955992 + r955996;
        return r955997;
}

double f(double x, double y, double z) {
        double r955998 = x;
        double r955999 = y;
        double r956000 = z;
        double r956001 = r956000 / r955999;
        double r956002 = r955999 / r956001;
        double r956003 = r955998 + r956002;
        return r956003;
}

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

Derivation

  1. Initial program 6.5

    \[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. Final simplification0.1

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

Reproduce

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