Average Error: 0.0 → 0.0
Time: 1.8s
Precision: binary64
\[\frac{x + y}{10} \]
\[\frac{y}{10} + \frac{x}{10} \]
\frac{x + y}{10}
\frac{y}{10} + \frac{x}{10}
(FPCore (x y) :precision binary64 (/ (+ x y) 10.0))
(FPCore (x y) :precision binary64 (+ (/ y 10.0) (/ x 10.0)))
double code(double x, double y) {
	return (x + y) / 10.0;
}
double code(double x, double y) {
	return (y / 10.0) + (x / 10.0);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{x + y}{10} \]
  2. Applied add-sqr-sqrt_binary641.1

    \[\leadsto \frac{x + y}{\color{blue}{\sqrt{10} \cdot \sqrt{10}}} \]
  3. Applied associate-/r*_binary640.7

    \[\leadsto \color{blue}{\frac{\frac{x + y}{\sqrt{10}}}{\sqrt{10}}} \]
  4. Taylor expanded in x around 0 1.1

    \[\leadsto \color{blue}{\frac{x}{{\left(\sqrt{10}\right)}^{2}} + \frac{y}{{\left(\sqrt{10}\right)}^{2}}} \]
  5. Simplified0.0

    \[\leadsto \color{blue}{\frac{y}{10} + \frac{x}{10}} \]
  6. Final simplification0.0

    \[\leadsto \frac{y}{10} + \frac{x}{10} \]

Reproduce

herbie shell --seed 2021307 
(FPCore (x y)
  :name "Text.Parsec.Token:makeTokenParser from parsec-3.1.9, A"
  :precision binary64
  (/ (+ x y) 10.0))