?

Average Error: 0.4 → 0.4
Time: 24.5s
Precision: binary64
Cost: 10112

?

\[\left(\left(\left(\left(\left(-200 \leq b \land b \leq -1\right) \land \left(-1 \cdot 10^{+20} \leq x \land x \leq 10^{+20}\right)\right) \land \left(1 \leq a \land a \leq 200\right)\right) \land \left(1 \leq c \land c \leq 200\right)\right) \land \left(-1 \cdot 10^{+20} \leq z \land z \leq 10^{+20}\right)\right) \land \left(-1 \cdot 10^{+20} \leq y \land y \leq 10^{+20}\right)\]
\[\frac{\left(\left(\left(\left(b \cdot x - a \cdot x\right) + c \cdot z\right) - b \cdot z\right) + \left(\left(c \cdot x\right) \cdot y\right) \cdot z\right) - \left(\left(a \cdot x\right) \cdot y\right) \cdot z}{\left(\left(\left(\left(c - a\right) + \left(c \cdot x\right) \cdot y\right) - \left(b \cdot x\right) \cdot y\right) + \left(b \cdot y\right) \cdot z\right) - \left(a \cdot y\right) \cdot z} \]
\[\begin{array}{l} t_0 := \left(x \cdot c\right) \cdot y\\ \frac{\left(\left(\left(\mathsf{fma}\left(b, x, x \cdot \left(-a\right)\right) + c \cdot z\right) - b \cdot z\right) + z \cdot t_0\right) - z \cdot \left(y \cdot \left(x \cdot a\right)\right)}{\left(\left(\left(t_0 + \left(c - a\right)\right) - y \cdot \left(b \cdot x\right)\right) + z \cdot \left(b \cdot y\right)\right) - z \cdot \left(a \cdot y\right)} \end{array} \]
(FPCore (b x a c z y)
 :precision binary64
 (/
  (-
   (+ (- (+ (- (* b x) (* a x)) (* c z)) (* b z)) (* (* (* c x) y) z))
   (* (* (* a x) y) z))
  (-
   (+ (- (+ (- c a) (* (* c x) y)) (* (* b x) y)) (* (* b y) z))
   (* (* a y) z))))
(FPCore (b x a c z y)
 :precision binary64
 (let* ((t_0 (* (* x c) y)))
   (/
    (-
     (+ (- (+ (fma b x (* x (- a))) (* c z)) (* b z)) (* z t_0))
     (* z (* y (* x a))))
    (- (+ (- (+ t_0 (- c a)) (* y (* b x))) (* z (* b y))) (* z (* a y))))))
double code(double b, double x, double a, double c, double z, double y) {
	return ((((((b * x) - (a * x)) + (c * z)) - (b * z)) + (((c * x) * y) * z)) - (((a * x) * y) * z)) / (((((c - a) + ((c * x) * y)) - ((b * x) * y)) + ((b * y) * z)) - ((a * y) * z));
}
double code(double b, double x, double a, double c, double z, double y) {
	double t_0 = (x * c) * y;
	return ((((fma(b, x, (x * -a)) + (c * z)) - (b * z)) + (z * t_0)) - (z * (y * (x * a)))) / ((((t_0 + (c - a)) - (y * (b * x))) + (z * (b * y))) - (z * (a * y)));
}
function code(b, x, a, c, z, y)
	return Float64(Float64(Float64(Float64(Float64(Float64(Float64(b * x) - Float64(a * x)) + Float64(c * z)) - Float64(b * z)) + Float64(Float64(Float64(c * x) * y) * z)) - Float64(Float64(Float64(a * x) * y) * z)) / Float64(Float64(Float64(Float64(Float64(c - a) + Float64(Float64(c * x) * y)) - Float64(Float64(b * x) * y)) + Float64(Float64(b * y) * z)) - Float64(Float64(a * y) * z)))
