Average Error: 6.2 → 0.1
Time: 2.2s
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 r1163514 = x;
        double r1163515 = y;
        double r1163516 = r1163515 * r1163515;
        double r1163517 = z;
        double r1163518 = r1163516 / r1163517;
        double r1163519 = r1163514 + r1163518;
        return r1163519;
}

double f(double x, double y, double z) {
        double r1163520 = x;
        double r1163521 = y;
        double r1163522 = z;
        double r1163523 = r1163522 / r1163521;
        double r1163524 = r1163521 / r1163523;
        double r1163525 = r1163520 + r1163524;
        return r1163525;
}

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

Derivation

  1. Initial program 6.2

    \[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 2020025 +o rules:numerics
(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)))