Average Error: 0.1 → 0.1
Time: 1.2s
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 r344627 = x;
        double r344628 = y;
        double r344629 = r344627 - r344628;
        double r344630 = 2.0;
        double r344631 = r344629 / r344630;
        double r344632 = r344627 + r344631;
        return r344632;
}

double f(double x, double y) {
        double r344633 = x;
        double r344634 = y;
        double r344635 = r344633 - r344634;
        double r344636 = 2.0;
        double r344637 = r344635 / r344636;
        double r344638 = r344633 + r344637;
        return r344638;
}

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