Average Error: 0 → 0
Time: 1.5s
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 r27069581 = 1.0;
        double r27069582 = 2.0;
        double r27069583 = r27069581 / r27069582;
        double r27069584 = x;
        double r27069585 = y;
        double r27069586 = r27069584 + r27069585;
        double r27069587 = r27069583 * r27069586;
        return r27069587;
}

double f(double x, double y) {
        double r27069588 = 1.0;
        double r27069589 = 2.0;
        double r27069590 = r27069588 / r27069589;
        double r27069591 = x;
        double r27069592 = y;
        double r27069593 = r27069591 + r27069592;
        double r27069594 = r27069590 * r27069593;
        return r27069594;
}

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 2019171 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"

  :herbie-target
  (/ (+ x y) 2.0)

  (* (/ 1.0 2.0) (+ x y)))