gitee.com/quant1x/num@v0.3.2/asm/c2goasm/test/MaddArgs10_test.go (about)

     1  package c2goasmtest
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestMaddArgs10(t *testing.T) {
     8  
     9  	f1 := [8]float32{}
    10  	f2 := [8]float32{}
    11  	f3 := [8]float32{}
    12  	f4 := [8]float32{}
    13  	f5 := [8]float32{}
    14  	f6 := [8]float32{}
    15  	f7 := [8]float32{}
    16  	f8 := [8]float32{}
    17  	f9 := [8]float32{}
    18  
    19  	for i := 0; i < 8; i++ {
    20  		f1[i] = float32(i)
    21  		f2[i] = float32(i * 2)
    22  		f3[i] = float32(i * 2)
    23  		f4[i] = float32(i * 2)
    24  		f5[i] = float32(i * 2)
    25  		f6[i] = float32(i * 2)
    26  		f7[i] = float32(i * 2)
    27  		f8[i] = float32(i * 2)
    28  		f9[i] = float32(i * 2)
    29  	}
    30  
    31  	f10 := MaddArgs10(f1, f2, f3, f4, f5, f6, f7, f8, f9)
    32  
    33  	for i := 0; i < 8; i++ {
    34  		expected := (((f1[i]*f2[i]+f3[i])*f4[i]+f5[i])*f6[i]+f7[i])*f8[i] + f9[i]
    35  		if f10[i] != expected {
    36  			t.Errorf("TestMaddArgs10(): \nexpected %f\ngot      %f", expected, f10[i])
    37  		}
    38  	}
    39  }