Average Error: 6.4 → 0.1
Time: 17.5s
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 r630042 = x;
        double r630043 = y;
        double r630044 = r630043 * r630043;
        double r630045 = z;
        double r630046 = r630044 / r630045;
        double r630047 = r630042 + r630046;
        return r630047;
}

double f(double x, double y, double z) {
        double r630048 = x;
        double r630049 = y;
        double r630050 = z;
        double r630051 = r630049 / r630050;
        double r630052 = r630049 * r630051;
        double r630053 = r630048 + r630052;
        return r630053;
}

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

Derivation

  1. Initial program 6.4

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

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