Average Error: 0 → 0
Time: 441.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 r111025 = 1.0;
        double r111026 = 2.0;
        double r111027 = r111025 / r111026;
        double r111028 = x;
        double r111029 = y;
        double r111030 = r111028 + r111029;
        double r111031 = r111027 * r111030;
        return r111031;
}

double f(double x, double y) {
        double r111032 = 1.0;
        double r111033 = 2.0;
        double r111034 = r111032 / r111033;
        double r111035 = x;
        double r111036 = y;
        double r111037 = r111035 + r111036;
        double r111038 = r111034 * r111037;
        return r111038;
}

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