Average Error: 6.4 → 0.1
Time: 15.9s
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 r924791 = x;
        double r924792 = y;
        double r924793 = r924792 * r924792;
        double r924794 = z;
        double r924795 = r924793 / r924794;
        double r924796 = r924791 + r924795;
        return r924796;
}

double f(double x, double y, double z) {
        double r924797 = x;
        double r924798 = y;
        double r924799 = z;
        double r924800 = r924799 / r924798;
        double r924801 = r924798 / r924800;
        double r924802 = r924797 + r924801;
        return r924802;
}

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. Final simplification0.1

    \[\leadsto x + \frac{y}{\frac{z}{y}}\]

Reproduce

herbie shell --seed 2019196 +o rules:numerics
(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)))