Average Error: 0 → 0
Time: 906.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 r435715 = 1.0;
        double r435716 = 2.0;
        double r435717 = r435715 / r435716;
        double r435718 = x;
        double r435719 = y;
        double r435720 = r435718 + r435719;
        double r435721 = r435717 * r435720;
        return r435721;
}

double f(double x, double y) {
        double r435722 = 1.0;
        double r435723 = 2.0;
        double r435724 = r435722 / r435723;
        double r435725 = x;
        double r435726 = y;
        double r435727 = r435725 + r435726;
        double r435728 = r435724 * r435727;
        return r435728;
}

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