diff --git a/fitbenchmarking/fitting/misc.py b/fitbenchmarking/fitting/misc.py
index 73ccd9e5..3120ebfc 100644
--- a/fitbenchmarking/fitting/misc.py
+++ b/fitbenchmarking/fitting/misc.py
@@ -20,10 +20,8 @@ def compute_chisq(actual, fitted, errors=None):
     """
     r = fitted - actual
     if errors is not None:
-        weighted_r = np.multiply(errors, r)
-        chi_sq = np.dot(r, weighted_r)
-    else:
-        chi_sq = np.dot(r, r)
+        r = r / errors
+    chi_sq = np.dot(r, r)
 
     return chi_sq
 
@@ -46,8 +44,10 @@ def create_result_entry(problem, status, chi_sq, runtime, minimizer,
     """
 
     if 'fitFunction' in ini_function_def:
-        ini_function_def = ini_function_def.replace('fitFunction', problem.equation)
-        fin_function_def = fin_function_def.replace('fitFunction', problem.equation)
+        ini_function_def = ini_function_def.replace(
+            'fitFunction', problem.equation)
+        fin_function_def = fin_function_def.replace(
+            'fitFunction', problem.equation)
 
     # Create empty fitting result object
     result = fitbm_result.FittingResult()

Wrong `chi_sq` value produced
**Description of the error**
Noticed by @AndrewLister-STFC in the review of #316 that the `chi_sq` computed in `utils/fitting/misc.py` is incorrect. 

**Describe the expected result**
Fixed reported `chi_sq` value

diff --git a/fitbenchmarking/fitting/tests/test_misc.py b/fitbenchmarking/fitting/tests/test_misc.py
index b74458e2..1363554a 100644
--- a/fitbenchmarking/fitting/tests/test_misc.py
+++ b/fitbenchmarking/fitting/tests/test_misc.py
@@ -79,7 +79,7 @@ class FitMiscTests(unittest.TestCase):
         errors = np.array([5, 0.1, 0.5])
 
         chi_sq = compute_chisq(actual, calculated, errors)
-        chi_sq_expected = 9.9
+        chi_sq_expected = 436.04
 
         self.assertEqual(chi_sq_expected, chi_sq)
 

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gfortran lcov libblas-dev liblapack-dev
2.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
bumps==0.9.3
certifi==2021.5.30
chardet==3.0.4
charset-normalizer==2.0.12
coverage==6.2
coveralls==3.3.1
cycler==0.11.0
DataProperty==0.46.4
DFOGN==1.0.2
docopt==0.6.2
docutils==0.18.1
-e git+https://github.com/fitbenchmarking/fitbenchmarking.git@be3361d4fd7a34a8a2fcfa7a8510908accf9222a#egg=FitBenchmarking
idna==3.10
iminuit==2.16.0
importlib-metadata==4.8.3
iniconfig==1.1.1
kiwisolver==1.3.1
lxml==5.3.1
matplotlib==2.2.5
mbstrdecoder==0.8.4
msgfy==0.0.7
numpy==1.16.6
packaging==21.3
pandas==0.24.2
pathvalidate==0.29.1
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytablewriter==0.46.1
pytest==7.0.1
pytest-cov==4.0.0
python-coveralls==2.9.3
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.1
requests==2.27.1
sasmodels==1.0.9
scipy==1.2.3
six==1.17.0
tabledata==0.10.4
tinycc==1.1
tomli==1.2.3
typepy==0.6.6
typing_extensions==4.1.1
urllib3==1.23
zipp==3.6.0

name: fitbenchmarking
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - bumps==0.9.3
      - chardet==3.0.4
      - charset-normalizer==2.0.12
      - coverage==6.2
      - coveralls==3.3.1
      - cycler==0.11.0
      - dataproperty==0.46.4
      - dfogn==1.0.2
      - docopt==0.6.2
      - docutils==0.18.1
      - idna==3.10
      - iminuit==2.16.0
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - kiwisolver==1.3.1
      - lxml==5.3.1
      - matplotlib==2.2.5
      - mbstrdecoder==0.8.4
      - msgfy==0.0.7
      - numpy==1.16.6
      - packaging==21.3
      - pandas==0.24.2
      - pathvalidate==0.29.1
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytablewriter==0.46.1
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - python-coveralls==2.9.3
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.1
      - requests==2.27.1
      - sasmodels==1.0.9
      - scipy==1.2.3
      - six==1.17.0
      - tabledata==0.10.4
      - tinycc==1.1
      - tomli==1.2.3
      - typepy==0.6.6
      - typing-extensions==4.1.1
      - urllib3==1.23
      - zipp==3.6.0
prefix: /opt/conda/envs/fitbenchmarking

fitbenchmarking/fitting/tests/test_misc.py::FitMiscTests::test_compute_chisq_errors
fitbenchmarking/fitting/tests/test_misc.py::FitMiscTests::test_compute_chisq_no_errors fitbenchmarking/fitting/tests/test_misc.py::FitMiscTests::test_createResultEntry
fitbenchmarking/fitting/misc.py
fitbenchmarking/fitting/misc.py