Average Error: 0 → 0
Time: 446.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 r825440 = 1.0;
        double r825441 = 2.0;
        double r825442 = r825440 / r825441;
        double r825443 = x;
        double r825444 = y;
        double r825445 = r825443 + r825444;
        double r825446 = r825442 * r825445;
        return r825446;
}

double f(double x, double y) {
        double r825447 = 1.0;
        double r825448 = 2.0;
        double r825449 = r825447 / r825448;
        double r825450 = x;
        double r825451 = y;
        double r825452 = r825450 + r825451;
        double r825453 = r825449 * r825452;
        return r825453;
}

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