Average Error: 0 → 0
Time: 1.6s
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 r30783764 = 1.0;
        double r30783765 = 2.0;
        double r30783766 = r30783764 / r30783765;
        double r30783767 = x;
        double r30783768 = y;
        double r30783769 = r30783767 + r30783768;
        double r30783770 = r30783766 * r30783769;
        return r30783770;
}

double f(double x, double y) {
        double r30783771 = 1.0;
        double r30783772 = 2.0;
        double r30783773 = r30783771 / r30783772;
        double r30783774 = x;
        double r30783775 = y;
        double r30783776 = r30783774 + r30783775;
        double r30783777 = r30783773 * r30783776;
        return r30783777;
}

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