Average Error: 0 → 0
Time: 1.4s
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 r430152 = 1.0;
        double r430153 = 2.0;
        double r430154 = r430152 / r430153;
        double r430155 = x;
        double r430156 = y;
        double r430157 = r430155 + r430156;
        double r430158 = r430154 * r430157;
        return r430158;
}

double f(double x, double y) {
        double r430159 = 1.0;
        double r430160 = 2.0;
        double r430161 = r430159 / r430160;
        double r430162 = x;
        double r430163 = y;
        double r430164 = r430162 + r430163;
        double r430165 = r430161 * r430164;
        return r430165;
}

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