Average Error: 0 → 0
Time: 1.6s
Precision: 64
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
\frac{1.0}{2.0} \cdot \left(x + y\right)
\frac{1.0}{2.0} \cdot \left(x + y\right)
double f(double x, double y) {
        double r32942709 = 1.0;
        double r32942710 = 2.0;
        double r32942711 = r32942709 / r32942710;
        double r32942712 = x;
        double r32942713 = y;
        double r32942714 = r32942712 + r32942713;
        double r32942715 = r32942711 * r32942714;
        return r32942715;
}

double f(double x, double y) {
        double r32942716 = 1.0;
        double r32942717 = 2.0;
        double r32942718 = r32942716 / r32942717;
        double r32942719 = x;
        double r32942720 = y;
        double r32942721 = r32942719 + r32942720;
        double r32942722 = r32942718 * r32942721;
        return r32942722;
}

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.0}\]

Derivation

  1. Initial program 0

    \[\frac{1.0}{2.0} \cdot \left(x + y\right)\]
  2. Final simplification0

    \[\leadsto \frac{1.0}{2.0} \cdot \left(x + y\right)\]

Reproduce

herbie shell --seed 2019162 +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)))