Wolfram Language 14.1.0 Engine for Microsoft Windows (64-bit) での実行結果
Integrate[y^2 * 2 * Sqrt[r^2-y^2],{y,-r,r}, Assumptions -> r>0] // TeXForm
! original: https://github.com/vnglst/pong-wars | |
! gfortran -O3 -Wall -std=f2008 main.f90 && time ./a.out && gnuplot ./score.plt | |
program pong_wars | |
use , intrinsic :: iso_fortran_env | |
implicit none | |
# The Ziggurat Method for generating random variables - Marsaglia and Tsang | |
# Paper and reference code: http://www.jstatsoft.org/v05/i08/ | |
module ZigguratTable | |
function compute_core( table_size::Int, pdf0::T, r::T, pdf::Core.Function, integral_pdf::Core.Function, inverse_pdf::Core.Function ) where { T <: Core.AbstractFloat } | |
v = ( r * pdf( r ) ) + integral_pdf( r ) | |
x_ref = r | |
x_new = Base.zero( T ) |
#include <array> | |
#include <random> | |
#include <immintrin.h> | |
#ifndef PRNG_HPP_ | |
#define PRNG_HPP_ | |
namespace prng | |
{ | |
template <typename T> |
Wolfram Language 14.1.0 Engine for Microsoft Windows (64-bit) での実行結果
Integrate[y^2 * 2 * Sqrt[r^2-y^2],{y,-r,r}, Assumptions -> r>0] // TeXForm