Average Error: 5.9 → 0.1
Time: 9.0s
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 r656796 = x;
        double r656797 = y;
        double r656798 = r656797 * r656797;
        double r656799 = z;
        double r656800 = r656798 / r656799;
        double r656801 = r656796 + r656800;
        return r656801;
}

double f(double x, double y, double z) {
        double r656802 = x;
        double r656803 = y;
        double r656804 = z;
        double r656805 = r656803 / r656804;
        double r656806 = r656805 * r656803;
        double r656807 = r656802 + r656806;
        return r656807;
}

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

Derivation

  1. Initial program 5.9

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

    \[\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 2019194 
(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)))