Average Error: 0 → 0
Time: 445.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 r813902 = 1.0;
        double r813903 = 2.0;
        double r813904 = r813902 / r813903;
        double r813905 = x;
        double r813906 = y;
        double r813907 = r813905 + r813906;
        double r813908 = r813904 * r813907;
        return r813908;
}

double f(double x, double y) {
        double r813909 = 1.0;
        double r813910 = 2.0;
        double r813911 = r813909 / r813910;
        double r813912 = x;
        double r813913 = y;
        double r813914 = r813912 + r813913;
        double r813915 = r813911 * r813914;
        return r813915;
}

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