/usr/share/doc/ruby-gsl/examples/sf/psi.rb is in ruby-gsl 2.1.0.3+dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | #!/usr/bin/env ruby
require("gsl")
IO.popen("graph -T X -C -g 3 -X x -Y 'psi(x)' --toggle-rotate-y-label -x -3 5 -y -5 15 -L 'Red: Digamma, Green: Trigamma'", "w") do |io|
x = -2.999
while x < -2
y = GSL::Sf::psi(x)
io.printf("%e %e\n", x, y)
x += 0.01
end
x = -1.999
while x < -1
y = GSL::Sf::psi(x)
io.printf("%e %e\n", x, y)
x += 0.01
end
x = -0.999
while x < 0
y = GSL::Sf::psi(x)
io.printf("%e %e\n", x, y)
x += 0.01
end
x = 0.001
while x < 5
y = GSL::Sf::psi(x)
io.printf("%e %e\n", x, y)
x += 0.1
end
io.printf("\n")
x = -2.999
while x < -2
y = GSL::Sf::psi_1_e(x).val
io.printf("%e %e\n", x, y)
x += 0.01
end
x = -1.999
while x < -1
y = GSL::Sf::psi_1_e(x).val
io.printf("%e %e\n", x, y)
x += 0.01
end
x = -0.999
while x < 0
y = GSL::Sf::psi_1_e(x).val
io.printf("%e %e\n", x, y)
x += 0.01
end
x = 0.001
while x < 5
y = GSL::Sf::psi_1_e(x).val
io.printf("%e %e\n", x, y)
x += 0.1
end
end
|