Average Error: 6.2 → 0.1
Time: 10.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 r41000417 = x;
        double r41000418 = y;
        double r41000419 = r41000418 * r41000418;
        double r41000420 = z;
        double r41000421 = r41000419 / r41000420;
        double r41000422 = r41000417 + r41000421;
        return r41000422;
}

double f(double x, double y, double z) {
        double r41000423 = x;
        double r41000424 = y;
        double r41000425 = z;
        double r41000426 = r41000425 / r41000424;
        double r41000427 = r41000424 / r41000426;
        double r41000428 = r41000423 + r41000427;
        return r41000428;
}

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 2019170 
(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)))