Average Error: 0 → 0
Time: 421.0ms
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 r976628 = 1.0;
        double r976629 = 2.0;
        double r976630 = r976628 / r976629;
        double r976631 = x;
        double r976632 = y;
        double r976633 = r976631 + r976632;
        double r976634 = r976630 * r976633;
        return r976634;
}

double f(double x, double y) {
        double r976635 = 1.0;
        double r976636 = 2.0;
        double r976637 = r976635 / r976636;
        double r976638 = x;
        double r976639 = y;
        double r976640 = r976638 + r976639;
        double r976641 = r976637 * r976640;
        return r976641;
}

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 2020060 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"
  :precision binary64

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

  (* (/ 1 2) (+ x y)))