Average Error: 0 → 0
Time: 1.2s
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 r30718522 = 1.0;
        double r30718523 = 2.0;
        double r30718524 = r30718522 / r30718523;
        double r30718525 = x;
        double r30718526 = y;
        double r30718527 = r30718525 + r30718526;
        double r30718528 = r30718524 * r30718527;
        return r30718528;
}

double f(double x, double y) {
        double r30718529 = 1.0;
        double r30718530 = 2.0;
        double r30718531 = r30718529 / r30718530;
        double r30718532 = x;
        double r30718533 = y;
        double r30718534 = r30718532 + r30718533;
        double r30718535 = r30718531 * r30718534;
        return r30718535;
}

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