(solve
'[a0 a1]
(ex (= y0 (+ a0 (* a1 x0))))
(ex (= y1-y0 (* a1 x1-x0))))
returns
#{{ a1 (* y1-y0 (/ x1-x0)),
a0 (+ y0 (* -1 y1-y0 x1-x0 x0))}}
a1 is correct, though I would have expected (/ y1-y0 x1-x0)
a0 should be something equivalent to (- y0 (* (/ y1-y0 x1-x0) x0)).
PS:
I started with
(solve
'[a0 a1]
(ex (= y0 (+ a0 (* a1 x0))))
(ex (= y1 (+ a0 (* a1 x1)))))
But the answer wasn't useful:
#{{a1 (+ (* y1
(+ (/ x1)
(* (** (/ x1) 2)
-1
x0
(/ (+ (/ x1) (- x0) -1)))))
(* y0
(/ (+ (/ x1) (- x0) -1))
(/ x1))),
a0 (* (/ (+ (/ x1) (- x0) -1))
(+ (* y1 (/ x1) x0)
(- y0)))}}
So I tried re-arranging by hand, only to get an incorrect answer.