Average Error: 0.0 → 0.0
Time: 1.4s
Precision: binary64
\[x + \frac{1}{3} \]
\[\left(0.3333333333333333 + x\right) + \left(\frac{0.3333333333333333}{x} + 1\right) \cdot 0 \]
x + \frac{1}{3}
\left(0.3333333333333333 + x\right) + \left(\frac{0.3333333333333333}{x} + 1\right) \cdot 0
(FPCore (x) :precision binary64 (+ x (/ 1.0 3.0)))
(FPCore (x)
 :precision binary64
 (+ (+ 0.3333333333333333 x) (* (+ (/ 0.3333333333333333 x) 1.0) 0.0)))
double code(double x) {
	return x + (1.0 / 3.0);
}
double code(double x) {
	return (0.3333333333333333 + x) + (((0.3333333333333333 / x) + 1.0) * 0.0);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x + \frac{1}{3} \]
  2. Simplified0.0

    \[\leadsto \color{blue}{x + 0.3333333333333333} \]
  3. Applied egg-rr0.0

    \[\leadsto \color{blue}{x \cdot \left(1 + \frac{0.3333333333333333}{x}\right)} \]
  4. Applied egg-rr0.0

    \[\leadsto \color{blue}{\left(0.3333333333333333 + x\right) + \left(\frac{0.3333333333333333}{x} + 1\right) \cdot 0} \]
  5. Final simplification0.0

    \[\leadsto \left(0.3333333333333333 + x\right) + \left(\frac{0.3333333333333333}{x} + 1\right) \cdot 0 \]

Reproduce

herbie shell --seed 2022127 
(FPCore (x)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, F"
  :precision binary64
  (+ x (/ 1.0 3.0)))