<commit_before>#lang racket

(require casio/test)

; quadratic formula
(casio-test (a b c)
  "NMSE p42"
   (let* ((d (sqrt (- (* b b) (* 4 (* a c))))))
     (/ (+ (- b) d) (* 2 a)))
   (let* ((d (sqrt (- (* b b) (* 4 (* a c)))))
          (r1 (/ (+ (- b) d) (* 2 a)))
          (r2 (/ (- (- b) d) (* 2 a))))
     (if (< b 0)
         r1
         (/ c (* a r2)))))

(casio-test (a b c)
  "NMSE p42"
   (let* ((d (sqrt (- (* b b) (* 4 (* a c))))))
     (/ (- (- b) d) (* 2 a)))
   (let* ((d (sqrt (- (* b b) (* 4 (* a c)))))
          (r1 (/ (+ (- b) d) (* 2 a)))
          (r2 (/ (- (- b) d) (* 2 a))))
     (if (< b 0)
         r2
         (/ c (* a r1)))))

(casio-bench (a b/2 c)
   "NMSE problem 3.2.1"
   (let* ((d (sqrt (- (* (* 2 b/2) (* 2 b/2)) (* 4 (* a c))))))
     (/ (+ (* -2 b/2) d) (* 2 a))))

(casio-bench (a b/2 c)
   "NMSE problem 3.2.1"
   (let* ((d (sqrt (- (* (* 2 b/2) (* 2 b/2)) (* 4 (* a c))))))
     (/ (+ (* -2 b/2) d) (* 2 a))))<commit_msg>Still a bug in the quadratic case<commit_after>#lang racket

(require casio/test)

; quadratic formula
(casio-test (a b c)
  "NMSE p42"
   (let* ((d (sqrt (- (* b b) (* 4 (* a c))))))
     (/ (+ (- b) d) (* 2 a)))
   (let* ((d (sqrt (- (* b b) (* 4 (* a c)))))
          (r1 (/ (+ (- b) d) (* 2 a)))
          (r2 (/ (- (- b) d) (* 2 a))))
     (if (< b 0)
         r1
         (/ c (* a r2)))))

(casio-test (a b c)
  "NMSE p42"
   (let* ((d (sqrt (- (* b b) (* 4 (* a c))))))
     (/ (- (- b) d) (* 2 a)))
   (let* ((d (sqrt (- (* b b) (* 4 (* a c)))))
          (r1 (/ (+ (- b) d) (* 2 a)))
          (r2 (/ (- (- b) d) (* 2 a))))
     (if (< b 0)
         (/ c (* a r1))
         r2)))

(casio-bench (a b/2 c)
   "NMSE problem 3.2.1"
   (let* ((d (sqrt (- (* (* 2 b/2) (* 2 b/2)) (* 4 (* a c))))))
     (/ (+ (* -2 b/2) d) (* 2 a))))

(casio-bench (a b/2 c)
   "NMSE problem 3.2.1"
   (let* ((d (sqrt (- (* (* 2 b/2) (* 2 b/2)) (* 4 (* a c))))))
     (/ (+ (* -2 b/2) d) (* 2 a))))
{'fraction_non_alphanumeric': 0.32205128205128203, 'fraction_numerical': 0.04923076923076923, 'mean_word_length': 1.510939510939511, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2731497', 'n_tokens_mistral': 941, 'n_tokens_neox': 862, 'n_words': 277}