Average Error: 0.1 → 0.1
Time: 48.6s
Precision: 64
\[x + \frac{x - y}{2}\]
\[x \cdot 1.5 - y \cdot 0.5\]
x + \frac{x - y}{2}
x \cdot 1.5 - y \cdot 0.5
double f(double x, double y) {
        double r32786788 = x;
        double r32786789 = y;
        double r32786790 = r32786788 - r32786789;
        double r32786791 = 2.0;
        double r32786792 = r32786790 / r32786791;
        double r32786793 = r32786788 + r32786792;
        return r32786793;
}

double f(double x, double y) {
        double r32786794 = x;
        double r32786795 = 1.5;
        double r32786796 = r32786794 * r32786795;
        double r32786797 = y;
        double r32786798 = 0.5;
        double r32786799 = r32786797 * r32786798;
        double r32786800 = r32786796 - r32786799;
        return r32786800;
}

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 x \cdot 1.5 - y \cdot 0.5\]

Reproduce

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