Average Error: 16.6 → 0.3
Time: 25.0s
Precision: binary64
Cost: 512
\[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b\]
\[-\left(b \cdot a\right) \cdot \left(b \cdot a\right)\]
-\left(\left(a \cdot a\right) \cdot b\right) \cdot b
-\left(b \cdot a\right) \cdot \left(b \cdot a\right)
(FPCore (a b angle) :precision binary64 (- (* (* (* a a) b) b)))
(FPCore (a b angle) :precision binary64 (- (* (* b a) (* b a))))
double code(double a, double b, double angle) {
	return -(((a * a) * b) * b);
}
double code(double a, double b, double angle) {
	return -((b * a) * (b * a));
}

Error

Bits error versus a

Bits error versus b

Bits error versus angle

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error5.5
Cost512
\[-a \cdot \left(b \cdot \left(b \cdot a\right)\right)\]
Alternative 2
Error38.4
Cost64
\[0\]
Alternative 3
Error61.0
Cost64
\[-1\]

Error

Derivation

  1. Initial program 16.6

    \[-\left(\left(a \cdot a\right) \cdot b\right) \cdot b\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary6416.7

    \[\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}}\]
  4. Simplified16.6

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

    \[\leadsto -\left|a \cdot b\right| \cdot \color{blue}{\left|a \cdot b\right|}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity_binary640.3

    \[\leadsto -\left|a \cdot b\right| \cdot \color{blue}{\left(1 \cdot \left|a \cdot b\right|\right)}\]
  8. Applied *-un-lft-identity_binary640.3

    \[\leadsto -\color{blue}{\left(1 \cdot \left|a \cdot b\right|\right)} \cdot \left(1 \cdot \left|a \cdot b\right|\right)\]
  9. Applied swap-sqr_binary640.3

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

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

    \[\leadsto -1 \cdot \color{blue}{{\left(a \cdot b\right)}^{2}}\]
  12. Using strategy rm
  13. Applied unpow2_binary640.3

    \[\leadsto -1 \cdot \color{blue}{\left(\left(a \cdot b\right) \cdot \left(a \cdot b\right)\right)}\]
  14. Using strategy rm
  15. Applied *-un-lft-identity_binary640.3

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

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

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

Reproduce

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