Average Error: 0.0 → 0.0
Time: 1.6s
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. Using strategy rm
  3. Applied add-sqr-sqrt_binary641.1

    \[\leadsto \frac{x + y}{\color{blue}{\sqrt{10} \cdot \sqrt{10}}}\]
  4. Applied *-un-lft-identity_binary641.1

    \[\leadsto \frac{\color{blue}{1 \cdot \left(x + y\right)}}{\sqrt{10} \cdot \sqrt{10}}\]
  5. Applied times-frac_binary640.3

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

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

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

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

Reproduce

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