Average Error: 0 → 0
Time: 1.9s
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 r522222 = 1.0;
        double r522223 = 2.0;
        double r522224 = r522222 / r522223;
        double r522225 = x;
        double r522226 = y;
        double r522227 = r522225 + r522226;
        double r522228 = r522224 * r522227;
        return r522228;
}

double f(double x, double y) {
        double r522229 = 1.0;
        double r522230 = 2.0;
        double r522231 = r522229 / r522230;
        double r522232 = x;
        double r522233 = y;
        double r522234 = r522232 + r522233;
        double r522235 = r522231 * r522234;
        return r522235;
}

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

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

  (* (/ 1.0 2.0) (+ x y)))