ab-angle->ABCF B

Percentage Accurate: 53.9% → 53.9%
Time: 2.6s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\mathsf{TRUE}\left(\right)\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (PI) (/ angle 180.0))))
   (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\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 9 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: 53.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (PI) (/ angle 180.0))))
   (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}

Alternative 1: 53.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ t_1 := {b}^{2} - {a}^{2}\\ \mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+18}:\\ \;\;\;\;\left(\left(2 \cdot t\_1\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (PI) (/ angle 180.0))) (t_1 (- (pow b 2.0) (pow a 2.0))))
   (if (<= (/ angle 180.0) 5e+18)
     (* (* (* 2.0 t_1) (sin t_0)) (cos t_0))
     t_1)))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
t_1 := {b}^{2} - {a}^{2}\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+18}:\\
\;\;\;\;\left(\left(2 \cdot t\_1\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 angle #s(literal 180 binary64)) < 5e18

    1. Initial program 61.9%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing

    if 5e18 < (/.f64 angle #s(literal 180 binary64))

    1. Initial program 27.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites32.7%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto -2 \cdot \left({a}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    6. Applied rewrites39.7%

      \[\leadsto {b}^{2} - \color{blue}{{a}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 46.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ t_1 := \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\ \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-221}:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot {b}^{2}\right) \cdot t\_1\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (pow b 2.0) (pow a 2.0))) (t_1 (sin (* (PI) (/ angle 180.0)))))
   (if (<= t_0 2e-221) (* t_0 t_1) (* (* 2.0 (pow b 2.0)) t_1))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
t_1 := \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-221}:\\
\;\;\;\;t\_0 \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot {b}^{2}\right) \cdot t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000003e-221

    1. Initial program 60.8%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites60.2%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(-2 \cdot {a}^{2} + 2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    6. Applied rewrites42.9%

      \[\leadsto \left({b}^{2} - {a}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]

    if 2.00000000000000003e-221 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 45.6%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites43.5%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    6. Applied rewrites48.9%

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 42.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+73}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (pow b 2.0) (pow a 2.0))))
   (if (<= t_0 -5e+73)
     t_0
     (* (* 2.0 (pow b 2.0)) (sin (* (PI) (/ angle 180.0)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999976e73

    1. Initial program 50.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites50.0%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto -2 \cdot \left({a}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    6. Applied rewrites23.9%

      \[\leadsto {b}^{2} - \color{blue}{{a}^{2}} \]

    if -4.99999999999999976e73 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 55.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites53.4%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    6. Applied rewrites50.5%

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 34.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+73}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;{b}^{2} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (pow b 2.0) (pow a 2.0))))
   (if (<= t_0 -5e+73) t_0 (* (pow b 2.0) (sin (* (PI) (/ angle 180.0)))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;{b}^{2} \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999976e73

    1. Initial program 50.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites50.0%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto -2 \cdot \left({a}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    6. Applied rewrites23.9%

      \[\leadsto {b}^{2} - \color{blue}{{a}^{2}} \]

    if -4.99999999999999976e73 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 55.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites53.4%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    6. Applied rewrites50.5%

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    7. Taylor expanded in b around 0

      \[\leadsto \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    8. Applied rewrites53.5%

      \[\leadsto \left(2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    9. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    10. Applied rewrites40.2%

      \[\leadsto {b}^{2} \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 28.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {b}^{2} - {a}^{2}\\ \mathbf{if}\;t\_0 \leq -5 \cdot 10^{+73}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;{b}^{2}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (- (pow b 2.0) (pow a 2.0))))
   (if (<= t_0 -5e+73) t_0 (pow b 2.0))))
double code(double a, double b, double angle) {
	double t_0 = pow(b, 2.0) - pow(a, 2.0);
	double tmp;
	if (t_0 <= -5e+73) {
		tmp = t_0;
	} else {
		tmp = pow(b, 2.0);
	}
	return tmp;
}
real(8) function code(a, b, angle)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (b ** 2.0d0) - (a ** 2.0d0)
    if (t_0 <= (-5d+73)) then
        tmp = t_0
    else
        tmp = b ** 2.0d0
    end if
    code = tmp
end function
public static double code(double a, double b, double angle) {
	double t_0 = Math.pow(b, 2.0) - Math.pow(a, 2.0);
	double tmp;
	if (t_0 <= -5e+73) {
		tmp = t_0;
	} else {
		tmp = Math.pow(b, 2.0);
	}
	return tmp;
}
def code(a, b, angle):
	t_0 = math.pow(b, 2.0) - math.pow(a, 2.0)
	tmp = 0
	if t_0 <= -5e+73:
		tmp = t_0
	else:
		tmp = math.pow(b, 2.0)
	return tmp
function code(a, b, angle)
	t_0 = Float64((b ^ 2.0) - (a ^ 2.0))
	tmp = 0.0
	if (t_0 <= -5e+73)
		tmp = t_0;
	else
		tmp = b ^ 2.0;
	end
	return tmp
end
function tmp_2 = code(a, b, angle)
	t_0 = (b ^ 2.0) - (a ^ 2.0);
	tmp = 0.0;
	if (t_0 <= -5e+73)
		tmp = t_0;
	else
		tmp = b ^ 2.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+73], t$95$0, N[Power[b, 2.0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {b}^{2} - {a}^{2}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;{b}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999976e73

    1. Initial program 50.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites50.0%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto -2 \cdot \left({a}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) + \color{blue}{2 \cdot \left({b}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    6. Applied rewrites23.9%

      \[\leadsto {b}^{2} - \color{blue}{{a}^{2}} \]

    if -4.99999999999999976e73 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))

    1. Initial program 55.3%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites53.4%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    6. Applied rewrites38.0%

      \[\leadsto \left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    7. Taylor expanded in a around inf

      \[\leadsto {a}^{2} \cdot \color{blue}{\left(-2 \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) + 2 \cdot \frac{{b}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{{a}^{2}}\right)} \]
    8. Applied rewrites34.9%

      \[\leadsto {b}^{\color{blue}{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 53.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\ t_1 := \sin t\_0\\ \mathbf{if}\;b \leq 1.3 \cdot 10^{+154}:\\ \;\;\;\;\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;\left({b}^{2} \cdot \cos t\_0\right) \cdot t\_1\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* (PI) (/ angle 180.0))) (t_1 (sin t_0)))
   (if (<= b 1.3e+154)
     (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1)
     (* (* (pow b 2.0) (cos t_0)) t_1))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{angle}{180}\\
t_1 := \sin t\_0\\
\mathbf{if}\;b \leq 1.3 \cdot 10^{+154}:\\
\;\;\;\;\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;\left({b}^{2} \cdot \cos t\_0\right) \cdot t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.29999999999999994e154

    1. Initial program 56.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites56.5%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]

    if 1.29999999999999994e154 < b

    1. Initial program 34.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites26.3%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    6. Applied rewrites40.2%

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    7. Taylor expanded in b around 0

      \[\leadsto \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    8. Applied rewrites26.3%

      \[\leadsto \left(2 \cdot \left(\left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\frac{angle}{180}}\right) \]
    9. Taylor expanded in a around inf

      \[\leadsto \left(-2 \cdot {a}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    10. Applied rewrites48.6%

      \[\leadsto \left({b}^{2} \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 52.1% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot {b}^{2}\\ \end{array} \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (if (<= b 1.2e+154)
   (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (PI) (/ angle 180.0))))
   (* 2.0 (pow b 2.0))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.2 \cdot 10^{+154}:\\
\;\;\;\;\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot {b}^{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.20000000000000007e154

    1. Initial program 56.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites56.5%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]

    if 1.20000000000000007e154 < b

    1. Initial program 34.7%

      \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
    4. Applied rewrites26.3%

      \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    5. Taylor expanded in a around 0

      \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    6. Applied rewrites34.7%

      \[\leadsto \left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
    7. Taylor expanded in a around inf

      \[\leadsto -2 \cdot \color{blue}{\left({a}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    8. Applied rewrites47.8%

      \[\leadsto 2 \cdot \color{blue}{{b}^{2}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 21.3% accurate, 4.4× speedup?

\[\begin{array}{l} \\ {b}^{2} \end{array} \]
(FPCore (a b angle) :precision binary64 (pow b 2.0))
double code(double a, double b, double angle) {
	return pow(b, 2.0);
}
real(8) function code(a, b, angle)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: angle
    code = b ** 2.0d0
end function
public static double code(double a, double b, double angle) {
	return Math.pow(b, 2.0);
}
def code(a, b, angle):
	return math.pow(b, 2.0)
function code(a, b, angle)
	return b ^ 2.0
end
function tmp = code(a, b, angle)
	tmp = b ^ 2.0;
end
code[a_, b_, angle_] := N[Power[b, 2.0], $MachinePrecision]
\begin{array}{l}

\\
{b}^{2}
\end{array}
Derivation
  1. Initial program 53.6%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in a around 0

    \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
  4. Applied rewrites52.3%

    \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
  5. Taylor expanded in a around 0

    \[\leadsto \left(2 \cdot {b}^{2}\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
  6. Applied rewrites36.5%

    \[\leadsto \left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
  7. Taylor expanded in a around inf

    \[\leadsto {a}^{2} \cdot \color{blue}{\left(-2 \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) + 2 \cdot \frac{{b}^{2} \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}{{a}^{2}}\right)} \]
  8. Applied rewrites24.0%

    \[\leadsto {b}^{\color{blue}{2}} \]
  9. Add Preprocessing

Alternative 9: 3.2% accurate, 26.6× speedup?

\[\begin{array}{l} \\ \mathsf{PI}\left(\right) \cdot \frac{angle}{180} \end{array} \]
(FPCore (a b angle) :precision binary64 (* (PI) (/ angle 180.0)))
\begin{array}{l}

\\
\mathsf{PI}\left(\right) \cdot \frac{angle}{180}
\end{array}
Derivation
  1. Initial program 53.6%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right) \]
  2. Add Preprocessing
  3. Taylor expanded in a around 0

    \[\leadsto \color{blue}{-2 \cdot \left({a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) + 2 \cdot \left({b}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
  4. Applied rewrites52.3%

    \[\leadsto \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\mathsf{PI}\left(\right) \cdot \frac{angle}{180}\right)} \]
  5. Taylor expanded in b around inf

    \[\leadsto \color{blue}{{b}^{2} \cdot \left(-2 \cdot \frac{{a}^{2} \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}{{b}^{2}} + 2 \cdot \left(\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)} \]
  6. Applied rewrites2.9%

    \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{angle}{180}} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024321 
(FPCore (a b angle)
  :name "ab-angle->ABCF B"
  :precision binary64
  :pre (TRUE)
  (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (PI) (/ angle 180.0)))) (cos (* (PI) (/ angle 180.0)))))