Average Error: 0.1 → 0.1
Time: 14.1s
Precision: 64
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
\[z \cdot \left(3 \cdot z\right) + x \cdot y\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z
z \cdot \left(3 \cdot z\right) + x \cdot y
double f(double x, double y, double z) {
        double r420900 = x;
        double r420901 = y;
        double r420902 = r420900 * r420901;
        double r420903 = z;
        double r420904 = r420903 * r420903;
        double r420905 = r420902 + r420904;
        double r420906 = r420905 + r420904;
        double r420907 = r420906 + r420904;
        return r420907;
}

double f(double x, double y, double z) {
        double r420908 = z;
        double r420909 = 3.0;
        double r420910 = r420909 * r420908;
        double r420911 = r420908 * r420910;
        double r420912 = x;
        double r420913 = y;
        double r420914 = r420912 * r420913;
        double r420915 = r420911 + r420914;
        return r420915;
}

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

Original0.1
Target0.1
Herbie0.1
\[\left(3 \cdot z\right) \cdot z + y \cdot x\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
  2. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {z}^{2} + x \cdot y}\]
  3. Using strategy rm
  4. Applied sqr-pow0.1

    \[\leadsto 3 \cdot \color{blue}{\left({z}^{\left(\frac{2}{2}\right)} \cdot {z}^{\left(\frac{2}{2}\right)}\right)} + x \cdot y\]
  5. Applied associate-*r*0.1

    \[\leadsto \color{blue}{\left(3 \cdot {z}^{\left(\frac{2}{2}\right)}\right) \cdot {z}^{\left(\frac{2}{2}\right)}} + x \cdot y\]
  6. Simplified0.1

    \[\leadsto \color{blue}{\left(3 \cdot z\right)} \cdot {z}^{\left(\frac{2}{2}\right)} + x \cdot y\]
  7. Final simplification0.1

    \[\leadsto z \cdot \left(3 \cdot z\right) + x \cdot y\]

Reproduce

herbie shell --seed 2019323 
(FPCore (x y z)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, A"
  :precision binary64

  :herbie-target
  (+ (* (* 3 z) z) (* y x))

  (+ (+ (+ (* x y) (* z z)) (* z z)) (* z z)))