Average Error: 5.9 → 0.1
Time: 2.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 r950920 = x;
        double r950921 = y;
        double r950922 = r950921 * r950921;
        double r950923 = z;
        double r950924 = r950922 / r950923;
        double r950925 = r950920 + r950924;
        return r950925;
}

double f(double x, double y, double z) {
        double r950926 = x;
        double r950927 = y;
        double r950928 = z;
        double r950929 = r950928 / r950927;
        double r950930 = r950927 / r950929;
        double r950931 = r950926 + r950930;
        return r950931;
}

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

Original5.9
Target0.1
Herbie0.1
\[x + y \cdot \frac{y}{z}\]

Derivation

  1. Initial program 5.9

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