import { BenchmarkResult } from '../types/BenchmarkResult' ; import { BenchmarkResultWithRegressionDeviation } from '../types/BenchmarkResultWithRegressionDeviation' ; const calculateLinearRegressionDeviations = function ( { benchmarkResults } ) : BenchmarkResultWithRegressionDeviation [ ] { return benchmarkResults . map ( ( result ) : BenchmarkResultWithRegressionDeviation => ( { ... result , regressionDeviation : ( result . time / ( result . scale * ( benchmarkResults [ 0 ] . time / benchmarkResults [ 0 ] . scale ) ) ) - 1 } ) ) ; } ; export { calculateLinearRegressionDeviations } ;