Average Error: 0.1 → 0.1
Time: 18.2s
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 r28487642 = x;
        double r28487643 = y;
        double r28487644 = r28487642 - r28487643;
        double r28487645 = 2.0;
        double r28487646 = r28487644 / r28487645;
        double r28487647 = r28487642 + r28487646;
        return r28487647;
}

double f(double x, double y) {
        double r28487648 = 1.5;
        double r28487649 = x;
        double r28487650 = r28487648 * r28487649;
        double r28487651 = 0.5;
        double r28487652 = y;
        double r28487653 = r28487651 * r28487652;
        double r28487654 = r28487650 - r28487653;
        return r28487654;
}

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