Average Error: 0.1 → 0.1
Time: 6.4s
Precision: 64
\[x + \frac{x - y}{2}\]
\[x + \frac{x - y}{2}\]
x + \frac{x - y}{2}
x + \frac{x - y}{2}
double f(double x, double y) {
        double r658435 = x;
        double r658436 = y;
        double r658437 = r658435 - r658436;
        double r658438 = 2.0;
        double r658439 = r658437 / r658438;
        double r658440 = r658435 + r658439;
        return r658440;
}

double f(double x, double y) {
        double r658441 = x;
        double r658442 = y;
        double r658443 = r658441 - r658442;
        double r658444 = 2.0;
        double r658445 = r658443 / r658444;
        double r658446 = r658441 + r658445;
        return r658446;
}

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.1
Target0.1
Herbie0.1
\[1.5 \cdot x - 0.5 \cdot y\]

Derivation

  1. Initial program 0.1

    \[x + \frac{x - y}{2}\]
  2. Final simplification0.1

    \[\leadsto x + \frac{x - y}{2}\]

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Axis.Types:hBufferRect from Chart-1.5.3"
  :precision binary64

  :herbie-target
  (- (* 1.5 x) (* 0.5 y))

  (+ x (/ (- x y) 2)))