Average Error: 6.4 → 0.1
Time: 8.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 r42580203 = x;
        double r42580204 = y;
        double r42580205 = r42580204 * r42580204;
        double r42580206 = z;
        double r42580207 = r42580205 / r42580206;
        double r42580208 = r42580203 + r42580207;
        return r42580208;
}

double f(double x, double y, double z) {
        double r42580209 = x;
        double r42580210 = y;
        double r42580211 = z;
        double r42580212 = r42580210 / r42580211;
        double r42580213 = r42580212 * r42580210;
        double r42580214 = r42580209 + r42580213;
        return r42580214;
}

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

Derivation

  1. Initial program 6.4

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

    \[\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 + \frac{y}{z} \cdot y\]

Reproduce

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

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

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