Average Error: 0.1 → 0.1
Time: 34.0s
Precision: 64
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[y \cdot \left(y \cdot 3\right) + x \cdot x\]
\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
y \cdot \left(y \cdot 3\right) + x \cdot x
double f(double x, double y) {
        double r24275399 = x;
        double r24275400 = r24275399 * r24275399;
        double r24275401 = y;
        double r24275402 = r24275401 * r24275401;
        double r24275403 = r24275400 + r24275402;
        double r24275404 = r24275403 + r24275402;
        double r24275405 = r24275404 + r24275402;
        return r24275405;
}

double f(double x, double y) {
        double r24275406 = y;
        double r24275407 = 3.0;
        double r24275408 = r24275406 * r24275407;
        double r24275409 = r24275406 * r24275408;
        double r24275410 = x;
        double r24275411 = r24275410 * r24275410;
        double r24275412 = r24275409 + r24275411;
        return r24275412;
}

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.1
Target0.1
Herbie0.1
\[x \cdot x + y \cdot \left(y + \left(y + y\right)\right)\]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
  2. Simplified0.1

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

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

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

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

Reproduce

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

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

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