Average Error: 6.0 → 0.1
Time: 15.8s
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 r663792 = x;
        double r663793 = y;
        double r663794 = r663793 * r663793;
        double r663795 = z;
        double r663796 = r663794 / r663795;
        double r663797 = r663792 + r663796;
        return r663797;
}

double f(double x, double y, double z) {
        double r663798 = x;
        double r663799 = y;
        double r663800 = z;
        double r663801 = r663799 / r663800;
        double r663802 = r663799 * r663801;
        double r663803 = r663798 + r663802;
        return r663803;
}

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

Derivation

  1. Initial program 6.0

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

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