Average Error: 0.1 → 0.1
Time: 13.6s
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 r690715 = x;
        double r690716 = y;
        double r690717 = r690715 - r690716;
        double r690718 = 2.0;
        double r690719 = r690717 / r690718;
        double r690720 = r690715 + r690719;
        return r690720;
}

double f(double x, double y) {
        double r690721 = x;
        double r690722 = y;
        double r690723 = r690721 - r690722;
        double r690724 = 2.0;
        double r690725 = r690723 / r690724;
        double r690726 = r690721 + r690725;
        return r690726;
}

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