Average Error: 6.1 → 0.1
Time: 10.0s
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 r39793637 = x;
        double r39793638 = y;
        double r39793639 = r39793638 * r39793638;
        double r39793640 = z;
        double r39793641 = r39793639 / r39793640;
        double r39793642 = r39793637 + r39793641;
        return r39793642;
}

double f(double x, double y, double z) {
        double r39793643 = x;
        double r39793644 = y;
        double r39793645 = z;
        double r39793646 = r39793645 / r39793644;
        double r39793647 = r39793644 / r39793646;
        double r39793648 = r39793643 + r39793647;
        return r39793648;
}

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

Derivation

  1. Initial program 6.1

    \[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 2019168 
(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)))