Initial program 98.5%
\[2 \cdot \cos \left(\frac{2 \cdot \mathsf{PI}\left(\right)}{3} + \frac{\cos^{-1} \left(\frac{-g}{h}\right)}{3}\right)
\]
- Add Preprocessing
Taylor expanded in g around 0
\[\leadsto \color{blue}{2 \cdot \cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)}
\]
Step-by-step derivation
metadata-evalN/A
\[\leadsto \color{blue}{\left(-1 \cdot -2\right)} \cdot \cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)
\]
metadata-evalN/A
\[\leadsto \left(-1 \cdot \color{blue}{\left(-1 + -1\right)}\right) \cdot \cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)
\]
*-commutativeN/A
\[\leadsto \color{blue}{\left(\left(-1 + -1\right) \cdot -1\right)} \cdot \cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)
\]
associate-*l*N/A
\[\leadsto \color{blue}{\left(-1 + -1\right) \cdot \left(-1 \cdot \cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)}
\]
mul-1-negN/A
\[\leadsto \left(-1 + -1\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}
\]
lower-*.f64N/A
\[\leadsto \color{blue}{\left(-1 + -1\right) \cdot \left(\mathsf{neg}\left(\cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}
\]
metadata-evalN/A
\[\leadsto \color{blue}{-2} \cdot \left(\mathsf{neg}\left(\cos \left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right)
\]
cos-neg-revN/A
\[\leadsto -2 \cdot \left(\mathsf{neg}\left(\color{blue}{\cos \left(\mathsf{neg}\left(\left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right)}\right)\right)
\]
cos-+PI-revN/A
\[\leadsto -2 \cdot \color{blue}{\cos \left(\left(\mathsf{neg}\left(\left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \mathsf{PI}\left(\right)\right)}
\]
remove-double-negN/A
\[\leadsto -2 \cdot \cos \left(\left(\mathsf{neg}\left(\left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)\right)\right)}\right)
\]
distribute-neg-outN/A
\[\leadsto -2 \cdot \cos \color{blue}{\left(\mathsf{neg}\left(\left(\left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)\right)\right)\right)}
\]
cos-negN/A
\[\leadsto -2 \cdot \color{blue}{\cos \left(\left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)\right)}
\]
lower-cos.f64N/A
\[\leadsto -2 \cdot \color{blue}{\cos \left(\left(\frac{1}{3} \cdot \cos^{-1} \left(-1 \cdot \frac{g}{h}\right) + \frac{2}{3} \cdot \mathsf{PI}\left(\right)\right) + \left(\mathsf{neg}\left(\mathsf{PI}\left(\right)\right)\right)\right)}
\]
Applied rewrites98.5%
\[\leadsto \color{blue}{-2 \cdot \cos \left(\mathsf{fma}\left(\cos^{-1} \left(\frac{-g}{h}\right), 0.3333333333333333, -0.3333333333333333 \cdot \mathsf{PI}\left(\right)\right)\right)}
\]
Applied rewrites100.0%
\[\leadsto -2 \cdot \sin \left(\mathsf{fma}\left(0.3333333333333333, \cos^{-1} \left(\frac{-g}{h}\right) - \mathsf{PI}\left(\right), \frac{\mathsf{PI}\left(\right)}{2}\right)\right)
\]
Taylor expanded in g around 0
\[\leadsto -2 \cdot \sin \left(\frac{1}{3} \cdot \left(\cos^{-1} \left(-1 \cdot \frac{g}{h}\right) - \mathsf{PI}\left(\right)\right) + \frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)
\]
Applied rewrites100.0%
\[\leadsto -2 \cdot \sin \left(\mathsf{fma}\left(\cos^{-1} \left(\frac{-g}{h}\right) - \mathsf{PI}\left(\right), 0.3333333333333333, 0.5 \cdot \mathsf{PI}\left(\right)\right)\right)
\]
- Add Preprocessing