Average Error: 0.1 → 0.1
Time: 1.0m
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 r24686363 = x;
        double r24686364 = y;
        double r24686365 = r24686363 * r24686364;
        double r24686366 = z;
        double r24686367 = r24686366 * r24686366;
        double r24686368 = r24686365 + r24686367;
        double r24686369 = r24686368 + r24686367;
        double r24686370 = r24686369 + r24686367;
        return r24686370;
}

double f(double x, double y, double z) {
        double r24686371 = z;
        double r24686372 = 3.0;
        double r24686373 = r24686372 * r24686371;
        double r24686374 = r24686371 * r24686373;
        double r24686375 = x;
        double r24686376 = y;
        double r24686377 = r24686375 * r24686376;
        double r24686378 = r24686374 + r24686377;
        return r24686378;
}

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. Simplified0.1

    \[\leadsto \color{blue}{3 \cdot \left(z \cdot z\right) + y \cdot x}\]
  3. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{3 \cdot {z}^{2}} + y \cdot x\]
  4. Simplified0.1

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

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

Reproduce

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

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

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