Average Error: 0 → 0
Time: 889.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 r413356 = 1.0;
        double r413357 = 2.0;
        double r413358 = r413356 / r413357;
        double r413359 = x;
        double r413360 = y;
        double r413361 = r413359 + r413360;
        double r413362 = r413358 * r413361;
        return r413362;
}

double f(double x, double y) {
        double r413363 = 1.0;
        double r413364 = 2.0;
        double r413365 = r413363 / r413364;
        double r413366 = x;
        double r413367 = y;
        double r413368 = r413366 + r413367;
        double r413369 = r413365 * r413368;
        return r413369;
}

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