Average Error: 0 → 0
Time: 435.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 r877314 = 1.0;
        double r877315 = 2.0;
        double r877316 = r877314 / r877315;
        double r877317 = x;
        double r877318 = y;
        double r877319 = r877317 + r877318;
        double r877320 = r877316 * r877319;
        return r877320;
}

double f(double x, double y) {
        double r877321 = 1.0;
        double r877322 = 2.0;
        double r877323 = r877321 / r877322;
        double r877324 = x;
        double r877325 = y;
        double r877326 = r877324 + r877325;
        double r877327 = r877323 * r877326;
        return r877327;
}

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