Average Error: 6.2 → 0.1
Time: 9.1s
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 r653935 = x;
        double r653936 = y;
        double r653937 = r653936 * r653936;
        double r653938 = z;
        double r653939 = r653937 / r653938;
        double r653940 = r653935 + r653939;
        return r653940;
}

double f(double x, double y, double z) {
        double r653941 = x;
        double r653942 = y;
        double r653943 = z;
        double r653944 = r653943 / r653942;
        double r653945 = r653942 / r653944;
        double r653946 = r653941 + r653945;
        return r653946;
}

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

Derivation

  1. Initial program 6.2

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