ab-angle->ABCF D

Percentage Accurate: 82.1% → 99.6%
Time: 5.8s
Alternatives: 5
Speedup: 1.0×

Specification

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

\\
-\left(\left(a \cdot a\right) \cdot b\right) \cdot b
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 5 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 82.1% accurate, 1.0× speedup?

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

\\
-\left(\left(a \cdot a\right) \cdot b\right) \cdot b
\end{array}

Alternative 1: 99.6% accurate, 0.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ {\left(a\_m \cdot b\_m\right)}^{1.5} \cdot \left(-\sqrt{a\_m \cdot b\_m}\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m)
 :precision binary64
 (* (pow (* a_m b_m) 1.5) (- (sqrt (* a_m b_m)))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m) {
	return pow((a_m * b_m), 1.5) * -sqrt((a_m * b_m));
}
a_m = abs(a)
b_m = abs(b)
real(8) function code(a_m, b_m)
    real(8), intent (in) :: a_m
    real(8), intent (in) :: b_m
    code = ((a_m * b_m) ** 1.5d0) * -sqrt((a_m * b_m))
end function
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m) {
	return Math.pow((a_m * b_m), 1.5) * -Math.sqrt((a_m * b_m));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m):
	return math.pow((a_m * b_m), 1.5) * -math.sqrt((a_m * b_m))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m)
	return Float64((Float64(a_m * b_m) ^ 1.5) * Float64(-sqrt(Float64(a_m * b_m))))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m)
	tmp = ((a_m * b_m) ^ 1.5) * -sqrt((a_m * b_m));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_] := N[(N[Power[N[(a$95$m * b$95$m), $MachinePrecision], 1.5], $MachinePrecision] * (-N[Sqrt[N[(a$95$m * b$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
{\left(a\_m \cdot b\_m\right)}^{1.5} \cdot \left(-\sqrt{a\_m \cdot b\_m}\right)
\end{array}
Derivation
  1. Initial program 84.2%

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in a around 0 80.1%

    \[\leadsto -\color{blue}{{a}^{2} \cdot {b}^{2}} \]
  4. Step-by-step derivation
    1. unpow280.1%

      \[\leadsto -\color{blue}{\left(a \cdot a\right)} \cdot {b}^{2} \]
    2. unpow280.1%

      \[\leadsto -\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot b\right)} \]
    3. swap-sqr99.7%

      \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
    4. unpow299.7%

      \[\leadsto -\color{blue}{{\left(a \cdot b\right)}^{2}} \]
  5. Simplified99.7%

    \[\leadsto -\color{blue}{{\left(a \cdot b\right)}^{2}} \]
  6. Step-by-step derivation
    1. unpow299.7%

      \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
    2. add-sqr-sqrt54.4%

      \[\leadsto -\left(a \cdot b\right) \cdot \color{blue}{\left(\sqrt{a \cdot b} \cdot \sqrt{a \cdot b}\right)} \]
    3. associate-*r*54.5%

      \[\leadsto -\color{blue}{\left(\left(a \cdot b\right) \cdot \sqrt{a \cdot b}\right) \cdot \sqrt{a \cdot b}} \]
    4. pow154.5%

      \[\leadsto -\left(\color{blue}{{\left(a \cdot b\right)}^{1}} \cdot \sqrt{a \cdot b}\right) \cdot \sqrt{a \cdot b} \]
    5. pow1/254.5%

      \[\leadsto -\left({\left(a \cdot b\right)}^{1} \cdot \color{blue}{{\left(a \cdot b\right)}^{0.5}}\right) \cdot \sqrt{a \cdot b} \]
    6. pow-prod-up54.5%

      \[\leadsto -\color{blue}{{\left(a \cdot b\right)}^{\left(1 + 0.5\right)}} \cdot \sqrt{a \cdot b} \]
    7. metadata-eval54.5%

      \[\leadsto -{\left(a \cdot b\right)}^{\color{blue}{1.5}} \cdot \sqrt{a \cdot b} \]
  7. Applied egg-rr54.5%

    \[\leadsto -\color{blue}{{\left(a \cdot b\right)}^{1.5} \cdot \sqrt{a \cdot b}} \]
  8. Final simplification54.5%

    \[\leadsto {\left(a \cdot b\right)}^{1.5} \cdot \left(-\sqrt{a \cdot b}\right) \]
  9. Add Preprocessing

Alternative 2: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ \left(a\_m \cdot b\_m\right) \cdot \left(a\_m \cdot \left(-b\_m\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m) :precision binary64 (* (* a_m b_m) (* a_m (- b_m))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m) {
	return (a_m * b_m) * (a_m * -b_m);
}
a_m = abs(a)
b_m = abs(b)
real(8) function code(a_m, b_m)
    real(8), intent (in) :: a_m
    real(8), intent (in) :: b_m
    code = (a_m * b_m) * (a_m * -b_m)
end function
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m) {
	return (a_m * b_m) * (a_m * -b_m);
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m):
	return (a_m * b_m) * (a_m * -b_m)
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m)
	return Float64(Float64(a_m * b_m) * Float64(a_m * Float64(-b_m)))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m)
	tmp = (a_m * b_m) * (a_m * -b_m);
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_] := N[(N[(a$95$m * b$95$m), $MachinePrecision] * N[(a$95$m * (-b$95$m)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
\left(a\_m \cdot b\_m\right) \cdot \left(a\_m \cdot \left(-b\_m\right)\right)
\end{array}
Derivation
  1. Initial program 84.2%

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
  2. Add Preprocessing
  3. Taylor expanded in a around 0 80.1%

    \[\leadsto -\color{blue}{{a}^{2} \cdot {b}^{2}} \]
  4. Step-by-step derivation
    1. unpow280.1%

      \[\leadsto -\color{blue}{\left(a \cdot a\right)} \cdot {b}^{2} \]
    2. unpow280.1%

      \[\leadsto -\left(a \cdot a\right) \cdot \color{blue}{\left(b \cdot b\right)} \]
    3. swap-sqr99.7%

      \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
    4. unpow299.7%

      \[\leadsto -\color{blue}{{\left(a \cdot b\right)}^{2}} \]
  5. Simplified99.7%

    \[\leadsto -\color{blue}{{\left(a \cdot b\right)}^{2}} \]
  6. Step-by-step derivation
    1. unpow299.7%

      \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
  7. Applied egg-rr99.7%

    \[\leadsto -\color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
  8. Final simplification99.7%

    \[\leadsto \left(a \cdot b\right) \cdot \left(a \cdot \left(-b\right)\right) \]
  9. Add Preprocessing

Alternative 3: 28.3% accurate, 1.1× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ b\_m \cdot \left(a\_m \cdot \left(a\_m \cdot b\_m\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m) :precision binary64 (* b_m (* a_m (* a_m b_m))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m) {
	return b_m * (a_m * (a_m * b_m));
}
a_m = abs(a)
b_m = abs(b)
real(8) function code(a_m, b_m)
    real(8), intent (in) :: a_m
    real(8), intent (in) :: b_m
    code = b_m * (a_m * (a_m * b_m))
end function
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m) {
	return b_m * (a_m * (a_m * b_m));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m):
	return b_m * (a_m * (a_m * b_m))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m)
	return Float64(b_m * Float64(a_m * Float64(a_m * b_m)))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m)
	tmp = b_m * (a_m * (a_m * b_m));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_] := N[(b$95$m * N[(a$95$m * N[(a$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
b\_m \cdot \left(a\_m \cdot \left(a\_m \cdot b\_m\right)\right)
\end{array}
Derivation
  1. Initial program 84.2%

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
  2. Step-by-step derivation
    1. distribute-rgt-neg-in84.2%

      \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot b\right) \cdot \left(-b\right)} \]
    2. associate-*l*92.9%

      \[\leadsto \color{blue}{\left(a \cdot \left(a \cdot b\right)\right)} \cdot \left(-b\right) \]
  3. Simplified92.9%

    \[\leadsto \color{blue}{\left(a \cdot \left(a \cdot b\right)\right) \cdot \left(-b\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. neg-sub092.9%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{\left(0 - b\right)} \]
    2. sub-neg92.9%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{\left(0 + \left(-b\right)\right)} \]
    3. add-sqr-sqrt44.3%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \left(0 + \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right) \]
    4. sqrt-unprod54.2%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \left(0 + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right) \]
    5. sqr-neg54.2%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \left(0 + \sqrt{\color{blue}{b \cdot b}}\right) \]
    6. sqrt-unprod14.9%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \left(0 + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \]
    7. add-sqr-sqrt26.2%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \left(0 + \color{blue}{b}\right) \]
  6. Applied egg-rr26.2%

    \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{\left(0 + b\right)} \]
  7. Step-by-step derivation
    1. +-lft-identity26.2%

      \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{b} \]
  8. Simplified26.2%

    \[\leadsto \left(a \cdot \left(a \cdot b\right)\right) \cdot \color{blue}{b} \]
  9. Final simplification26.2%

    \[\leadsto b \cdot \left(a \cdot \left(a \cdot b\right)\right) \]
  10. Add Preprocessing

Alternative 4: 28.2% accurate, 1.1× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ \left(a\_m \cdot b\_m\right) \cdot \left(a\_m \cdot b\_m\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m) :precision binary64 (* (* a_m b_m) (* a_m b_m)))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m) {
	return (a_m * b_m) * (a_m * b_m);
}
a_m = abs(a)
b_m = abs(b)
real(8) function code(a_m, b_m)
    real(8), intent (in) :: a_m
    real(8), intent (in) :: b_m
    code = (a_m * b_m) * (a_m * b_m)