end
function code(b, x, a, c, z, y)
	t_0 = Float64(Float64(x * c) * y)
	return Float64(Float64(Float64(Float64(Float64(fma(b, x, Float64(x * Float64(-a))) + Float64(c * z)) - Float64(b * z)) + Float64(z * t_0)) - Float64(z * Float64(y * Float64(x * a)))) / Float64(Float64(Float64(Float64(t_0 + Float64(c - a)) - Float64(y * Float64(b * x))) + Float64(z * Float64(b * y))) - Float64(z * Float64(a * y))))
end
code[b_, x_, a_, c_, z_, y_] := N[(N[(N[(N[(N[(N[(N[(b * x), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] + N[(c * z), $MachinePrecision]), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(c * x), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a * x), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(c - a), $MachinePrecision] + N[(N[(c * x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] - N[(N[(b * x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + N[(N[(b * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(a * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[b_, x_, a_, c_, z_, y_] := Block[{t$95$0 = N[(N[(x * c), $MachinePrecision] * y), $MachinePrecision]}, N[(N[(N[(N[(N[(N[(b * x + N[(x * (-a)), $MachinePrecision]), $MachinePrecision] + N[(c * z), $MachinePrecision]), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(z * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(z * N[(y * N[(x * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(t$95$0 + N[(c - a), $MachinePrecision]), $MachinePrecision] - N[(y * N[(b * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\frac{\left(\left(\left(\left(b \cdot x - a \cdot x\right) + c \cdot z\right) - b \cdot z\right) + \left(\left(c \cdot x\right) \cdot y\right) \cdot z\right) - \left(\left(a \cdot x\right) \cdot y\right) \cdot z}{\left(\left(\left(\left(c - a\right) + \left(c \cdot x\right) \cdot y\right) - \left(b \cdot x\right) \cdot y\right) + \left(b \cdot y\right) \cdot z\right) - \left(a \cdot y\right) \cdot z}
\begin{array}{l}
t_0 := \left(x \cdot c\right) \cdot y\\
\frac{\left(\left(\left(\mathsf{fma}\left(b, x, x \cdot \left(-a\right)\right) + c \cdot z\right) - b \cdot z\right) + z \cdot t_0\right) - z \cdot \left(y \cdot \left(x \cdot a\right)\right)}{\left(\left(\left(t_0 + \left(c - a\right)\right) - y \cdot \left(b \cdot x\right)\right) + z \cdot \left(b \cdot y\right)\right) - z \cdot \left(a \cdot y\right)}
\end{array}

Error?

Derivation?

  1. Initial program 0.4

    \[\frac{\left(\left(\left(\left(b \cdot x - a \cdot x\right) + c \cdot z\right) - b \cdot z\right) + \left(\left(c \cdot x\right) \cdot y\right) \cdot z\right) - \left(\left(a \cdot x\right) \cdot y\right) \cdot z}{\left(\left(\left(\left(c - a\right) + \left(c \cdot x\right) \cdot y\right) - \left(b \cdot x\right) \cdot y\right) + \left(b \cdot y\right) \cdot z\right) - \left(a \cdot y\right) \cdot z} \]
  2. Applied egg-rr0.4

    \[\leadsto \frac{\left(\left(\left(\color{blue}{\mathsf{fma}\left(b, x, -x \cdot a\right)} + c \cdot z\right) - b \cdot z\right) + \left(\left(c \cdot x\right) \cdot y\right) \cdot z\right) - \left(\left(a \cdot x\right) \cdot y\right) \cdot z}{\left(\left(\left(\left(c - a\right) + \left(c \cdot x\right) \cdot y\right) - \left(b \cdot x\right) \cdot y\right) + \left(b \cdot y\right) \cdot z\right) - \left(a \cdot y\right) \cdot z} \]
  3. Final simplification0.4

    \[\leadsto \frac{\left(\left(\left(\mathsf{fma}\left(b, x, x \cdot \left(-a\right)\right) + c \cdot z\right) - b \cdot z\right) + z \cdot \left(\left(x \cdot c\right) \cdot y\right)\right) - z \cdot \left(y \cdot \left(x \cdot a\right)\right)}{\left(\left(\left(\left(x \cdot c\right) \cdot y + \left(c - a\right)\right) - y \cdot \left(b \cdot x\right)\right) + z \cdot \left(b \cdot y\right)\right) - z \cdot \left(a \cdot y\right)} \]

Alternatives

Alternative 1
Error0.4
Cost3776
\[\begin{array}{l} t_0 := \left(x \cdot c\right) \cdot y\\ \frac{\left(z \cdot t_0 + \left(\left(c \cdot z + \left(b \cdot x - x \cdot a\right)\right) - b \cdot z\right)\right) - z \cdot \left(y \cdot \left(x \cdot a\right)\right)}{\left(\left(\left(t_0 + \left(c - a\right)\right) - y \cdot \left(b \cdot x\right)\right) + z \cdot \left(b \cdot y\right)\right) - z \cdot \left(a \cdot y\right)} \end{array} \]
Alternative 2
Error0.4
Cost3648
\[\begin{array}{l} t_0 := c \cdot \left(x \cdot y\right)\\ \frac{\left(x \cdot \left(b - a\right) + \left(c \cdot z - b \cdot z\right)\right) + \left(z \cdot t_0 - z \cdot \left(a \cdot \left(x \cdot y\right)\right)\right)}{\left(\left(c - a\right) + \left(t_0 - y \cdot \left(b \cdot x\right)\right)\right) + \left(b \cdot \left(z \cdot y\right) - a \cdot \left(z \cdot y\right)\right)} \end{array} \]
Alternative 3
Error0.5
Cost3008
\[\left(x \cdot \left(b - a\right) + \left(z \cdot \left(c - b\right) + z \cdot \left(x \cdot \left(c \cdot y\right) - a \cdot \left(x \cdot y\right)\right)\right)\right) \cdot \frac{1}{\left(c - a\right) + \left(\left(x \cdot y\right) \cdot \left(c - b\right) + \left(b - a\right) \cdot \left(z \cdot y\right)\right)} \]
Alternative 4
Error1.6
Cost1216
\[\frac{\left(c \cdot z + b \cdot x\right) - \left(b \cdot z + x \cdot a\right)}{c - a} \]
Alternative 5
Error1.6
Cost1088
\[\frac{\left(c \cdot z + x \cdot \left(b - a\right)\right) - b \cdot z}{c - a} \]
Alternative 6
Error32.5
Cost960
\[\frac{z \cdot \left(c - b\right)}{c + \left(\left(b \cdot z\right) \cdot y - a\right)} \]
Alternative 7
Error1.6
Cost960
\[\frac{x \cdot \left(b - a\right) + z \cdot \left(c - b\right)}{c - a} \]
Alternative 8
Error57.7
Cost580
\[\begin{array}{l} \mathbf{if}\;a \leq 16:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot y + 1}\\ \end{array} \]
Alternative 9
Error57.3
Cost580
\[\begin{array}{l} \mathbf{if}\;a \leq 16:\\ \;\;\;\;\frac{z \cdot \left(c - b\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z \cdot y + 1}\\ \end{array} \]
Alternative 10
Error32.6
Cost576
\[\frac{z}{\frac{c - a}{c - b}} \]
Alternative 11
Error32.6
Cost576
\[\frac{z \cdot \left(c - b\right)}{c - a} \]
Alternative 12
Error59.1
Cost64
\[z \]

Error

Reproduce?

herbie shell --seed 1 
(FPCore (b x a c z y)
  :name "(b*x-a*x+c*z-b*z+c*x*y*z-a*x*y*z)/(c-a+c*x*y-b*x*y+b*y*z-a*y*z)"
  :precision binary64
  :pre (and (and (and (and (and (and (<= -200.0 b) (<= b -1.0)) (and (<= -1e+20 x) (<= x 1e+20))) (and (<= 1.0 a) (<= a 200.0))) (and (<= 1.0 c) (<= c 200.0))) (and (<= -1e+20 z) (<= z 1e+20))) (and (<= -1e+20 y) (<= y 1e+20)))
  (/ (- (+ (- (+ (- (* b x) (* a x)) (* c z)) (* b z)) (* (* (* c x) y) z)) (* (* (* a x) y) z)) (- (+ (- (+ (- c a) (* (* c x) y)) (* (* b x) y)) (* (* b y) z)) (* (* a y) z))))