Average Error: 0.3 → 0.2
Time: 16.1s
Precision: 64
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[\left(\left(y \cdot x\right) \cdot 3\right) \cdot y\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
\left(\left(y \cdot x\right) \cdot 3\right) \cdot y
double f(double x, double y) {
        double r31996016 = x;
        double r31996017 = 3.0;
        double r31996018 = r31996016 * r31996017;
        double r31996019 = y;
        double r31996020 = r31996018 * r31996019;
        double r31996021 = r31996020 * r31996019;
        return r31996021;
}

double f(double x, double y) {
        double r31996022 = y;
        double r31996023 = x;
        double r31996024 = r31996022 * r31996023;
        double r31996025 = 3.0;
        double r31996026 = r31996024 * r31996025;
        double r31996027 = r31996026 * r31996022;
        return r31996027;
}

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.2
\[\left(x \cdot \left(3 \cdot y\right)\right) \cdot y\]

Derivation

  1. Initial program 0.3

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

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

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

Reproduce

herbie shell --seed 2019169 +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))