?

Average Error: 16.2 → 0.3
Time: 8.1s
Precision: binary64
Cost: 512

?

\[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
\[-\left(a \cdot b\right) \cdot \left(a \cdot b\right) \]
(FPCore (a b) :precision binary64 (- (* (* (* a a) b) b)))
(FPCore (a b) :precision binary64 (- (* (* a b) (* a b))))
double code(double a, double b) {
	return -(((a * a) * b) * b);
}
double code(double a, double b) {
	return -((a * b) * (a * b));
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = -(((a * a) * b) * b)
end function
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = -((a * b) * (a * b))
end function
public static double code(double a, double b) {
	return -(((a * a) * b) * b);
}
public static double code(double a, double b) {
	return -((a * b) * (a * b));
}
def code(a, b):
	return -(((a * a) * b) * b)
def code(a, b):
	return -((a * b) * (a * b))
function code(a, b)
	return Float64(-Float64(Float64(Float64(a * a) * b) * b))
end
function code(a, b)
	return Float64(-Float64(Float64(a * b) * Float64(a * b)))
end
function tmp = code(a, b)
	tmp = -(((a * a) * b) * b);
end
function tmp = code(a, b)
	tmp = -((a * b) * (a * b));
end
code[a_, b_] := (-N[(N[(N[(a * a), $MachinePrecision] * b), $MachinePrecision] * b), $MachinePrecision])
code[a_, b_] := (-N[(N[(a * b), $MachinePrecision] * N[(a * b), $MachinePrecision]), $MachinePrecision])
-\left(\left(a \cdot a\right) \cdot b\right) \cdot b
-\left(a \cdot b\right) \cdot \left(a \cdot b\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 16.2

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
  2. Simplified16.6

    \[\leadsto \color{blue}{-a \cdot \left(\left(b \cdot b\right) \cdot a\right)} \]
    Proof

    [Start]16.2

    \[ -\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]

    rational_best-simplify-2 [=>]16.2

    \[ -\color{blue}{b \cdot \left(\left(a \cdot a\right) \cdot b\right)} \]

    rational_best-simplify-44 [=>]21.9

    \[ -\color{blue}{\left(a \cdot a\right) \cdot \left(b \cdot b\right)} \]

    rational_best-simplify-2 [=>]21.9

    \[ -\color{blue}{\left(b \cdot b\right) \cdot \left(a \cdot a\right)} \]

    rational_best-simplify-44 [=>]16.6

    \[ -\color{blue}{a \cdot \left(\left(b \cdot b\right) \cdot a\right)} \]
  3. Applied egg-rr16.2

    \[\leadsto -\color{blue}{\left|b \cdot \left(b \cdot \left(a \cdot a\right)\right)\right|} \]
  4. Simplified0.3

    \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
    Proof

    [Start]16.2

    \[ -\left|b \cdot \left(b \cdot \left(a \cdot a\right)\right)\right| \]

    rational_best-simplify-2 [=>]16.2

    \[ -\left|\color{blue}{\left(b \cdot \left(a \cdot a\right)\right) \cdot b}\right| \]

    rational_best-simplify-54 [<=]16.2

    \[ -\color{blue}{\left|b\right| \cdot \left|b \cdot \left(a \cdot a\right)\right|} \]

    rational_best-simplify-72 [=>]16.2

    \[ -\color{blue}{\left|\left|b\right|\right|} \cdot \left|b \cdot \left(a \cdot a\right)\right| \]

    rational_best-simplify-54 [=>]16.2

    \[ -\color{blue}{\left|\left(b \cdot \left(a \cdot a\right)\right) \cdot \left|b\right|\right|} \]

    rational_best-simplify-2 [<=]16.2

    \[ -\left|\color{blue}{\left|b\right| \cdot \left(b \cdot \left(a \cdot a\right)\right)}\right| \]

    rational_best-simplify-44 [=>]5.4

    \[ -\left|\left|b\right| \cdot \color{blue}{\left(a \cdot \left(b \cdot a\right)\right)}\right| \]

    rational_best-simplify-135 [<=]0.3

    \[ -\color{blue}{\left|\left|b \cdot a\right| \cdot \left(a \cdot b\right)\right|} \]

    rational_best-simplify-2 [<=]0.3

    \[ -\left|\left|b \cdot a\right| \cdot \color{blue}{\left(b \cdot a\right)}\right| \]

    rational_best-simplify-54 [<=]0.3

    \[ -\color{blue}{\left|b \cdot a\right| \cdot \left|\left|b \cdot a\right|\right|} \]

    rational_best-simplify-72 [<=]0.3

    \[ -\left|b \cdot a\right| \cdot \color{blue}{\left|b \cdot a\right|} \]

    rational_best-simplify-54 [=>]0.3

    \[ -\color{blue}{\left|\left(b \cdot a\right) \cdot \left(b \cdot a\right)\right|} \]

    rational_best-simplify-74 [<=]0.3

    \[ -\color{blue}{\left(b \cdot a\right) \cdot \left(b \cdot a\right)} \]

    rational_best-simplify-2 [=>]0.3

    \[ -\color{blue}{\left(a \cdot b\right)} \cdot \left(b \cdot a\right) \]

    rational_best-simplify-2 [=>]0.3

    \[ -\left(a \cdot b\right) \cdot \color{blue}{\left(a \cdot b\right)} \]
  5. Final simplification0.3

    \[\leadsto -\left(a \cdot b\right) \cdot \left(a \cdot b\right) \]

Alternatives

Alternative 1
Error16.6
Cost512
\[-a \cdot \left(\left(b \cdot b\right) \cdot a\right) \]

Error

Reproduce?

herbie shell --seed 2023092 
(FPCore (a b)
  :name "ab-angle->ABCF D"
  :precision binary64
  (- (* (* (* a a) b) b)))