Average Error: 6.4 → 0.1
Time: 2.1s
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 r847045 = x;
        double r847046 = y;
        double r847047 = r847046 * r847046;
        double r847048 = z;
        double r847049 = r847047 / r847048;
        double r847050 = r847045 + r847049;
        return r847050;
}

double f(double x, double y, double z) {
        double r847051 = x;
        double r847052 = y;
        double r847053 = z;
        double r847054 = r847052 / r847053;
        double r847055 = r847054 * r847052;
        double r847056 = r847051 + r847055;
        return r847056;
}

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