Average Error: 0 → 0
Time: 414.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 r415258 = 1.0;
        double r415259 = 2.0;
        double r415260 = r415258 / r415259;
        double r415261 = x;
        double r415262 = y;
        double r415263 = r415261 + r415262;
        double r415264 = r415260 * r415263;
        return r415264;
}

double f(double x, double y) {
        double r415265 = 1.0;
        double r415266 = 2.0;
        double r415267 = r415265 / r415266;
        double r415268 = x;
        double r415269 = y;
        double r415270 = r415268 + r415269;
        double r415271 = r415267 * r415270;
        return r415271;
}

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