Average Error: 6.4 → 0.1
Time: 7.9s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + \frac{y}{z} \cdot y\]
x + \frac{y \cdot y}{z}
x + \frac{y}{z} \cdot y
double f(double x, double y, double z) {
        double r44018140 = x;
        double r44018141 = y;
        double r44018142 = r44018141 * r44018141;
        double r44018143 = z;
        double r44018144 = r44018142 / r44018143;
        double r44018145 = r44018140 + r44018144;
        return r44018145;
}

double f(double x, double y, double z) {
        double r44018146 = x;
        double r44018147 = y;
        double r44018148 = z;
        double r44018149 = r44018147 / r44018148;
        double r44018150 = r44018149 * r44018147;
        double r44018151 = r44018146 + r44018150;
        return r44018151;
}

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. Using strategy rm
  5. Applied associate-/r/0.1

    \[\leadsto x + \color{blue}{\frac{y}{z} \cdot y}\]
  6. Final simplification0.1

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

Reproduce

herbie shell --seed 2019179 
(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)))