Average Error: 0 → 0
Time: 1.5s
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 r555974 = 1.0;
        double r555975 = 2.0;
        double r555976 = r555974 / r555975;
        double r555977 = x;
        double r555978 = y;
        double r555979 = r555977 + r555978;
        double r555980 = r555976 * r555979;
        return r555980;
}

double f(double x, double y) {
        double r555981 = 1.0;
        double r555982 = 2.0;
        double r555983 = r555981 / r555982;
        double r555984 = x;
        double r555985 = y;
        double r555986 = r555984 + r555985;
        double r555987 = r555983 * r555986;
        return r555987;
}

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