Average Error: 0 → 0
Time: 1.1s
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 r512562 = 1.0;
        double r512563 = 2.0;
        double r512564 = r512562 / r512563;
        double r512565 = x;
        double r512566 = y;
        double r512567 = r512565 + r512566;
        double r512568 = r512564 * r512567;
        return r512568;
}

double f(double x, double y) {
        double r512569 = 1.0;
        double r512570 = 2.0;
        double r512571 = r512569 / r512570;
        double r512572 = x;
        double r512573 = y;
        double r512574 = r512572 + r512573;
        double r512575 = r512571 * r512574;
        return r512575;
}

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