@@ -900,133 +900,38 @@ mod tests {
900900 ( "sqrt" , "1" , 1 . into ( ) , None ) ,
901901 ( "sqrt" , "4" , 2 . into ( ) , None ) ,
902902 // sin
903- (
904- "sin" ,
905- "-30" ,
906- ( -0.49999999999999994 ) . into ( ) ,
907- Some ( 0.000000000000001 ) ,
908- ) ,
903+ ( "sin" , "-30" , ( -0.5 ) . into ( ) , Some ( 1e-15 ) ) ,
909904 ( "sin" , "0" , 0 . into ( ) , None ) ,
910- (
911- "sin" ,
912- "30" ,
913- 0.49999999999999994 . into ( ) ,
914- Some ( 0.000000000000001 ) ,
915- ) ,
916- (
917- "sin" ,
918- "45" ,
919- 0.7071067811865476 . into ( ) ,
920- Some ( 0.000000000000001 ) ,
921- ) ,
922- (
923- "sin" ,
924- "60" ,
925- 0.8660254037844386 . into ( ) ,
926- Some ( 0.000000000000001 ) ,
927- ) ,
928- ( "sin" , "90" , 1 . into ( ) , Some ( 0.000000000000001 ) ) ,
929- (
930- "sin" ,
931- "180" ,
932- 1.2246467991473532e-16 . into ( ) ,
933- Some ( 0.000000000000001 ) ,
934- ) ,
905+ ( "sin" , "30" , 0.5 . into ( ) , Some ( 1e-15 ) ) ,
906+ ( "sin" , "45" , 0.7071067811865476 . into ( ) , Some ( 1e-15 ) ) ,
907+ ( "sin" , "60" , 0.8660254037844386 . into ( ) , Some ( 1e-15 ) ) ,
908+ ( "sin" , "90" , 1 . into ( ) , Some ( 1e-15 ) ) ,
909+ ( "sin" , "180" , 0 . into ( ) , Some ( 1e-15 ) ) ,
935910 // cos
936- (
937- "cos" ,
938- "-30" ,
939- 0.8660254037844387 . into ( ) ,
940- Some ( 0.000000000000001 ) ,
941- ) ,
911+ ( "cos" , "-30" , 0.8660254037844387 . into ( ) , Some ( 1e-15 ) ) ,
942912 ( "cos" , "0" , 1 . into ( ) , None ) ,
943- (
944- "cos" ,
945- "30" ,
946- 0.8660254037844387 . into ( ) ,
947- Some ( 0.000000000000001 ) ,
948- ) ,
949- (
950- "cos" ,
951- "45" ,
952- 0.7071067811865476 . into ( ) ,
953- Some ( 0.000000000000001 ) ,
954- ) ,
955- (
956- "cos" ,
957- "60" ,
958- 0.5000000000000001 . into ( ) ,
959- Some ( 0.000000000000001 ) ,
960- ) ,
961- (
962- "cos" ,
963- "90" ,
964- 6.123233995736766e-17 . into ( ) ,
965- Some ( 0.000000000000001 ) ,
966- ) ,
967- ( "cos" , "180" , ( -1 ) . into ( ) , Some ( 0.000000000000001 ) ) ,
913+ ( "cos" , "30" , 0.8660254037844387 . into ( ) , Some ( 1e-15 ) ) ,
914+ ( "cos" , "45" , 0.7071067811865476 . into ( ) , Some ( 1e-15 ) ) ,
915+ ( "cos" , "60" , 0.5 . into ( ) , Some ( 1e-15 ) ) ,
916+ ( "cos" , "90" , 6.123233995736766e-17 . into ( ) , Some ( 1e-15 ) ) ,
917+ ( "cos" , "180" , ( -1 ) . into ( ) , Some ( 1e-15 ) ) ,
968918 // tan
969919 ( "tan" , "0" , 0 . into ( ) , None ) ,
970- (
971- "tan" ,
972- "45" ,
973- 0.9999999999999999 . into ( ) ,
974- Some ( 0.000000000000001 ) ,
975- ) ,
976- (
977- "tan" ,
978- "90" ,
979- 16331239353195370i64 . into ( ) ,
980- Some ( 0.000000000000001 ) ,
981- ) ,
982- (
983- "tan" ,
984- "135" ,
985- ( -1.0000000000000002 ) . into ( ) ,
986- Some ( 0.000000000000001 ) ,
987- ) ,
920+ ( "tan" , "45" , 1 . into ( ) , Some ( 1e-15 ) ) ,
921+ ( "tan" , "90" , 16331239353195370i64 . into ( ) , Some ( 1e-15 ) ) ,
922+ ( "tan" , "135" , ( -1 ) . into ( ) , Some ( 1e-15 ) ) ,
988923 // asin
989- (
990- "asin" ,
991- "-0.5" ,
992- ( -30.000000000000004 ) . into ( ) ,
993- Some ( 0.00000000000001 ) ,
994- ) ,
924+ ( "asin" , "-0.5" , ( -30 ) . into ( ) , Some ( 1e-13 ) ) ,
995925 ( "asin" , "0" , 0 . into ( ) , None ) ,
996- (
997- "asin" ,
998- "0.5" ,
999- 30.000000000000004 . into ( ) ,
1000- Some ( 0.00000000000001 ) ,
1001- ) ,
926+ ( "asin" , "0.5" , 30 . into ( ) , Some ( 1e-13 ) ) ,
1002927 // acos
1003- (
1004- "acos" ,
1005- "-0.5" ,
1006- 120.00000000000001 . into ( ) ,
1007- Some ( 0.00000000000001 ) ,
1008- ) ,
928+ ( "acos" , "-0.5" , 120 . into ( ) , Some ( 1e-13 ) ) ,
1009929 ( "acos" , "0" , 90 . into ( ) , None ) ,
1010- (
1011- "acos" ,
1012- "0.5" ,
1013- 60.00000000000001 . into ( ) ,
1014- Some ( 0.00000000000001 ) ,
1015- ) ,
930+ ( "acos" , "0.5" , 60 . into ( ) , Some ( 1e-13 ) ) ,
1016931 // atan
1017- (
1018- "atan" ,
1019- "-0.5" ,
1020- ( -26.56505117707799 ) . into ( ) ,
1021- Some ( 0.00000000000001 ) ,
1022- ) ,
932+ ( "atan" , "-0.5" , ( -26.56505117707799 ) . into ( ) , Some ( 1e-13 ) ) ,
1023933 ( "atan" , "0" , 0 . into ( ) , None ) ,
1024- (
1025- "atan" ,
1026- "0.5" ,
1027- 26.56505117707799 . into ( ) ,
1028- Some ( 0.00000000000001 ) ,
1029- ) ,
934+ ( "atan" , "0.5" , 26.56505117707799 . into ( ) , Some ( 1e-13 ) ) ,
1030935 ] {
1031936 let mut vm = single_processor_vm (
1032937 BlockType :: HyperProcessor ,
@@ -1045,7 +950,7 @@ mod tests {
1045950 if let Some ( epsilon) = epsilon {
1046951 assert ! (
1047952 ( got. num( ) - want. num( ) ) . abs( ) <= epsilon,
1048- "{op} {x} (got {got:?}, want {want:?})"
953+ "{op} {x} (got {got:?}, want {want:?} ± {epsilon:?} )"
1049954 ) ;
1050955 } else {
1051956 assert_eq ! ( got, want, "{op} {x}" ) ;
0 commit comments