Average Error: 6.0 → 0.1
Time: 16.1s
Precision: 64
\[x + \frac{y \cdot y}{z}\]
\[x + \frac{\frac{y}{z}}{\frac{1}{y}}\]
x + \frac{y \cdot y}{z}
x + \frac{\frac{y}{z}}{\frac{1}{y}}
double f(double x, double y, double z) {
        double r613438 = x;
        double r613439 = y;
        double r613440 = r613439 * r613439;
        double r613441 = z;
        double r613442 = r613440 / r613441;
        double r613443 = r613438 + r613442;
        return r613443;
}

double f(double x, double y, double z) {
        double r613444 = x;
        double r613445 = y;
        double r613446 = z;
        double r613447 = r613445 / r613446;
        double r613448 = 1.0;
        double r613449 = r613448 / r613445;
        double r613450 = r613447 / r613449;
        double r613451 = r613444 + r613450;
        return r613451;
}

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

    \[\leadsto x + \color{blue}{\frac{y}{\frac{z}{y}}}\]
  4. Using strategy rm
  5. Applied div-inv0.1

    \[\leadsto x + \frac{y}{\color{blue}{z \cdot \frac{1}{y}}}\]
  6. Applied associate-/r*0.1

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

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

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)))