@@ -111,10 +111,10 @@ impl ScaleFuncForm {
111
111
Self :: ScaleMax ( _, _) => |( s1, s2) | s1. max ( s2) ,
112
112
Self :: ScaleMin ( _, _) => |( s1, s2) | s1. min ( s2) ,
113
113
Self :: Prod ( _, _) => |( s1, s2) | s1 * s2,
114
- Self :: S2plusS1half ( _, _) => |( s1, s2) | 0.5 * ( s1 + 2.0 * s2 ) ,
115
- Self :: Pow4Sum ( _, _) => |( s1, s2) | ( s1 * s1 + s2 * s2 ) . sqrt ( ) ,
116
- Self :: WgtAvg ( _, _) => |( s1, s2) | ( s1 * s1 + s2 * s2) / ( s1 + s2) ,
117
- Self :: S2plusS1fourth ( _, _) => |( s1, s2) | 0.25 * s1 + s2 ,
114
+ Self :: S2plusS1half ( _, _) => |( s1, s2) | 0.5 * s2 . mul_add ( 2.0 , s1 ) ,
115
+ Self :: Pow4Sum ( _, _) => |( s1, s2) | s1 . hypot ( s2 ) ,
116
+ Self :: WgtAvg ( _, _) => |( s1, s2) | s1 . mul_add ( s1, s2 * s2) / ( s1 + s2) ,
117
+ Self :: S2plusS1fourth ( _, _) => |( s1, s2) | s1 . mul_add ( 0.25 , s2 ) ,
118
118
Self :: ExpProd2 ( _, _) => {
119
119
|( s1, s2) | ( s1. sqrt ( ) * ( 0.3 * s2. sqrt ( ) ) . exp ( ) ) . powi ( 2 )
120
120
}
@@ -145,6 +145,7 @@ impl ScaleFuncForm {
145
145
}
146
146
147
147
/// TODO
148
+ #[ must_use]
148
149
pub fn idx ( & self , indices : & [ usize ] , scale_dims : & [ usize ] ) -> usize {
149
150
match self . clone ( ) {
150
151
Self :: NoScale => unreachable ! ( ) ,
0 commit comments