Average Error: 0 → 0
Time: 404.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 r648714 = 1.0;
        double r648715 = 2.0;
        double r648716 = r648714 / r648715;
        double r648717 = x;
        double r648718 = y;
        double r648719 = r648717 + r648718;
        double r648720 = r648716 * r648719;
        return r648720;
}

double f(double x, double y) {
        double r648721 = 1.0;
        double r648722 = 2.0;
        double r648723 = r648721 / r648722;
        double r648724 = x;
        double r648725 = y;
        double r648726 = r648724 + r648725;
        double r648727 = r648723 * r648726;
        return r648727;
}

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 2020047 +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)))