let's say I have two IEEE 32bit floating point values a
and b
plus one IEEE 32bit fp interpolation value x
(something between 0 and 1)
so I get the interpolated result:
float a = 123.456f;
float b = 654.321f;
float result = a * (1.0f-x) + b * x;
let's say I want to use this single interpolation instruction now to interpolate two sets of values, but at lower precision.
somthing like:
float a1 = 123.456f;
float b1 = 654.321f;
float a2 = -234.567f;
float b2 = 12.34f;
float a = pack(a1, a2);
float b = pack(b1, b2;
float result = a * (1.0f-x) + b * x;
float aprox_resul1;
float aprox_result2;
unpack(result, &aprox_result1, &aprox_result2);
such that aprox_result1 is aproximately the interpolation of a1 and b1 and aprox_resul2 is aproximately the result of the interpolation of a2 and b2.
is this possible? if so, how would float pack(float v1, float v2)
and void unpack(float packed, float* v1, float* v2)
be implemented to achieve this?