Average Error: 0.1 → 0.1
Time: 20.5s
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 r26668013 = x;
        double r26668014 = y;
        double r26668015 = r26668013 - r26668014;
        double r26668016 = 2.0;
        double r26668017 = r26668015 / r26668016;
        double r26668018 = r26668013 + r26668017;
        return r26668018;
}

double f(double x, double y) {
        double r26668019 = 1.5;
        double r26668020 = x;
        double r26668021 = r26668019 * r26668020;
        double r26668022 = 0.5;
        double r26668023 = y;
        double r26668024 = r26668022 * r26668023;
        double r26668025 = r26668021 - r26668024;
        return r26668025;
}

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