Average Error: 0 → 0
Time: 432.0ms
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 r746840 = 1.0;
        double r746841 = 2.0;
        double r746842 = r746840 / r746841;
        double r746843 = x;
        double r746844 = y;
        double r746845 = r746843 + r746844;
        double r746846 = r746842 * r746845;
        return r746846;
}

double f(double x, double y) {
        double r746847 = 1.0;
        double r746848 = 2.0;
        double r746849 = r746847 / r746848;
        double r746850 = x;
        double r746851 = y;
        double r746852 = r746850 + r746851;
        double r746853 = r746849 * r746852;
        return r746853;
}

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 2020057 +o rules:numerics
(FPCore (x y)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, G"
  :precision binary64

  :herbie-target
  (/ (+ x y) 2)

  (* (/ 1 2) (+ x y)))