Average Error: 0 → 0
Time: 2.4s
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 r33099635 = 1.0;
        double r33099636 = 2.0;
        double r33099637 = r33099635 / r33099636;
        double r33099638 = x;
        double r33099639 = y;
        double r33099640 = r33099638 + r33099639;
        double r33099641 = r33099637 * r33099640;
        return r33099641;
}

double f(double x, double y) {
        double r33099642 = 1.0;
        double r33099643 = 2.0;
        double r33099644 = r33099642 / r33099643;
        double r33099645 = x;
        double r33099646 = y;
        double r33099647 = r33099645 + r33099646;
        double r33099648 = r33099644 * r33099647;
        return r33099648;
}

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