<?php
$jumlah_data=$_GET['jumlah_data'];
$jumlah_iterasi=$_GET['jumlah_iterasi'];
$terkaan_awal = $_GET['terkaan_awal'];
$data = $_GET['data'];
$hasil = $_GET['hasil'];
$array_terkaan_awal = explode(';', $terkaan_awal);
$array_hasil = explode(';', $hasil);
$baris_data = explode(';', $data);
$array ;
error_reporting(0);
$array_keluaran;
$hasil_temp;
$temp = 0;
$pembagi_temp;
$hasil = array();
function arrayEmpty($arr){
if(!is_array($arr)){
return "tidak_ada";
}else{
return "ada";
}
}
for($j=0;$j < count($baris_data);$j++){
$array[$j] = explode(',', $baris_data[$j]);
}
for($i = 0;$i < $jumlah_iterasi;$i++){
if($i == 0){
for($x =0;$x < $jumlah_data;$x++){
$sop = (double)$array_hasil[$x];
for($j=0;$j < $jumlah_data;$j++){
if($x == $j){
$sop = $sop - 0;
}else{
$cek = (double)$array[$x][$j];
$sleketep = (double)$array_terkaan_awal[$j];
$cek2 = $cek * $sleketep;
$sop -= $cek2;
}
}
$sop2 = $array[$x][$x];
$semua = $sop / (double)$sop2;
$hasil[$i][$x] = round($semua,3);
$array_terkaan_awal[$x] = round($semua,3);
}
}else{
for($x =0;$x < $jumlah_data;$x++){
$sop = (double)$array_hasil[$x];
for($j=0;$j < $jumlah_data;$j++){
if($x == $j){
}else{
$cek = (double)$array[$x][$j];
$sleketep = (double)$array_terkaan_awal[$j];
$cek2 = $cek * $sleketep;
$sop = $sop - $cek2;
}
}
$sop2 = $array[$x][$x];
$semua = $sop / (double)$sop2;
$hasil[$i][$x] = round($semua,3);
$array_terkaan_awal[$x] = round($semua,3);
}
}
}
echo json_encode($hasil)
?>
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}