end function
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m) {
	return (a_m * b_m) * (a_m * b_m);
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m):
	return (a_m * b_m) * (a_m * b_m)
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m)
	return Float64(Float64(a_m * b_m) * Float64(a_m * b_m))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m)
	tmp = (a_m * b_m) * (a_m * b_m);
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_] := N[(N[(a$95$m * b$95$m), $MachinePrecision] * N[(a$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
\left(a\_m \cdot b\_m\right) \cdot \left(a\_m \cdot b\_m\right)
\end{array}
Derivation
  1. Initial program 84.2%

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt25.3%

      \[\leadsto \color{blue}{\sqrt{-\left(\left(a \cdot a\right) \cdot b\right) \cdot b} \cdot \sqrt{-\left(\left(a \cdot a\right) \cdot b\right) \cdot b}} \]
    2. sqrt-unprod26.2%

      \[\leadsto \color{blue}{\sqrt{\left(-\left(\left(a \cdot a\right) \cdot b\right) \cdot b\right) \cdot \left(-\left(\left(a \cdot a\right) \cdot b\right) \cdot b\right)}} \]
    3. sqr-neg26.2%

      \[\leadsto \sqrt{\color{blue}{\left(\left(\left(a \cdot a\right) \cdot b\right) \cdot b\right) \cdot \left(\left(\left(a \cdot a\right) \cdot b\right) \cdot b\right)}} \]
    4. sqrt-unprod26.2%

      \[\leadsto \color{blue}{\sqrt{\left(\left(a \cdot a\right) \cdot b\right) \cdot b} \cdot \sqrt{\left(\left(a \cdot a\right) \cdot b\right) \cdot b}} \]
    5. add-sqr-sqrt26.2%

      \[\leadsto \color{blue}{\left(\left(a \cdot a\right) \cdot b\right) \cdot b} \]
    6. associate-*l*25.9%

      \[\leadsto \color{blue}{\left(a \cdot a\right) \cdot \left(b \cdot b\right)} \]
    7. swap-sqr26.1%

      \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
  4. Applied egg-rr26.1%

    \[\leadsto \color{blue}{\left(a \cdot b\right) \cdot \left(a \cdot b\right)} \]
  5. Add Preprocessing

Alternative 5: 28.3% accurate, 1.1× speedup?

\[\begin{array}{l} a_m = \left|a\right| \\ b_m = \left|b\right| \\ a\_m \cdot \left(b\_m \cdot \left(a\_m \cdot b\_m\right)\right) \end{array} \]
a_m = (fabs.f64 a)
b_m = (fabs.f64 b)
(FPCore (a_m b_m) :precision binary64 (* a_m (* b_m (* a_m b_m))))
a_m = fabs(a);
b_m = fabs(b);
double code(double a_m, double b_m) {
	return a_m * (b_m * (a_m * b_m));
}
a_m = abs(a)
b_m = abs(b)
real(8) function code(a_m, b_m)
    real(8), intent (in) :: a_m
    real(8), intent (in) :: b_m
    code = a_m * (b_m * (a_m * b_m))
end function
a_m = Math.abs(a);
b_m = Math.abs(b);
public static double code(double a_m, double b_m) {
	return a_m * (b_m * (a_m * b_m));
}
a_m = math.fabs(a)
b_m = math.fabs(b)
def code(a_m, b_m):
	return a_m * (b_m * (a_m * b_m))
a_m = abs(a)
b_m = abs(b)
function code(a_m, b_m)
	return Float64(a_m * Float64(b_m * Float64(a_m * b_m)))
end
a_m = abs(a);
b_m = abs(b);
function tmp = code(a_m, b_m)
	tmp = a_m * (b_m * (a_m * b_m));
end
a_m = N[Abs[a], $MachinePrecision]
b_m = N[Abs[b], $MachinePrecision]
code[a$95$m_, b$95$m_] := N[(a$95$m * N[(b$95$m * N[(a$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
b_m = \left|b\right|

\\
a\_m \cdot \left(b\_m \cdot \left(a\_m \cdot b\_m\right)\right)
\end{array}
Derivation
  1. Initial program 84.2%

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b \]
  2. Step-by-step derivation
    1. associate-*l*80.1%

      \[\leadsto -\color{blue}{\left(a \cdot a\right) \cdot \left(b \cdot b\right)} \]
    2. associate-*r*84.8%

      \[\leadsto -\color{blue}{a \cdot \left(a \cdot \left(b \cdot b\right)\right)} \]
    3. *-commutative84.8%

      \[\leadsto -a \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot a\right)} \]
    4. distribute-rgt-neg-in84.8%

      \[\leadsto \color{blue}{a \cdot \left(-\left(b \cdot b\right) \cdot a\right)} \]
    5. distribute-rgt-neg-in84.8%

      \[\leadsto a \cdot \color{blue}{\left(\left(b \cdot b\right) \cdot \left(-a\right)\right)} \]
    6. associate-*r*96.2%

      \[\leadsto a \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(-a\right)\right)\right)} \]
  3. Simplified96.2%

    \[\leadsto \color{blue}{a \cdot \left(b \cdot \left(b \cdot \left(-a\right)\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. neg-sub096.2%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \color{blue}{\left(0 - a\right)}\right)\right) \]
    2. sub-neg96.2%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \color{blue}{\left(0 + \left(-a\right)\right)}\right)\right) \]
    3. add-sqr-sqrt47.6%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \left(0 + \color{blue}{\sqrt{-a} \cdot \sqrt{-a}}\right)\right)\right) \]
    4. sqrt-unprod55.3%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \left(0 + \color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}\right)\right)\right) \]
    5. sqr-neg55.3%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \left(0 + \sqrt{\color{blue}{a \cdot a}}\right)\right)\right) \]
    6. sqrt-prod14.8%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \left(0 + \color{blue}{\sqrt{a} \cdot \sqrt{a}}\right)\right)\right) \]
    7. add-sqr-sqrt26.1%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \left(0 + \color{blue}{a}\right)\right)\right) \]
  6. Applied egg-rr26.1%

    \[\leadsto a \cdot \left(b \cdot \left(b \cdot \color{blue}{\left(0 + a\right)}\right)\right) \]
  7. Step-by-step derivation
    1. +-lft-identity26.1%

      \[\leadsto a \cdot \left(b \cdot \left(b \cdot \color{blue}{a}\right)\right) \]
  8. Simplified26.1%

    \[\leadsto a \cdot \left(b \cdot \left(b \cdot \color{blue}{a}\right)\right) \]
  9. Final simplification26.1%

    \[\leadsto a \cdot \left(b \cdot \left(a \cdot b\right)\right) \]
  10. Add Preprocessing

Reproduce

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