I enjoyed the Python program exhibited on Poromenos's blog that prints out "Hello World" using curve-fitting. I wanted to play copycat in Java, but wanted to use an exact solution to the equation instead of rounding off. The result is exhibited below.
public class HelloWorld {
public static void main(String arguments[]) {
for (int i = 0; i < 13; ++i) {
System.out.print(f(i));
}
System.out.println();
}
private static char f(int x) {
return (char)(
( 49816166400L
+ 1114492383360L * x
- 3487560668352L * x * x
+ 4521056833128L * x * x * x
- 3246967654612L * x * x * x * x
+ 1447974643830L * x * x * x * x * x
- 423730694651L * x * x * x * x * x * x
+ 83502380214L * x * x * x * x * x * x * x
- 11141107791L * x * x * x * x * x * x * x * x
+ 991358610L * x * x * x * x * x * x * x * x * x
- 56296097L * x * x * x * x * x * x * x * x * x * x
+ 1844058L * x * x * x * x * x * x * x * x * x * x * x
- 26497L * x * x * x * x * x * x * x * x * x * x * x * x
) / 479001600L
);
}
}
In case you are wondering, I captured a transcript of the Mathematica session where I generated that program (PDF).