Average Error: 0 → 0
Time: 402.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 r2209229 = 1.0;
        double r2209230 = 2.0;
        double r2209231 = r2209229 / r2209230;
        double r2209232 = x;
        double r2209233 = y;
        double r2209234 = r2209232 + r2209233;
        double r2209235 = r2209231 * r2209234;
        return r2209235;
}

double f(double x, double y) {
        double r2209236 = 1.0;
        double r2209237 = 2.0;
        double r2209238 = r2209236 / r2209237;
        double r2209239 = x;
        double r2209240 = y;
        double r2209241 = r2209239 + r2209240;
        double r2209242 = r2209238 * r2209241;
        return r2209242;
}

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