Average Error: 0.0 → 0
Time: 1.4s
Precision: binary64
\[\left(x + y\right) + x\]
\[y + 2 \cdot x\]
\left(x + y\right) + x
y + 2 \cdot x
(FPCore (x y) :precision binary64 (+ (+ x y) x))
(FPCore (x y) :precision binary64 (+ y (* 2.0 x)))
double code(double x, double y) {
	return (x + y) + x;
}
double code(double x, double y) {
	return y + (2.0 * x);
}

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.0
Target0
Herbie0
\[y + 2 \cdot x\]

Derivation

  1. Initial program 0.0

    \[\left(x + y\right) + x\]
  2. Using strategy rm
  3. Applied flip-+_binary64_780247.0

    \[\leadsto \color{blue}{\frac{\left(x + y\right) \cdot \left(x + y\right) - x \cdot x}{\left(x + y\right) - x}}\]
  4. Simplified47.0

    \[\leadsto \frac{\color{blue}{y \cdot \left(x + \left(x + y\right)\right)}}{\left(x + y\right) - x}\]
  5. Simplified23.6

    \[\leadsto \frac{y \cdot \left(x + \left(x + y\right)\right)}{\color{blue}{y}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity_binary64_782823.6

    \[\leadsto \frac{y \cdot \left(x + \left(x + y\right)\right)}{\color{blue}{1 \cdot y}}\]
  8. Applied times-frac_binary64_78347.6

    \[\leadsto \color{blue}{\frac{y}{1} \cdot \frac{x + \left(x + y\right)}{y}}\]
  9. Simplified7.6

    \[\leadsto \color{blue}{y} \cdot \frac{x + \left(x + y\right)}{y}\]
  10. Simplified7.6

    \[\leadsto y \cdot \color{blue}{\frac{x + \left(y + x\right)}{y}}\]
  11. Taylor expanded around 0 7.6

    \[\leadsto y \cdot \color{blue}{\left(2 \cdot \frac{x}{y} + 1\right)}\]
  12. Simplified7.6

    \[\leadsto y \cdot \color{blue}{\left(1 + 2 \cdot \frac{x}{y}\right)}\]
  13. Using strategy rm
  14. Applied distribute-rgt-in_binary64_77807.5

    \[\leadsto \color{blue}{1 \cdot y + \left(2 \cdot \frac{x}{y}\right) \cdot y}\]
  15. Simplified7.5

    \[\leadsto \color{blue}{y} + \left(2 \cdot \frac{x}{y}\right) \cdot y\]
  16. Simplified0

    \[\leadsto y + \color{blue}{2 \cdot x}\]
  17. Final simplification0

    \[\leadsto y + 2 \cdot x\]

Reproduce

herbie shell --seed 2020281 
(FPCore (x y)
  :name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, A"
  :precision binary64

  :herbie-target
  (+ y (* 2.0 x))

  (+ (+ x y) x))