Average Error: 6.3 → 0.1
Time: 6.6s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + y \cdot \frac{y}{z}\]
x + \frac{y \cdot y}{z}
x + y \cdot \frac{y}{z}
double f(double x, double y, double z) {
        double r832338 = x;
        double r832339 = y;
        double r832340 = r832339 * r832339;
        double r832341 = z;
        double r832342 = r832340 / r832341;
        double r832343 = r832338 + r832342;
        return r832343;
}

double f(double x, double y, double z) {
        double r832344 = x;
        double r832345 = y;
        double r832346 = z;
        double r832347 = r832345 / r832346;
        double r832348 = r832345 * r832347;
        double r832349 = r832344 + r832348;
        return r832349;
}

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

Derivation

  1. Initial program 6.3

    \[x + \frac{y \cdot y}{z}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity6.3

    \[\leadsto x + \frac{y \cdot y}{\color{blue}{1 \cdot z}}\]
  4. Applied times-frac0.1

    \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{y}{z}}\]
  5. Simplified0.1

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

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

Reproduce

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