Average Error: 0.1 → 0.1
Time: 17.4s
Precision: 64
\[x + \frac{x - y}{2.0}\]
\[1.5 \cdot x - 0.5 \cdot y\]
x + \frac{x - y}{2.0}
1.5 \cdot x - 0.5 \cdot y
double f(double x, double y) {
        double r43173000 = x;
        double r43173001 = y;
        double r43173002 = r43173000 - r43173001;
        double r43173003 = 2.0;
        double r43173004 = r43173002 / r43173003;
        double r43173005 = r43173000 + r43173004;
        return r43173005;
}

double f(double x, double y) {
        double r43173006 = 1.5;
        double r43173007 = x;
        double r43173008 = r43173006 * r43173007;
        double r43173009 = 0.5;
        double r43173010 = y;
        double r43173011 = r43173009 * r43173010;
        double r43173012 = r43173008 - r43173011;
        return r43173012;
}

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.0}\]
  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 2019158 
(FPCore (x y)
  :name "Graphics.Rendering.Chart.Axis.Types:hBufferRect from Chart-1.5.3"

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

  (+ x (/ (- x y) 2.0)))