Average Error: 0.3 → 0.3
Time: 15.4s
Precision: 64
\[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
\[\left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0\]
\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y
\left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0
double f(double x, double y) {
        double r32068989 = x;
        double r32068990 = 3.0;
        double r32068991 = r32068989 * r32068990;
        double r32068992 = y;
        double r32068993 = r32068991 * r32068992;
        double r32068994 = r32068993 * r32068992;
        return r32068994;
}

double f(double x, double y) {
        double r32068995 = y;
        double r32068996 = x;
        double r32068997 = r32068995 * r32068996;
        double r32068998 = r32068995 * r32068997;
        double r32068999 = 3.0;
        double r32069000 = r32068998 * r32068999;
        return r32069000;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.3
\[\left(x \cdot \left(3.0 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3.0\right) \cdot y\right) \cdot y\]
  2. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{\left(3.0 \cdot \left(x \cdot y\right)\right)} \cdot y\]
  3. Using strategy rm
  4. Applied associate-*l*0.3

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

    \[\leadsto \left(y \cdot \left(y \cdot x\right)\right) \cdot 3.0\]

Reproduce

herbie shell --seed 2019164 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"

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

  (* (* (* x 3.0) y) y))