Average Error: 6.0 → 0.1
Time: 3.1s
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 r1016210 = x;
        double r1016211 = y;
        double r1016212 = r1016211 * r1016211;
        double r1016213 = z;
        double r1016214 = r1016212 / r1016213;
        double r1016215 = r1016210 + r1016214;
        return r1016215;
}

double f(double x, double y, double z) {
        double r1016216 = x;
        double r1016217 = y;
        double r1016218 = z;
        double r1016219 = r1016218 / r1016217;
        double r1016220 = r1016217 / r1016219;
        double r1016221 = r1016216 + r1016220;
        return r1016221;
}

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. Final simplification0.1

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

Reproduce

herbie shell --seed 2020056 +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)))