Average Error: 0.0 → 0.0
Time: 1.7min
Precision: binary64
Cost: 320
\[x + \frac{y}{500}\]
\[x + \frac{y}{500}\]
x + \frac{y}{500}
x + \frac{y}{500}
(FPCore (x y) :precision binary64 (+ x (/ y 500.0)))
(FPCore (x y) :precision binary64 (+ x (/ y 500.0)))
double code(double x, double y) {
	return x + (y / 500.0);
}
double code(double x, double y) {
	return x + (y / 500.0);
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error16.7
Cost834
\[\begin{array}{l} \mathbf{if}\;x \leq -8.237610870529575 \cdot 10^{+21}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.766700241592383 \cdot 10^{-99}:\\ \;\;\;\;\frac{y}{500}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array}\]
Alternative 2
Error31.5
Cost64
\[x\]

Error

Time

Derivation

  1. Initial program 0.0

    \[x + \frac{y}{500}\]
  2. Using strategy rm
  3. Applied flip-+_binary64_1198731.4

    \[\leadsto \color{blue}{\frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{x - \frac{y}{500}}}\]
  4. Simplified31.5

    \[\leadsto \frac{\color{blue}{x \cdot x - y \cdot \frac{y}{250000}}}{x - \frac{y}{500}}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt_binary64_1203547.9

    \[\leadsto \frac{x \cdot x - y \cdot \frac{y}{250000}}{x - \color{blue}{\sqrt{\frac{y}{500}} \cdot \sqrt{\frac{y}{500}}}}\]
  7. Applied add-sqr-sqrt_binary64_1203556.1

    \[\leadsto \frac{x \cdot x - y \cdot \frac{y}{250000}}{\color{blue}{\sqrt{x} \cdot \sqrt{x}} - \sqrt{\frac{y}{500}} \cdot \sqrt{\frac{y}{500}}}\]
  8. Applied difference-of-squares_binary64_1198256.1

    \[\leadsto \frac{x \cdot x - y \cdot \frac{y}{250000}}{\color{blue}{\left(\sqrt{x} + \sqrt{\frac{y}{500}}\right) \cdot \left(\sqrt{x} - \sqrt{\frac{y}{500}}\right)}}\]
  9. Applied *-un-lft-identity_binary64_1201356.1

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

    \[\leadsto \color{blue}{\frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - y \cdot \frac{y}{250000}}{\sqrt{x} - \sqrt{\frac{y}{500}}}}\]
  11. Using strategy rm
  12. Applied add-sqr-sqrt_binary64_1203556.1

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - y \cdot \frac{y}{\color{blue}{\sqrt{250000} \cdot \sqrt{250000}}}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  13. Applied add-sqr-sqrt_binary64_1203556.1

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - y \cdot \frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{\sqrt{250000} \cdot \sqrt{250000}}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  14. Applied times-frac_binary64_1201956.1

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - y \cdot \color{blue}{\left(\frac{\sqrt{y}}{\sqrt{250000}} \cdot \frac{\sqrt{y}}{\sqrt{250000}}\right)}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  15. Applied add-sqr-sqrt_binary64_1203556.1

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \color{blue}{\left(\sqrt{y} \cdot \sqrt{y}\right)} \cdot \left(\frac{\sqrt{y}}{\sqrt{250000}} \cdot \frac{\sqrt{y}}{\sqrt{250000}}\right)}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  16. Applied unswap-sqr_binary64_1198156.1

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \color{blue}{\left(\sqrt{y} \cdot \frac{\sqrt{y}}{\sqrt{250000}}\right) \cdot \left(\sqrt{y} \cdot \frac{\sqrt{y}}{\sqrt{250000}}\right)}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  17. Simplified56.1

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \color{blue}{\frac{y}{500}} \cdot \left(\sqrt{y} \cdot \frac{\sqrt{y}}{\sqrt{250000}}\right)}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  18. Simplified56.0

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \color{blue}{\frac{y}{500}}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  19. Using strategy rm
  20. Applied *-un-lft-identity_binary64_1201356.0

    \[\leadsto \frac{1}{\sqrt{x} + \sqrt{\color{blue}{1 \cdot \frac{y}{500}}}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  21. Applied sqrt-prod_binary64_1202956.0

    \[\leadsto \frac{1}{\sqrt{x} + \color{blue}{\sqrt{1} \cdot \sqrt{\frac{y}{500}}}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  22. Applied *-un-lft-identity_binary64_1201356.0

    \[\leadsto \frac{1}{\sqrt{\color{blue}{1 \cdot x}} + \sqrt{1} \cdot \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  23. Applied sqrt-prod_binary64_1202956.0

    \[\leadsto \frac{1}{\color{blue}{\sqrt{1} \cdot \sqrt{x}} + \sqrt{1} \cdot \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  24. Applied distribute-lft-out_binary64_1196456.0

    \[\leadsto \frac{1}{\color{blue}{\sqrt{1} \cdot \left(\sqrt{x} + \sqrt{\frac{y}{500}}\right)}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  25. Applied *-un-lft-identity_binary64_1201356.0

    \[\leadsto \frac{\color{blue}{1 \cdot 1}}{\sqrt{1} \cdot \left(\sqrt{x} + \sqrt{\frac{y}{500}}\right)} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  26. Applied times-frac_binary64_1201956.0

    \[\leadsto \color{blue}{\left(\frac{1}{\sqrt{1}} \cdot \frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}}\right)} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\]
  27. Applied associate-*l*_binary64_1195456.0

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1}} \cdot \left(\frac{1}{\sqrt{x} + \sqrt{\frac{y}{500}}} \cdot \frac{x \cdot x - \frac{y}{500} \cdot \frac{y}{500}}{\sqrt{x} - \sqrt{\frac{y}{500}}}\right)}\]
  28. Simplified0.0

    \[\leadsto \frac{1}{\sqrt{1}} \cdot \color{blue}{\left(x + \frac{y}{500}\right)}\]
  29. Simplified0.0

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

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

Reproduce

herbie shell --seed 2021040 
(FPCore (x y)
  :name "Data.Colour.CIE:cieLAB from colour-2.3.3, C"
  :precision binary64
  (+ x (/ y 500.0)))