Average Error: 5.9 → 0.1
Time: 7.7s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + \frac{y}{\frac{z}{y}}\]
x + \frac{y \cdot y}{z}
x + \frac{y}{\frac{z}{y}}
double f(double x, double y, double z) {
        double r1008774 = x;
        double r1008775 = y;
        double r1008776 = r1008775 * r1008775;
        double r1008777 = z;
        double r1008778 = r1008776 / r1008777;
        double r1008779 = r1008774 + r1008778;
        return r1008779;
}

double f(double x, double y, double z) {
        double r1008780 = x;
        double r1008781 = y;
        double r1008782 = z;
        double r1008783 = r1008782 / r1008781;
        double r1008784 = r1008781 / r1008783;
        double r1008785 = r1008780 + r1008784;
        return r1008785;
}

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 associate-/l*0.1

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

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

Reproduce

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