Average Error: 6.4 → 0.1
Time: 6.2s
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 r643453 = x;
        double r643454 = y;
        double r643455 = r643454 * r643454;
        double r643456 = z;
        double r643457 = r643455 / r643456;
        double r643458 = r643453 + r643457;
        return r643458;
}

double f(double x, double y, double z) {
        double r643459 = x;
        double r643460 = y;
        double r643461 = z;
        double r643462 = r643460 / r643461;
        double r643463 = r643462 * r643460;
        double r643464 = r643459 + r643463;
        return r643464;
}

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