Average Error: 0.1 → 0.1
Time: 5.5s
Precision: 64
\[x + \frac{x - y}{2}\]
\[1.5 \cdot x - 0.5 \cdot y\]
x + \frac{x - y}{2}
1.5 \cdot x - 0.5 \cdot y
double f(double x, double y) {
        double r714002 = x;
        double r714003 = y;
        double r714004 = r714002 - r714003;
        double r714005 = 2.0;
        double r714006 = r714004 / r714005;
        double r714007 = r714002 + r714006;
        return r714007;
}

double f(double x, double y) {
        double r714008 = 1.5;
        double r714009 = x;
        double r714010 = r714008 * r714009;
        double r714011 = 0.5;
        double r714012 = y;
        double r714013 = r714011 * r714012;
        double r714014 = r714010 - r714013;
        return r714014;
}

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. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{1.5 \cdot x - 0.5 \cdot y}\]
  3. Final simplification0.1

    \[\leadsto 1.5 \cdot x - 0.5 \cdot y\]

Reproduce

herbie shell --seed 2020027 
(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)))