Average Error: 0 → 0
Time: 1.3s
Precision: 64
\[\frac{1}{2} \cdot \left(x + y\right)\]
\[\frac{1}{2} \cdot \left(x + y\right)\]
\frac{1}{2} \cdot \left(x + y\right)
\frac{1}{2} \cdot \left(x + y\right)
double f(double x, double y) {
        double r31202661 = 1.0;
        double r31202662 = 2.0;
        double r31202663 = r31202661 / r31202662;
        double r31202664 = x;
        double r31202665 = y;
        double r31202666 = r31202664 + r31202665;
        double r31202667 = r31202663 * r31202666;
        return r31202667;
}

double f(double x, double y) {
        double r31202668 = 1.0;
        double r31202669 = 2.0;
        double r31202670 = r31202668 / r31202669;
        double r31202671 = x;
        double r31202672 = y;
        double r31202673 = r31202671 + r31202672;
        double r31202674 = r31202670 * r31202673;
        return r31202674;
}

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
Target0
Herbie0
\[\frac{x + y}{2}\]

Derivation

  1. Initial program 0

    \[\frac{1}{2} \cdot \left(x + y\right)\]
  2. Final simplification0

    \[\leadsto \frac{1}{2} \cdot \left(x + y\right)\]

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"

  :herbie-target
  (/ (+ x y) 2.0)

  (* (/ 1.0 2.0) (+ x y)))