Average Error: 6.0 → 0.1
Time: 2.5s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + y \cdot \frac{y}{z}\]
x + \frac{y \cdot y}{z}
x + y \cdot \frac{y}{z}
double f(double x, double y, double z) {
        double r1715901 = x;
        double r1715902 = y;
        double r1715903 = r1715902 * r1715902;
        double r1715904 = z;
        double r1715905 = r1715903 / r1715904;
        double r1715906 = r1715901 + r1715905;
        return r1715906;
}

double f(double x, double y, double z) {
        double r1715907 = x;
        double r1715908 = y;
        double r1715909 = z;
        double r1715910 = r1715908 / r1715909;
        double r1715911 = r1715908 * r1715910;
        double r1715912 = r1715907 + r1715911;
        return r1715912;
}

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

Derivation

  1. Initial program 6.0

    \[x + \frac{y \cdot y}{z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity6.0

    \[\leadsto x + \frac{y \cdot y}{\color{blue}{1 \cdot z}}\]
  4. Applied times-frac0.1

    \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{y}{z}}\]
  5. Simplified0.1

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

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

Reproduce

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