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 r126116781 = 1.0;
        double r126116782 = 2.0;
        double r126116783 = r126116781 / r126116782;
        double r126116784 = x;
        double r126116785 = y;
        double r126116786 = r126116784 + r126116785;
        double r126116787 = r126116783 * r126116786;
        return r126116787;
}

double f(double x, double y) {
        double r126116788 = 1.0;
        double r126116789 = 2.0;
        double r126116790 = r126116788 / r126116789;
        double r126116791 = x;
        double r126116792 = y;
        double r126116793 = r126116791 + r126116792;
        double r126116794 = r126116790 * r126116793;
        return r126116794;
}

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