Average Error: 19.4 → 19.4
Time: 4.2s
Precision: binary64
\[\frac{\left(a1x \cdot a2y - a1y \cdot a2x\right) \cdot \left(b1x - b2x\right) - \left(a1x - a2x\right) \cdot \left(b1x \cdot b2y - b1y \cdot b2x\right)}{a1x - a2x} \cdot \left(b1y - b2y\right) - \left(a1y - a2y\right) \cdot \left(b1x - b2x\right)\]
\[\frac{\left(a1x \cdot a2y - a1y \cdot a2x\right) \cdot \left(b1x - b2x\right) - \left(a1x - a2x\right) \cdot \left(b1x \cdot b2y - b1y \cdot b2x\right)}{a1x - a2x} \cdot \left(b1y - b2y\right) - \left(a1y - a2y\right) \cdot \left(b1x - b2x\right)\]
\frac{\left(a1x \cdot a2y - a1y \cdot a2x\right) \cdot \left(b1x - b2x\right) - \left(a1x - a2x\right) \cdot \left(b1x \cdot b2y - b1y \cdot b2x\right)}{a1x - a2x} \cdot \left(b1y - b2y\right) - \left(a1y - a2y\right) \cdot \left(b1x - b2x\right)
\frac{\left(a1x \cdot a2y - a1y \cdot a2x\right) \cdot \left(b1x - b2x\right) - \left(a1x - a2x\right) \cdot \left(b1x \cdot b2y - b1y \cdot b2x\right)}{a1x - a2x} \cdot \left(b1y - b2y\right) - \left(a1y - a2y\right) \cdot \left(b1x - b2x\right)
double code(double a1x, double a2y, double a1y, double a2x, double b1x, double b2x, double b2y, double b1y) {
	return ((double) (((double) (((double) (((double) (((double) (((double) (((double) (a1x * a2y)) - ((double) (a1y * a2x)))) * ((double) (b1x - b2x)))) - ((double) (((double) (a1x - a2x)) * ((double) (((double) (b1x * b2y)) - ((double) (b1y * b2x)))))))) / ((double) (a1x - a2x)))) * ((double) (b1y - b2y)))) - ((double) (((double) (a1y - a2y)) * ((double) (b1x - b2x))))));
}
double code(double a1x, double a2y, double a1y, double a2x, double b1x, double b2x, double b2y, double b1y) {
	return ((double) (((double) (((double) (((double) (((double) (((double) (((double) (a1x * a2y)) - ((double) (a1y * a2x)))) * ((double) (b1x - b2x)))) - ((double) (((double) (a1x - a2x)) * ((double) (((double) (b1x * b2y)) - ((double) (b1y * b2x)))))))) / ((double) (a1x - a2x)))) * ((double) (b1y - b2y)))) - ((double) (((double) (a1y - a2y)) * ((double) (b1x - b2x))))));
}

Error

Bits error versus a1x

Bits error versus a2y

Bits error versus a1y

Bits error versus a2x

Bits error versus b1x

Bits error versus b2x

Bits error versus b2y

Bits error versus b1y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 19.4

    \[\frac{\left(a1x \cdot a2y - a1y \cdot a2x\right) \cdot \left(b1x - b2x\right) - \left(a1x - a2x\right) \cdot \left(b1x \cdot b2y - b1y \cdot b2x\right)}{a1x - a2x} \cdot \left(b1y - b2y\right) - \left(a1y - a2y\right) \cdot \left(b1x - b2x\right)\]
  2. Final simplification19.4

    \[\leadsto \frac{\left(a1x \cdot a2y - a1y \cdot a2x\right) \cdot \left(b1x - b2x\right) - \left(a1x - a2x\right) \cdot \left(b1x \cdot b2y - b1y \cdot b2x\right)}{a1x - a2x} \cdot \left(b1y - b2y\right) - \left(a1y - a2y\right) \cdot \left(b1x - b2x\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (a1x a2y a1y a2x b1x b2x b2y b1y)
  :name "(- (* (/ (- (* (- (* a1x a2y) (* a1y a2x)) (- b1x b2x)) (* (- a1x a2x) (- (* b1x b2y) (* b1y b2x)))) (- a1x a2x)) (- b1y b2y)) (* (- a1y a2y) (- b1x b2x)))"
  :precision binary64
  (- (* (/ (- (* (- (* a1x a2y) (* a1y a2x)) (- b1x b2x)) (* (- a1x a2x) (- (* b1x b2y) (* b1y b2x)))) (- a1x a2x)) (- b1y b2y)) (* (- a1y a2y) (- b1x b2x))))