Average Error: 0.1 → 0.1
Time: 20.2s
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 r31375645 = x;
        double r31375646 = y;
        double r31375647 = r31375645 - r31375646;
        double r31375648 = 2.0;
        double r31375649 = r31375647 / r31375648;
        double r31375650 = r31375645 + r31375649;
        return r31375650;
}

double f(double x, double y) {
        double r31375651 = 1.5;
        double r31375652 = x;
        double r31375653 = r31375651 * r31375652;
        double r31375654 = 0.5;
        double r31375655 = y;
        double r31375656 = r31375654 * r31375655;
        double r31375657 = r31375653 - r31375656;
        return r31375657;
}

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 2019168 
(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)))