Skip to content

Instantly share code, notes, and snippets.

@tompng
Last active July 17, 2019 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tompng/ad40c51291f45ffe6120edc63ea3a64e to your computer and use it in GitHub Desktop.
Save tompng/ad40c51291f45ffe6120edc63ea3a64e to your computer and use it in GitHub Desktop.
mathfont for c (converter for https://github.com/tompng/mathfont)
class Node
attr_reader :to_s
def initialize op, a=nil, b=nil
if a.nil?
@to_s = op
return
end
case op
when :-@
@to_s = "(-#{a.to_f})"
when :+, :-, :*, :/
@to_s = "(#{a.to_f}#{op}#{b.to_f})"
when :**
@to_s = "pow(#{a}, #{b})"
else
@to_s = "#{op}(#{a})"
end
end
%i[+ - * / ** -@].each do |op|
define_method op do |arg=nil|
Node.new op, self, arg
end
end
def to_f
self
end
end
module M
%i[cos sin exp sqrt atan tan].each do |name|
define_singleton_method name do |x|
Node.new name, x
end
end
PI = Math::PI
end
[Integer, Float].each do |klass|
klass.class_eval do
%i[+ - * / **].each do |name|
original_method = klass.instance_method name
define_method name do |arg|
if arg.is_a? Numeric
original_method.bind(self).call arg
else
Node.new name, self, arg
end
end
end
end
end
$names=[]
def register a
ast = yield(Node.new('x'), Node.new('y'), Node.new('r'), Node.new('th')).to_s
code = ''
code << 'float r = sqrt(x*x+y*y);' if ast =~ /[^a-z]r[^a-z]/
code << 'float th = atan2(y,x);' if ast =~ /[^a-z]th[^a-z]/
code << "return #{ast}>0;"
func_name="font_#{a=~/[a-z0-9]/?a:"c#{a.ord}"}"
$names << func_name
puts "int #{func_name}(float x,float y){#{code}}"
end
puts '#include<stdio.h>'
eval File.read('shape.rb').gsub(/Math/, 'M')
puts <<~MATH
#define M_PI #{Math::PI}
#define M_E #{Math::E}
double sqrt(double x){
if (x==0) return 0;
double a=1;
for(int i=0;i<20;i++)a-=(a*a-x)/2/a;
return a;
}
double cos(double x){
if (x==0) return 1;
return sin(x+M_PI/2);
}
double sin(double x){
if (x==0) return 0;
double x0=x;
while (x<-M_PI) x+=(int)(1-x/2/M_PI)*2*M_PI;
while (x>M_PI) x-=(int)(1+x/2/M_PI)*2*M_PI;
double a=x;
double b=x;
for(int i=0;i<20;i++){
b*=-x*x/(2*i+2)/(2*i+3);
a+=b;
}
if (x0 == M_PI/2 && a != 1) {
return a;
}
return a;
}
double tan(double x){return sin(x)/cos(x);}
double exp(double x){
int ix=(int)x;
x-=ix;
double a=1;
double b=1;
for(int i=0;i<20;i++){
b*=x/(i+1);
a+=b;
}
int n=ix<0?-ix:ix;
double c=ix<0?1/M_E:M_E;
for(int i=0;i<n;i++)a*=c;
return a;
}
double atan(double x){
if (x<0) return -atan(-x);
if (x>1) return M_PI/2 - atan(1/x);
if (x>0.41421357) {
return M_PI/4-atan((1-x)/(1+x));
}
double a=x;
double b=x;
for(int i=0;i<20;i++){
b*=-x*x*(i+1)/(i+3);
a+=b;
}
return a;
}
double atan2(double y, double x){
if (y==0) return x<0 ? M_PI : 0;
if (x==0) return y<0 ? -M_PI/2 : M_PI/2;
if (x>0) return atan(y/x);
return atan(y/x)+(y>0 ? M_PI : -M_PI);
}
double log_e(double x) {
if (x<1) return -log_e(1/x);
double en = M_E;
int n = 0;
double m=0;
double ens[100];
ens[0]=en;
while(en*en<x) {en*=en;ens[++n]=en;}
while(n>=0) {
if (x > ens[n]) { x /= ens[n]; m += 1<<n; }
n--;
}
x-=1;
double a=x;
for(int i=0;i<20;i++){
m += i%2 ? -a/(i+1) : a/(i+1);
a *= x;
}
return m;
}
double pow(double x,double dn){
int n=dn;
if (n!=dn) return exp(dn*log_e(x));
if(n<0) return pow(1/x, -n);
double a=1;
double b=x;
while(n){
if (n&1) a*=b;
b*=b;
n>>=1;
}
return a;
}
MATH
puts 'int main(){'
$names.each do |func_name|
puts <<~C
for(int y=0;y<64;printf("\\n"),y++)for(int x=0;x<64;x++){
printf("%c",#{func_name}(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\\n");
C
end
puts '}'
#include<stdio.h>
int font_c33(float x,float y){return (((0.03125-pow(x, 2))-pow((y+0.75), 2))*(((4.0*pow(x, 2))+pow((y-0.3333333333333333), 6))-0.125))>0;}
int font_c34(float x,float y){return ((1.0-((((16.0*pow(x, 4))+(0.015625/pow(x, 2)))-0.25)*pow(16, (1.0-y))))-pow(((4.0*y)-3.0), 2))>0;}
int font_c35(float x,float y){return ((0.25-pow(((pow(((3.0*x)-(y/2.0)), 2)+(4.0*pow(y, 2)))/5.0), 8))-pow((cos(((6.0*x)-y))*cos((4.0*y))), 2))>0;}
int font_c36(float x,float y){float r = sqrt(x*x+y*y);float th = atan2(y,x);return (0.25-((((32.0*pow((r*cos((((th+(8.0*r))-(4.0*pow(r, 2)))-3.5))), 2))+pow((r*sin((((th+(8.0*r))-(4.0*pow(r, 2)))-3.5))), 4))-0.5)*(((32.0*pow(x, 2))+((4.0*pow(y, 2))*pow((pow(y, 2)-0.5), 4)))-0.03125)))>0;}
int font_c37(float x,float y){return (((pow(((pow(((6.0*x)+2.0), 2)+pow(((6.0*y)-3.0), 2))-2.0), 2)-2.0)*(pow(((pow(((6.0*x)-2.0), 2)+pow(((6.0*y)+3.0), 2))-2.0), 2)-2.0))*((3.0-pow(((12.0*x)-(8.0*y)), 2))-pow((y+((3.0*x)/4.0)), 8)))>0;}
int font_c38(float x,float y){return (((((((1.0-(13.0/(16.0+(100.0*pow(y, 2)))))-(0.0125/(pow((x+0.0625), 2)+pow((y-0.4375), 2))))-(1.0/((30.0*pow((x-(((5.0*y)+1.0)/15.0)), 2))+(50.0*pow((y+0.4), 2)))))-((3.0*pow((x+((1.0-y)/8.0)), 2))*exp((y/2.0))))-(2.0*pow(y, 4)))+(2.0/((1.0+(10.0*pow(((x-y)-1.0), 4)))+(80.0*pow((x+y), 2)))))+(2.0/((1.0+(80.0*pow(((x-y)-0.75), 2)))+(10.0*pow(((y+x)-0.75), 4)))))>0;}
int font_c39(float x,float y){return ((1.0-((24.0*pow(x, 2))*pow(8, (1.0-y))))-pow(((4.0*y)-3.0), 2))>0;}
int font_c40(float x,float y){return ((1.0-pow((((8.0*x)-(4.0*pow(y, 2)))+2.0), 2))-pow(y, 16))>0;}
int font_c41(float x,float y){return ((1.0-pow((((8.0*x)+(4.0*pow(y, 2)))-2.0), 2))-pow(y, 16))>0;}
int font_c42(float x,float y){float r = sqrt(x*x+y*y);float th = atan2(y,x);return ((3.0-cos((6.0*th)))-(6.0*r))>0;}
int font_c43(float x,float y){float r = sqrt(x*x+y*y);float th = atan2(y,x);return (((2.0+cos((4.0*th)))+(cos((8.0*th))/6.0))-(5.0*r))>0;}
int font_c44(float x,float y){return (((0.03125-pow(x, 2))-pow((y+0.75), 2))-(((128.0*x)*y)/((1.0+pow((128.0*x), 2))+pow(((64.0*y)+72.0), 2))))>0;}
int font_c45(float x,float y){return ((1.0-(6.0*pow(x, 4)))-(40.0*pow(y, 2)))>0;}
int font_c46(float x,float y){return ((0.03125-pow(x, 2))-pow((y+0.75), 2))>0;}
int font_c47(float x,float y){return ((8.0-(64.0*pow((y-(2.0*x)), 2)))-pow((y+(x/2.0)), 8))>0;}
int font_c58(float x,float y){return ((-((0.03125-pow(x, 2))-pow((y+0.75), 2)))*((0.03125-pow(x, 2))-pow((y-0.5), 2)))>0;}
int font_c59(float x,float y){return ((-(((0.03125-pow(x, 2))-pow((y+0.75), 2))-(((128.0*x)*y)/((1.0+pow((128.0*x), 2))+pow(((64.0*y)+72.0), 2)))))*((0.03125-pow(x, 2))-pow((y-0.5), 2)))>0;}
int font_c60(float x,float y){return ((1.0-pow((((4.0*x)+3.0)-((3.0*sqrt((1.0+(32.0*pow(y, 2)))))/2.0)), 2))-(64.0*pow(y, 8)))>0;}
int font_c61(float x,float y){return (((1.0-(3.0*pow(x, 4)))-(10.0*pow(y, 4)))-(0.05/pow(y, 2)))>0;}
int font_c62(float x,float y){return ((1.0-pow((((4.0*x)-3.0)+((3.0*sqrt((1.0+(32.0*pow(y, 2)))))/2.0)), 2))-(64.0*pow(y, 8)))>0;}
int font_c63(float x,float y){return ((((20.0-(1.0/pow(((2.0*pow(((x-(y/2.0))+0.3333333333333333), 2))+pow(y, 2)), 2)))+(1.0/pow((pow(x, 2)+pow((y+0.75), 2)), 2)))+(0.125/pow(((4.0*pow(x, 2))+pow((y+0.25), 2)), 2)))-pow((((24.0*pow(x, 2))+(48.0*pow((y-0.3333333333333333), 2)))-6.0), 2))>0;}
int font_c64(float x,float y){return ((((2.0/(1.0+(2.0*pow((((8.0*pow(x, 2))+(8.0*pow(y, 4)))-2.0), 4))))+(1.0/(1.0+pow((((12.0*pow((x-0.2), 2))+pow(((2.0*y)+0.25), 4))-1.0), 4))))+(4.0/(pow(((4.0*x)-1.0), 4)+pow(((24.0*y)+16.0), 2))))-1.0)>0;}
int font_c91(float x,float y){return (((1.0-(128.0/((1.0+(16.0*pow(((2.0*x)-1.0), 8)))+pow((2.0*y), 16))))-(32.0*pow(x, 4)))-(2.0*pow(y, 8)))>0;}
int font_c92(float x,float y){return ((8.0-(64.0*pow((y+(2.0*x)), 2)))-pow((y-(x/2.0)), 8))>0;}
int font_c93(float x,float y){return (((1.0-(128.0/((1.0+(16.0*pow(((2.0*x)+1.0), 8)))+pow((2.0*y), 16))))-(32.0*pow(x, 4)))-(2.0*pow(y, 8)))>0;}
int font_c94(float x,float y){return ((1.0-pow((((6.0*y)-5.0)+sqrt((1.0+(32.0*pow(x, 2))))), 2))-(64.0*pow(x, 8)))>0;}
int font_c95(float x,float y){return ((1.0-(6.0*pow(x, 4)))-(40.0*pow((y+0.8), 2)))>0;}
int font_c96(float x,float y){return ((0.25-pow((((2.0*x)-y)+0.8333333333333334), 4))-(4.0*pow((((2.0*y)-1.6666666666666667)+x), 2)))>0;}
int font_c123(float x,float y){return ((1.0-pow(((((8.0*x)+(2.0*pow(y, 2)))-(3.0*pow(y, 4)))+(3.0/(2.0+(64.0*pow(y, 2))))), 2))-pow(y, 16))>0;}
int font_c124(float x,float y){return ((4.0-(256.0*pow(x, 2)))-pow(y, 16))>0;}
int font_c125(float x,float y){return ((1.0-pow(((((8.0*x)-(2.0*pow(y, 2)))+(3.0*pow(y, 4)))-(3.0/(2.0+(64.0*pow(y, 2))))), 2))-pow(y, 16))>0;}
int font_c126(float x,float y){return ((0.03125-pow(x, 8))-pow((y+(sin((6.0*x))/8.0)), 2))>0;}
int font_c0(float x,float y){return (1.0-pow((((8.0*pow((x-(y/8.0)), 2))+(4.0*pow(y, 2)))-2.6666666666666665), 2))>0;}
int font_c1(float x,float y){return ((1.0-(32.0*pow((x-(y/8.0)), 2)))-(2.0*pow(y, 8)))>0;}
int font_c2(float x,float y){return (((0.03125-exp((((-4.0*x)-(2.0*y))-4.0)))+(1.0/((2.0*pow((x-0.0), 8))+(4.0*pow(((4.0*y)+3.0), 2)))))-pow(((pow((x+((1.0-y)/2.0)), 2)+pow(y, 2))-0.5), 2))>0;}
int font_c3(float x,float y){return ((((((1.0-((8.0*pow(x, 2))/(1.0+(64.0*pow(y, 2)))))-(1.0/((20.0*pow((x+((1.0-y)/8.0)), 2))+(32.0*pow((y-0.4), 2)))))-(1.0/((20.0*pow((x+((1.0-y)/8.0)), 2))+(20.0*pow((y+0.4), 2)))))-((exp(((y/2.0)-(4.0*x)))-pow(y, 2))/8.0))-(2.0*pow((x+((1.0-y)/8.0)), 2)))-pow(y, 4))>0;}
int font_c4(float x,float y){return ((1.0-(1.0/(pow((x-0.125), 2)+pow((((4.0*y)-3.0)/2.0), 2))))-(((((((12.0*pow((x-(y/3.0)), 2))+(2.0*y))-0.6666666666666666)+pow(((2.0*y)-0.6666666666666666), 4))-0.5)*(((((12.0*pow((x-(y/3.0)), 2))+(3.0*y))-1.0)+(16.0*pow((y-0.3333333333333333), 4)))-2.0))*((pow((((8.0*x)-3.0)-(y/2.0)), 2)+pow(((2.0*y)+1.0), 4))-1.0)))>0;}
int font_c5(float x,float y){return (((1.0+(1.0/(pow(((2.0*x)-1.0), 4)+pow(((5.0*y)-4.0), 2))))-pow(((x/4.0)+y), 4))-pow(((((8.0*x)-(2.0*y))+2.0)+((4.0*sin((((x+(4.0*y))*5.0)/6.0)))/(1.0+exp(((4.0*x)+(16.0*y)))))), 2))>0;}
int font_c6(float x,float y){return (((4.0/(1.0+(32.0*pow(((pow(x, 2)+pow((y+0.5), 2))-0.2), 2))))+(4.0/((1.0+(32.0*pow(((x+((1.0-y)/3.0))-(pow(y, 2)/2.0)), 2)))+(4.0*pow((y-0.5), 4)))))-3.0)>0;}
int font_c7(float x,float y){return ((2.0-pow((((((4.0*x)+(4.0*y))-1.0)+((8.0*(x-y))/3.0))-(3.0*cos(((((12.0*x)-(12.0*y))+3.0)/5.0)))), 2))-pow(((x-y)+0.25), 4))>0;}
int font_c8(float x,float y){return (((((1.0-(1.0/(4.0+(64.0*pow(y, 2)))))-(1.0/((20.0*pow((x-(y/8.0)), 2))+(32.0*pow((y-0.4), 2)))))-(1.0/((16.0*pow((x-(y/8.0)), 2))+(24.0*pow((y+0.4), 2)))))-((2.0*pow((x-(y/8.0)), 2))*exp((y/4.0))))-pow(y, 4))>0;}
int font_c9(float x,float y){return (((4.0/(1.0+(32.0*pow(((pow(x, 2)+pow((y-0.5), 2))-0.2), 2))))+(4.0/((1.0+(32.0*pow(((x-((1.0+y)/3.0))+(pow(y, 2)/2.0)), 2)))+(4.0*pow((y+0.5), 4)))))-3.0)>0;}
int font_a(float x,float y){return (((0.5+(32.0/(1.0+(512.0*(pow(x, 4)+pow((y+0.25), 2))))))-pow(x, 6))-pow((((1.5-(2.0*y))-(8.0*pow(x, 2)))+(5.0*pow(x, 4))), 2))>0;}
int font_b(float x,float y){return (((2.0-(1.0/(pow(cos((4.0*y)), 2)+(16.0*pow(x, 4)))))-(8.0*pow((x-(((sqrt((1.0-cos((7.0*y))))-1.0)/5.0)/(1.0+exp((-8.0*x))))), 4)))-pow(y, 4))>0;}
int font_c(float x,float y){float th = atan2(y,x);return ((0.5-pow(((1.0+cos(th))/2.0), 16))-pow((((4.0*pow(x, 2))+(3.0*pow(y, 2)))-2.0), 2))>0;}
int font_d(float x,float y){return (0.08333333333333333-pow(((pow(y, 2)+pow(((((3.0*x)/2.0)+(pow(y, 2)/2.0))+(pow(y, 4)/16.0)), 2))-0.75), 2))>0;}
int font_e(float x,float y){return (((2.0-(6.0*pow(x, 4)))-pow(y, 4))-((4.0*(1.0-pow(cos((4.0*y)), 4)))/(1.0+exp(((-16.0*x)-8.0)))))>0;}
int font_f(float x,float y){return ((((2.0-(8.0*pow(x, 4)))-(2.0*pow(y, 4)))+pow(y, 2))-(((2.0*(1.0-pow(cos((pow(y, 2)+(3.0*y))), 6)))*(2.0-y))/(1.0+exp(((-16.0*x)-6.0)))))>0;}
int font_g(float x,float y){float th = atan2(y,x);return (((0.5-pow(((1.0+cos(th))/2.0), 16))+(2.0/((1.0+(4.0*pow(((4.0*x)-1.0), 8)))+(2.0*pow(((8.0*y)+2.0), 4)))))-pow(((pow(((2.0*x)+(1.0/((4.0+(4.0*pow(((2.0*x)-1.0), 4)))+pow(((4.0*y)+1.0), 4)))), 2)+(3.0*pow(y, 2)))-2.0), 2))>0;}
int font_h(float x,float y){return ((-5.0*(((16.0*pow(x, 8))+pow(y, 8))-1.0))-(9.0/(pow(((5.0*x)/2.0), 16)+(2.0*pow((pow(y, 2)-1.0), 4)))))>0;}
int font_i(float x,float y){return ((2.0-pow((8.0*x), 4))-pow(y, 8))>0;}
int font_j(float x,float y){return ((0.16666666666666666-exp(((8.0*y)-(10.0/(1.0+exp((-16.0*x)))))))-pow((((3.0*pow(x, 2))+(6.0*pow(((y/2.0)-0.25), 4)))-1.0), 2))>0;}
int font_k(float x,float y){return ((0.125-(64.0*pow(x, 8)))-((pow(((x+0.125)-sqrt((0.015625+pow(y, 2)))), 2)-0.03125)*((pow(((8.0*x)+3.0), 2)+pow(y, 8))-1.0)))>0;}
int font_l(float x,float y){return (((1.0-(16.0*pow(x, 8)))-pow(y, 8))-(64.0/(pow(((2.0*x)-1.0), 8)+pow((y-1.0), 8))))>0;}
int font_m(float x,float y){return (((1.0-(12.0/((4.0+(4.0*pow((2.0*x), 8)))+pow(((y-2.0)+((4.0+(6.0*pow(x, 4)))/(1.0+(2.0*pow(x, 2))))), 8))))-(8.0*pow(x, 8)))-pow(((y+((4.0+(6.0*pow(x, 4)))/(1.0+(2.0*pow(x, 2)))))-2.75), 8))>0;}
int font_n(float x,float y){return (((((1.0/(4.0+(64.0*pow(((2.0*x)+y), 2))))-(64.0*pow(x, 8)))+(8.0*pow(x, 4)))-pow((y-(x/8.0)), 8))-0.125)>0;}
int font_o(float x,float y){return (0.25-pow((((3.0*pow(x, 2))+(2.0*pow(y, 4)))-1.0), 2))>0;}
int font_p(float x,float y){return (1.0-((pow((((8.0*pow(x, 2))+(2.0*pow(((2.0*y)-1.0), 2)))-2.0), 2)-1.0)*((pow(((8.0*x)+4.0), 4)+pow(y, 8))-1.0)))>0;}
int font_q(float x,float y){return ((0.25+(((2.0+(4.0*x))/(1.0+pow((((8.0*y)-(2.0*cos((3.0*x))))+5.0), 8)))/(1.0+exp(((-32.0*x)-10.0)))))-pow((((3.0*pow(x, 2))+(2.0*pow(y, 4)))-1.0), 2))>0;}
int font_r(float x,float y){return ((-(((atan(((3.0*pow(x, 2))+(3.0*pow((y-0.5), 2))))*atan((pow(((8.0*x)+4.0), 4)+pow(y, 8))))*atan((pow((((8.0*x)-1.0)+(2.0*y)), 4)+(4.0*pow((y+0.25), 4)))))-2.0))*(((8.0*pow(x, 2))+(2.0*pow(((2.0*y)-1.0), 2)))-1.0))>0;}
int font_s(float x,float y){return ((0.16666666666666666-pow(x, 4))-pow((pow((x-(y/2.0)), 3)+((2.0*(x+y))*(1.0-pow((y+(x/4.0)), 2)))), 2))>0;}
int font_t(float x,float y){return (1.0-((((4.0*pow(x, 8))+(3.0*pow(((4.0*y)-3.0), 2)))-1.0)*(((32.0*pow(x, 2))+(3.0*pow((y+0.25), 8)))-1.0)))>0;}
int font_u(float x,float y){return ((0.16666666666666666-exp(((16.0*y)-16.0)))-pow((((3.0*pow(x, 2))+(5.0*pow(((y/2.0)-0.25), 4)))-1.0), 2))>0;}
int font_v(float x,float y){return ((0.5-pow(x, 6))-pow(((((2.0*y)+1.5)-(8.0*pow(x, 2)))+(5.0*pow(x, 4))), 2))>0;}
int font_w(float x,float y){return ((1.0-pow(x, 8))-pow(((((3.0*y)-(2.0*cos((6.0*x))))-(3.0*pow(x, 2)))+(2.0*pow(x, 4))), 2))>0;}
int font_x(float x,float y){float r = sqrt(x*x+y*y);float th = atan2(y,x);return ((3.0*atan(((2.0+pow(tan(((2.0*th)-(sin((2.0*th))/4.0))), 2))/6.0)))-(4.0*r))>0;}
int font_y(float x,float y){float r = sqrt(x*x+y*y);float th = atan2(y,x);return ((3.0*atan(((2.0+pow(tan((((((3.0*th)/2.0)+0.7853981633974483)-(cos(th)/2.0))-(sin((2.0*th))/4.0))), 2))/8.0)))-(4.0*r))>0;}
int font_z(float x,float y){return (((((1.0/(4.0+(128.0*pow((x-y), 2))))-(2.0*pow(y, 8)))+((5.0*pow(y, 4))/4.0))-pow((x+(y/8.0)), 8))-0.125)>0;}
#define M_PI 3.141592653589793
#define M_E 2.718281828459045
double sqrt(double x){
if (x==0) return 0;
double a=1;
for(int i=0;i<20;i++)a-=(a*a-x)/2/a;
return a;
}
double cos(double x){
if (x==0) return 1;
return sin(x+M_PI/2);
}
double sin(double x){
if (x==0) return 0;
double x0=x;
while (x<-M_PI) x+=(int)(1-x/2/M_PI)*2*M_PI;
while (x>M_PI) x-=(int)(1+x/2/M_PI)*2*M_PI;
double a=x;
double b=x;
for(int i=0;i<20;i++){
b*=-x*x/(2*i+2)/(2*i+3);
a+=b;
}
if (x0 == M_PI/2 && a != 1) {
return a;
}
return a;
}
double tan(double x){return sin(x)/cos(x);}
double exp(double x){
int ix=(int)x;
x-=ix;
double a=1;
double b=1;
for(int i=0;i<20;i++){
b*=x/(i+1);
a+=b;
}
int n=ix<0?-ix:ix;
double c=ix<0?1/M_E:M_E;
for(int i=0;i<n;i++)a*=c;
return a;
}
double atan(double x){
if (x<0) return -atan(-x);
if (x>1) return M_PI/2 - atan(1/x);
if (x>0.41421357) {
return M_PI/4-atan((1-x)/(1+x));
}
double a=x;
double b=x;
for(int i=0;i<20;i++){
b*=-x*x*(i+1)/(i+3);
a+=b;
}
return a;
}
double atan2(double y, double x){
if (y==0) return x<0 ? M_PI : 0;
if (x==0) return y<0 ? -M_PI/2 : M_PI/2;
if (x>0) return atan(y/x);
return atan(y/x)+(y>0 ? M_PI : -M_PI);
}
double log_e(double x) {
if (x<1) return -log_e(1/x);
double en = M_E;
int n = 0;
double m=0;
double ens[100];
ens[0]=en;
while(en*en<x) {en*=en;ens[++n]=en;}
while(n>=0) {
if (x > ens[n]) { x /= ens[n]; m += 1<<n; }
n--;
}
x-=1;
double a=x;
for(int i=0;i<20;i++){
m += i%2 ? -a/(i+1) : a/(i+1);
a *= x;
}
return m;
}
double pow(double x,double dn){
int n=dn;
if (n!=dn) return exp(dn*log_e(x));
if(n<0) return pow(1/x, -n);
double a=1;
double b=x;
while(n){
if (n&1) a*=b;
b*=b;
n>>=1;
}
return a;
}
int main(){
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c33(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c34(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c35(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c36(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c37(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c38(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c39(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c40(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c41(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c42(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c43(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c44(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c45(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c46(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c47(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c58(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c59(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c60(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c61(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c62(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c63(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c64(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c91(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c92(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c93(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c94(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c95(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c96(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c123(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c124(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c125(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c126(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c0(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c1(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c2(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c3(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c4(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c5(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c6(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c7(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c8(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c9(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_a(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_b(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_c(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_d(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_e(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_f(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_g(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_h(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_i(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_j(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_k(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_l(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_m(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_n(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_o(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_p(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_q(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_r(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_s(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_t(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_u(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_v(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_w(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_x(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_y(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
for(int y=0;y<64;printf("\n"),y++)for(int x=0;x<64;x++){
printf("%c",font_z(2.0*x/64-1, 1-2.0*y/64)?'#':' ');
}
for(int i=0;i<4;i++)printf("\n");
}
register('!'){|x,y|(1/32.0-x**2-(y+3/4.0)**2)*(4*x**2+(y-1/3.0)**6-1/8.0)}
register('"'){|x,y|1-(16*x**4+1/64.0/x**2-1/4.0)*16**(1-y)-(4*y-3)**2}
register('#'){|x,y|1/4.0-(((3*x-y/2)**2+4*y**2)/5)**8-(Math.cos(6*x-y)*Math.cos(4*y))**2}
register('$'){|x,y,r,th|1/4.0-(32*(r*Math.cos(th+8*r-4*r**2-7/2.0))**2+(r*Math.sin(th+8*r-4*r**2-7/2.0))**4-1/2.0)*(32*x**2+4*y**2*(y**2-1/2.0)**4-1/32.0)}
register('%'){|x,y|(((6*x+2)**2+(6*y-3)**2-2)**2-2)*(((6*x-2)**2+(6*y+3)**2-2)**2-2)*(3-(12*x-8*y)**2-(y+3*x/4)**8)}
register('&'){|x,y|1-13/(16+100*y**2)-1/80.0/((x+1/16.0)**2+(y-7/16.0)**2)-1/(30*(x-(5*y+1)/15)**2+50*(y+2/5.0)**2)-3*(x+(1-y)/8)**2*Math.exp(y/2)-2*y**4+2/(1+10*(x-y-1)**4+80*(x+y)**2)+2/(1+80*(x-y-3/4.0)**2+10*(y+x-3/4.0)**4)}
register("'"){|x,y|1-24*x**2*8**(1-y)-(4*y-3)**2}
register('('){|x,y|1-(8*x-4*y**2+2)**2-y**16}
register(')'){|x,y|1-(8*x+4*y**2-2)**2-y**16}
register('*'){|x,y,r,th|3-Math.cos(6*th)-6*r}
register('+'){|x,y,r,th|2+Math.cos(4*th)+Math.cos(8*th)/6-5*r}
register(','){|x,y|1/32.0-x**2-(y+3/4.0)**2-128*x*y/(1+(128*x)**2+(64*y+72)**2)}
register('-'){|x,y|1-6*x**4-40*y**2}
register('.'){|x,y|1/32.0-x**2-(y+3/4.0)**2}
register('/'){|x,y|8-64*(y-2*x)**2-(y+x/2)**8}
register(':'){|x,y|-(1/32.0-x**2-(y+3/4.0)**2)*(1/32.0-x**2-(y-1/2.0)**2)}
register(';'){|x,y|-(1/32.0-x**2-(y+3/4.0)**2-128*x*y/(1+(128*x)**2+(64*y+72)**2))*(1/32.0-x**2-(y-1/2.0)**2)}
register('<'){|x,y|1-(4*x+3-3*Math.sqrt(1+32*y**2)/2)**2-64*y**8}
register('='){|x,y|1-3*x**4-10*y**4-1/20.0/y**2}
register('>'){|x,y|1-(4*x-3+3*Math.sqrt(1+32*y**2)/2)**2-64*y**8}
register('?'){|x,y|20-1/(2*(x-y/2+1/3.0)**2+y**2)**2+1/(x**2+(y+3/4.0)**2)**2+1/8.0/(4*x**2+(y+1/4.0)**2)**2-(24*x**2+48*(y-1/3.0)**2-6)**2}
register('@'){|x,y|2/(1+2*(8*x**2+8*y**4-2)**4)+1/(1+(12*(x-1/5.0)**2+(2*y+1/4.0)**4-1)**4)+4/((4*x-1)**4+(24*y+16)**2)-1}
register('['){|x,y|1-128/(1+16*(2*x-1)**8+(2*y)**16)-32*x**4-2*y**8}
register('\\'){|x,y|8-64*(y+2*x)**2-(y-x/2)**8}
register(']'){|x,y|1-128/(1+16*(2*x+1)**8+(2*y)**16)-32*x**4-2*y**8}
register('^'){|x,y|1-(6*y-5+Math.sqrt(1+32*x**2))**2-64*x**8}
register('_'){|x,y|1-6*x**4-40*(y+4/5.0)**2}
register('`'){|x,y|1/4.0-(2*x-y+5/6.0)**4-4*(2*y-5/3.0+x)**2}
register('{'){|x,y|1-(8*x+2*y**2-3*y**4+3/(2+64*y**2))**2-y**16}
register('|'){|x,y|4-256*x**2-y**16}
register('}'){|x,y|1-(8*x-2*y**2+3*y**4-3/(2+64*y**2))**2-y**16}
register('~'){|x,y|1/32.0-x**8-(y+Math.sin(6*x)/8)**2}
register(0){|x,y|1-(8*(x-y/8)**2+4*y**2-8/3.0)**2}
register(1){|x,y|1-32*(x-y/8)**2-2*y**8}
register(2){|x,y|1/32.0-Math.exp(-4*x-2*y-4)+1/(2*(x-1/8)**8+4*(4*y+3)**2)-((x+(1-y)/2)**2+y**2-1/2.0)**2}
register(3){|x,y|1-8*x**2/(1+64*y**2)-1/(20*(x+(1-y)/8)**2+32*(y-2/5.0)**2)-1/(20*(x+(1-y)/8)**2+20*(y+2/5.0)**2)-(Math.exp(y/2-4*x)-y**2)/8-2*(x+(1-y)/8)**2-y**4}
register(4){|x,y|1-1/((x-1/8.0)**2+((4*y-3)/2)**2)-(12*(x-y/3)**2+2*y-2/3.0+(2*y-2/3.0)**4-1/2.0)*(12*(x-y/3)**2+3*y-1+16*(y-1/3.0)**4-2)*((8*x-3-y/2)**2+(2*y+1)**4-1)}
register(5){|x,y|1+1/((2*x-1)**4+(5*y-4)**2)-(x/4+y)**4-(8*x-2*y+2+4*Math.sin((x+4*y)*5/6)/(1+Math.exp(4*x+16*y)))**2}
register(6){|x,y|4/(1+32*(x**2+(y+1/2.0)**2-1/5.0)**2)+4/(1+32*(x+(1-y)/3-y**2/2)**2+4*(y-1/2.0)**4)-3}
register(7){|x,y|2-(4*x+4*y-1+8*(x-y)/3-3*Math.cos((12*x-12*y+3)/5))**2-(x-y+1/4.0)**4}
register(8){|x,y|1-1/(4+64*y**2)-1/(20*(x-y/8)**2+32*(y-2/5.0)**2)-1/(16*(x-y/8)**2+24*(y+2/5.0)**2)-2*(x-y/8)**2*Math.exp(y/4)-y**4}
register(9){|x,y|4/(1+32*(x**2+(y-1/2.0)**2-1/5.0)**2)+4/(1+32*(x-(1+y)/3+y**2/2)**2+4*(y+1/2.0)**4)-3}
register(:a){|x,y|1/2.0+32/(1+512*(x**4+(y+1/4.0)**2))-x**6-(3/2.0-2*y-8*x**2+5*x**4)**2}
register(:b){|x,y|2-1/(Math.cos(4*y)**2+16*x**4)-8*(x-(Math.sqrt(16/16-Math.cos(7*y))-1)/5/(1+Math.exp(-8*x)))**4-y**4}
register(:c){|x,y,r,th|1/2.0-((1+Math.cos(th))/2)**16-(4*x**2+3*y**2-2)**2}
register(:d){|x,y|1/12.0-(y**2+(3*x/2+y**2/2+y**4/16)**2-3/4.0)**2}
register(:e){|x,y|2-6*x**4-y**4-4*(1-Math.cos(4*y)**4)/(1+Math.exp(-16*x-8))}
register(:f){|x,y|2-8*x**4-2*y**4+y**2-2*(1-Math.cos(y**2+3*y)**6)*(2-y)/(1+Math.exp(-16*x-6))}
register(:g){|x,y,r,th|1/2.0-((1+Math.cos(th))/2)**16+2/(1+4*(4*x-1)**8+2*(8*y+2)**4)-((2*x+1/(4+4*(2*x-1)**4+(4*y+1)**4))**2+3*y**2-2)**2}
register(:h){|x,y|-5*(16*x**8+y**8-1)-9/((5*x/2)**16+2*(y**2-1)**4)}
register(:i){|x,y|2-(8*x)**4-y**8}
register(:j){|x,y|1/6.0-Math.exp(8*y-10/(1+Math.exp(-16*x)))-(3*x**2+6*(y/2-1/4.0)**4-1)**2}
register(:k){|x,y|1/8.0-64*x**8-((x+1/8.0-Math.sqrt(1/64.0+y**2))**2-1/32.0)*((8*x+3)**2+y**8-1)}
register(:l){|x,y|1-16*x**8-y**8-64.0/((2*x-1)**8+(y-1)**8)}
register(:m){|x,y|1-12/(4+4*(2*x)**8+(y-2+(4+6*x**4)/(1+2*x**2))**8)-8*x**8-(y+(4+6*x**4)/(1+2*x**2)-11/4.0)**8}
register(:n){|x,y|1/(4+64*(2*x+y)**2)-64*x**8+8*x**4-(y-x/8)**8-1/8.0}
register(:o){|x,y|1/4.0-(3*x**2+2*y**4-1)**2}
register(:p){|x,y|1-((8*x**2+2*(2*y-1)**2-2)**2-1)*((8*x+4)**4+y**8-1)}
register(:q){|x,y|1/4.0+(2+4*x)/(1+(8*y-2*Math.cos(3*x)+5)**8)/(1+Math.exp(-32*x-10))-(3*x**2+2*y**4-1)**2}
register(:r){|x,y|-(Math.atan(3*x**2+3*(y-1/2.0)**2)*Math.atan((8*x+4)**4+y**8)*Math.atan((8*x-1+2*y)**4+4*(y+1/4.0)**4)-2)*(8*x**2+2*(2*y-1)**2-1)}
register(:s){|x,y|1/6.0-x**4-((x-y/2)**3+2*(x+y)*(1-(y+x/4)**2))**2}
register(:t){|x,y|1-(4*x**8+3*(4*y-3)**2-1)*(32*x**2+3*(y+1/4.0)**8-1)}
register(:u){|x,y|1/6.0-Math.exp(16*y-16)-(3*x**2+5*(y/2-1/4.0)**4-1)**2}
register(:v){|x,y|1/2.0-x**6-(2*y+3/2.0-8*x**2+5*x**4)**2}
register(:w){|x,y|1-x**8-(3*y-2*Math.cos(6*x)-3*x**2+2*x**4)**2}
register(:x){|x,y,r,th|3*Math.atan((2+Math.tan(2*th-Math.sin(2*th)/4)**2)/6)-4*r}
register(:y){|x,y,r,th|3*Math.atan((2+Math.tan(3*th/2+Math::PI/4-Math.cos(th)/2-Math.sin(2*th)/4)**2)/8)-4*r}
register(:z){|x,y|1/(4+128*(x-y)**2)-2*y**8+5*y**4/4-(x+y/8)**8-1/8.0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment