?

Average Error: 0.1 → 0.0
Time: 14.0s
Precision: binary64
Cost: 1088

?

\[\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c \]
\[\left(\left(\frac{z}{16} \cdot t + x \cdot y\right) - \frac{a \cdot b}{4}\right) + c \]
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))
(FPCore (x y z t a b c)
 :precision binary64
 (+ (- (+ (* (/ z 16.0) t) (* x y)) (/ (* a b) 4.0)) c))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((z / 16.0) * t) + (x * y)) - ((a * b) / 4.0)) + c;
}
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (((x * y) + ((z * t) / 16.0d0)) - ((a * b) / 4.0d0)) + c
end function
real(8) function code(x, y, z, t, a, b, c)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = ((((z / 16.0d0) * t) + (x * y)) - ((a * b) / 4.0d0)) + c
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return ((((z / 16.0) * t) + (x * y)) - ((a * b) / 4.0)) + c;
}
def code(x, y, z, t, a, b, c):
	return (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c
def code(x, y, z, t, a, b, c):
	return ((((z / 16.0) * t) + (x * y)) - ((a * b) / 4.0)) + c
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(x * y) + Float64(Float64(z * t) / 16.0)) - Float64(Float64(a * b) / 4.0)) + c)
end
function code(x, y, z, t, a, b, c)
	return Float64(Float64(Float64(Float64(Float64(z / 16.0) * t) + Float64(x * y)) - Float64(Float64(a * b) / 4.0)) + c)
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = (((x * y) + ((z * t) / 16.0)) - ((a * b) / 4.0)) + c;
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = ((((z / 16.0) * t) + (x * y)) - ((a * b) / 4.0)) + c;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] / 16.0), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_] := N[(N[(N[(N[(N[(z / 16.0), $MachinePrecision] * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] / 4.0), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision]
\left(\left(x \cdot y + \frac{z \cdot t}{16}\right) - \frac{a \cdot b}{4}\right) + c
\left(\left(\frac{z}{16} \cdot t + x \cdot y\right) - \frac{a \cdot b}{4}\right) + c

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.1

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

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

    \[\leadsto \left(\left(\frac{z}{16} \cdot t + x \cdot y\right) - \frac{a \cdot b}{4}\right) + c \]

Alternatives

Alternative 1
Error21.3
Cost2656
\[\begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + t_1\\ t_3 := c + a \cdot \left(b \cdot -0.25\right)\\ t_4 := c + x \cdot y\\ \mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+43}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-28}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-230}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-219}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+112}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\ \;\;\;\;t_1 + x \cdot y\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 2
Error21.3
Cost2528
\[\begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + t_1\\ t_3 := c + a \cdot \left(b \cdot -0.25\right)\\ t_4 := c + x \cdot y\\ \mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+43}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-28}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-230}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-219}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+119}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 3
Error21.3
Cost2528
\[\begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + t_1\\ t_3 := c + a \cdot \left(b \cdot -0.25\right)\\ t_4 := c + x \cdot y\\ \mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+43}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-28}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-230}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-219}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+119}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 4
Error24.6
Cost2140
\[\begin{array}{l} t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + x \cdot y\\ t_3 := \left(a \cdot b\right) \cdot -0.25\\ \mathbf{if}\;a \cdot b \leq -9.5 \cdot 10^{+41}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -1.6 \cdot 10^{-230}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -4.6 \cdot 10^{-303}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 3.7 \cdot 10^{-215}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 8.5 \cdot 10^{+71}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 7.5 \cdot 10^{+182}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 5
Error21.1
Cost2136
\[\begin{array}{l} t_1 := c + 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := c + x \cdot y\\ \mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+43}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-28}:\\ \;\;\;\;c + z \cdot \left(t \cdot 0.0625\right)\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{-230}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{-300}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-219}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 10^{+73}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + \left(a \cdot b\right) \cdot -0.25\\ \end{array} \]
Alternative 6
Error37.6
Cost1880
\[\begin{array}{l} t_1 := \left(a \cdot b\right) \cdot -0.25\\ \mathbf{if}\;a \cdot b \leq -8 \cdot 10^{+37}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq -4.2 \cdot 10^{-25}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq -2.1 \cdot 10^{-232}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 1.12 \cdot 10^{-270}:\\ \;\;\;\;c\\ \mathbf{elif}\;a \cdot b \leq 1.2 \cdot 10^{-128}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;a \cdot b \leq 30000000:\\ \;\;\;\;c\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error26.7
Cost1880
\[\begin{array}{l} t_1 := c + x \cdot y\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ t_3 := \left(a \cdot b\right) \cdot -0.25\\ \mathbf{if}\;a \cdot b \leq -1.6 \cdot 10^{+43}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq 3.8 \cdot 10^{-215}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 6 \cdot 10^{-128}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 400000000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \cdot b \leq 10^{+71}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \cdot b \leq 1.26 \cdot 10^{+182}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 8
Error6.3
Cost1873
\[\begin{array}{l} t_1 := 0.0625 \cdot \left(z \cdot t\right)\\ t_2 := \left(a \cdot b\right) \cdot -0.25\\ t_3 := c + \left(t_1 + t_2\right)\\ \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{-25}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{-24}:\\ \;\;\;\;c + \left(t_1 + x \cdot y\right)\\ \mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+74} \lor \neg \left(a \cdot b \leq 10^{+182}\right):\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;c + \left(x \cdot y + t_2\right)\\ \end{array} \]
Alternative 9
Error36.3
Cost1640
\[\begin{array}{l} t_1 := \left(a \cdot b\right) \cdot -0.25\\ t_2 := 0.0625 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;c \leq -1.1 \cdot 10^{+130}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq -4.6 \cdot 10^{+83}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -2.2 \cdot 10^{+16}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq -3 \cdot 10^{-240}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 6.2 \cdot 10^{-303}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 1.65 \cdot 10^{-265}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 3.9 \cdot 10^{-182}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \leq 6 \cdot 10^{-92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 6.5 \cdot 10^{-65}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \leq 4.6 \cdot 10^{-6}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
Alternative 10
Error6.4
Cost1225
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+43} \lor \neg \left(a \cdot b \leq 2 \cdot 10^{+129}\right):\\ \;\;\;\;c + \left(x \cdot y + \left(a \cdot b\right) \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;c + \left(0.0625 \cdot \left(z \cdot t\right) + x \cdot y\right)\\ \end{array} \]
Alternative 11
Error8.8
Cost1224
\[\begin{array}{l} \mathbf{if}\;a \cdot b \leq -2 \cdot 10^{+47}:\\ \;\;\;\;c + a \cdot \left(b \cdot -0.25\right)\\ \mathbf{elif}\;a \cdot b \leq 2 \cdot 10^{+129}:\\ \;\;\;\;c + \left(0.0625 \cdot \left(z \cdot t\right) + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot y + \left(a \cdot b\right) \cdot -0.25\\ \end{array} \]
Alternative 12
Error35.9
Cost456
\[\begin{array}{l} \mathbf{if}\;c \leq -1.5 \cdot 10^{+16}:\\ \;\;\;\;c\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{-7}:\\ \;\;\;\;x \cdot y\\ \mathbf{else}:\\ \;\;\;\;c\\ \end{array} \]
Alternative 13
Error43.9
Cost64
\[c \]

Error

Reproduce?

herbie shell --seed 2023018 
(FPCore (x y z t a b c)
  :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, C"
  :precision binary64
  (+ (- (+ (* x y) (/ (* z t) 16.0)) (/ (* a b) 4.0)) c))