Average Error: 6.0 → 0.1
Time: 3.5s
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 r786965 = x;
        double r786966 = y;
        double r786967 = r786966 * r786966;
        double r786968 = z;
        double r786969 = r786967 / r786968;
        double r786970 = r786965 + r786969;
        return r786970;
}

double f(double x, double y, double z) {
        double r786971 = x;
        double r786972 = y;
        double r786973 = z;
        double r786974 = r786973 / r786972;
        double r786975 = r786972 / r786974;
        double r786976 = r786971 + r786975;
        return r786976;
}

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

Derivation

  1. Initial program 6.0

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