Average Error: 0 → 0
Time: 467.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 r952542 = 1.0;
        double r952543 = 2.0;
        double r952544 = r952542 / r952543;
        double r952545 = x;
        double r952546 = y;
        double r952547 = r952545 + r952546;
        double r952548 = r952544 * r952547;
        return r952548;
}

double f(double x, double y) {
        double r952549 = 1.0;
        double r952550 = 2.0;
        double r952551 = r952549 / r952550;
        double r952552 = x;
        double r952553 = y;
        double r952554 = r952552 + r952553;
        double r952555 = r952551 * r952554;
        return r952555;
}

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