Average Error: 0 → 0
Time: 397.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 r765768 = 1.0;
        double r765769 = 2.0;
        double r765770 = r765768 / r765769;
        double r765771 = x;
        double r765772 = y;
        double r765773 = r765771 + r765772;
        double r765774 = r765770 * r765773;
        return r765774;
}

double f(double x, double y) {
        double r765775 = 1.0;
        double r765776 = 2.0;
        double r765777 = r765775 / r765776;
        double r765778 = x;
        double r765779 = y;
        double r765780 = r765778 + r765779;
        double r765781 = r765777 * r765780;
        return r765781;
}

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