Average Error: 0 → 0
Time: 1.5s
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 r24102653 = 1.0;
        double r24102654 = 2.0;
        double r24102655 = r24102653 / r24102654;
        double r24102656 = x;
        double r24102657 = y;
        double r24102658 = r24102656 + r24102657;
        double r24102659 = r24102655 * r24102658;
        return r24102659;
}

double f(double x, double y) {
        double r24102660 = 1.0;
        double r24102661 = 2.0;
        double r24102662 = r24102660 / r24102661;
        double r24102663 = x;
        double r24102664 = y;
        double r24102665 = r24102663 + r24102664;
        double r24102666 = r24102662 * r24102665;
        return r24102666;
}

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