Skip to main content
Commonmark migration
Source Link

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

###Explanation

Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. F4Y2'- .;e'hZa decompresses this into the string -611 19 ... 6.961e-6. Note that some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

The decompressed string is interpreted as an array with U. This produces the 8×4 table with the required data. The first column shown in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes a number as input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result of the interpolation is implicitly displayed.

The input can also be a column vector, and then each row of the output refers to one of the input values. This is used for verifying all test cases at once.

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

###Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. F4Y2'- .;e'hZa decompresses this into the string -611 19 ... 6.961e-6. Note that some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

The decompressed string is interpreted as an array with U. This produces the 8×4 table with the required data. The first column shown in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes a number as input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result of the interpolation is implicitly displayed.

The input can also be a column vector, and then each row of the output refers to one of the input values. This is used for verifying all test cases at once.

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. F4Y2'- .;e'hZa decompresses this into the string -611 19 ... 6.961e-6. Note that some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

The decompressed string is interpreted as an array with U. This produces the 8×4 table with the required data. The first column shown in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes a number as input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result of the interpolation is implicitly displayed.

The input can also be a column vector, and then each row of the output refers to one of the input values. This is used for verifying all test cases at once.

added 61 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

###Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. Using F4Y2'- .;e'hZa decompresses this is decompressed into the string -611 19 ... 6.961e-6. SomeNote that some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

ThisThe decompressed string is then interpreted as an array with U. This produces the 8×4 table with the required data. The first column shown in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes thea number as input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result of the interpolation is implicitly displayed.

The input can also be a column vector, and then each row of the output refers to one of the input values. This is used for veryfyingverifying all test cases at once.

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

###Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. Using F4Y2'- .;e'hZa this is decompressed into the string -611 19 ... 6.961e-6. Some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

This string is then interpreted as an array with U. This produces the 8×4 table with data. The first column in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes the input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result is implicitly displayed.

The input can be a column vector, and then each row of the output refers to one of the input values. This is used for veryfying all test cases at once.

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

###Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. F4Y2'- .;e'hZa decompresses this into the string -611 19 ... 6.961e-6. Note that some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

The decompressed string is interpreted as an array with U. This produces the 8×4 table with the required data. The first column shown in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes a number as input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result of the interpolation is implicitly displayed.

The input can also be a column vector, and then each row of the output refers to one of the input values. This is used for verifying all test cases at once.

Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

MATL, 152 bytes

'!Q%:5-aeo\!=XBf=H]3|X"Pj7#UGj{r_DH&!+.eFc;u4 kG9Q[rQA(^D1dW- @[E8{Ul0!AXC|MDi8}:&D(j&1_zMU.`[^HQvWoi5}*1UApz %Ld3A)N<$A*7!wBgm'F4Y2'- .;e'hZaU1&Z)i&1Yn

Output is in the same order as described in the challenge

Try it online! Or verify all test cases.

###Explanation

Most of the code, '!Q%:5...!wBgm', is a compressed string containing the table. Using F4Y2'- .;e'hZa this is decompressed into the string -611 19 ... 6.961e-6. Some decimals have been removed, as they are not needed to fulfill the 0.1% accuracy criterion.

This string is then interpreted as an array with U. This produces the 8×4 table with data. The first column in the challenge is not needed. Then 1&Z) separates the first column from the rest.

i takes the input, and &1Yn applies linear interpolation using the three types of data: first column of the table, remaining columns, input. The result is implicitly displayed.

The input can be a column vector, and then each row of the output refers to one of the input values. This is used for veryfying all test cases at once.