Average Error: 0 → 0
Time: 1.2s
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 r491226 = 1.0;
        double r491227 = 2.0;
        double r491228 = r491226 / r491227;
        double r491229 = x;
        double r491230 = y;
        double r491231 = r491229 + r491230;
        double r491232 = r491228 * r491231;
        return r491232;
}

double f(double x, double y) {
        double r491233 = 1.0;
        double r491234 = 2.0;
        double r491235 = r491233 / r491234;
        double r491236 = x;
        double r491237 = y;
        double r491238 = r491236 + r491237;
        double r491239 = r491235 * r491238;
        return r491239;
}

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