Average Error: 0 → 0
Time: 1.0s
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 r411832 = 1.0;
        double r411833 = 2.0;
        double r411834 = r411832 / r411833;
        double r411835 = x;
        double r411836 = y;
        double r411837 = r411835 + r411836;
        double r411838 = r411834 * r411837;
        return r411838;
}

double f(double x, double y) {
        double r411839 = 1.0;
        double r411840 = 2.0;
        double r411841 = r411839 / r411840;
        double r411842 = x;
        double r411843 = y;
        double r411844 = r411842 + r411843;
        double r411845 = r411841 * r411844;
        return r411845;
}

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