Average Error: 6.5 → 0.1
Time: 2.1s
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 r986202 = x;
        double r986203 = y;
        double r986204 = r986203 * r986203;
        double r986205 = z;
        double r986206 = r986204 / r986205;
        double r986207 = r986202 + r986206;
        return r986207;
}

double f(double x, double y, double z) {
        double r986208 = x;
        double r986209 = y;
        double r986210 = z;
        double r986211 = r986209 / r986210;
        double r986212 = r986209 * r986211;
        double r986213 = r986208 + r986212;
        return r986213;
}

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

Derivation

  1. Initial program 6.5

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

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