Average Error: 5.7 → 0.1
Time: 8.2s
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 r18255847 = x;
        double r18255848 = y;
        double r18255849 = r18255848 * r18255848;
        double r18255850 = z;
        double r18255851 = r18255849 / r18255850;
        double r18255852 = r18255847 + r18255851;
        return r18255852;
}

double f(double x, double y, double z) {
        double r18255853 = x;
        double r18255854 = y;
        double r18255855 = z;
        double r18255856 = r18255854 / r18255855;
        double r18255857 = r18255856 * r18255854;
        double r18255858 = r18255853 + r18255857;
        return r18255858;
}

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

Original5.7
Target0.1
Herbie0.1
\[x + y \cdot \frac{y}{z}\]

Derivation

  1. Initial program 5.7

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

    \[\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 + \frac{y}{z} \cdot y\]

Reproduce

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