?

Average Error: 30.9 → 30.9
Time: 16.5s
Precision: binary64
Cost: 39488

?

\[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
\[\begin{array}{l} t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\ 2 \cdot \left(\sin t_0 \cdot \left(\cos t_0 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \end{array} \]
(FPCore (a b angle)
 :precision binary64
 (*
  (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0))))
  (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
 :precision binary64
 (let* ((t_0 (* PI (* 0.005555555555555556 angle))))
   (* 2.0 (* (sin t_0) (* (cos t_0) (- (pow b 2.0) (pow a 2.0)))))))
double code(double a, double b, double angle) {
	return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
	double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
	return 2.0 * (sin(t_0) * (cos(t_0) * (pow(b, 2.0) - pow(a, 2.0))));
}
public static double code(double a, double b, double angle) {
	return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos((Math.PI * (angle / 180.0)));
}
public static double code(double a, double b, double angle) {
	double t_0 = Math.PI * (0.005555555555555556 * angle);
	return 2.0 * (Math.sin(t_0) * (Math.cos(t_0) * (Math.pow(b, 2.0) - Math.pow(a, 2.0))));
}
def code(a, b, angle):
	return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin((math.pi * (angle / 180.0)))) * math.cos((math.pi * (angle / 180.0)))
def code(a, b, angle):
	t_0 = math.pi * (0.005555555555555556 * angle)
	return 2.0 * (math.sin(t_0) * (math.cos(t_0) * (math.pow(b, 2.0) - math.pow(a, 2.0))))
function code(a, b, angle)
	return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0))))
end
function code(a, b, angle)
	t_0 = Float64(pi * Float64(0.005555555555555556 * angle))
	return Float64(2.0 * Float64(sin(t_0) * Float64(cos(t_0) * Float64((b ^ 2.0) - (a ^ 2.0)))))
end
function tmp = code(a, b, angle)
	tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin((pi * (angle / 180.0)))) * cos((pi * (angle / 180.0)));
end
function tmp = code(a, b, angle)
	t_0 = pi * (0.005555555555555556 * angle);
	tmp = 2.0 * (sin(t_0) * (cos(t_0) * ((b ^ 2.0) - (a ^ 2.0))));
end
code[a_, b_, angle_] := N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, N[(2.0 * N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
2 \cdot \left(\sin t_0 \cdot \left(\cos t_0 \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 30.9

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Simplified30.9

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

    [Start]30.9

    \[ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    rational.json-simplify-2 [=>]30.9

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

    rational.json-simplify-2 [=>]30.9

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

    rational.json-simplify-2 [=>]30.9

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

    rational.json-simplify-31 [=>]30.9

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

    rational.json-simplify-31 [=>]30.9

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

    rational.json-simplify-2 [=>]30.9

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

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

    \[\leadsto \color{blue}{2 \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)} \]
  5. Simplified30.9

    \[\leadsto \color{blue}{2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]
    Proof

    [Start]30.9

    \[ 2 \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]

    rational.json-simplify-2 [=>]30.9

    \[ 2 \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \color{blue}{\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)}\right) \]

    rational.json-simplify-31 [=>]30.9

    \[ 2 \cdot \color{blue}{\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right)} \]

    rational.json-simplify-2 [=>]30.9

    \[ 2 \cdot \left(\sin \left(0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot angle\right)}\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]

    rational.json-simplify-31 [=>]31.0

    \[ 2 \cdot \left(\sin \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)} \cdot \left(\cos \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]

    rational.json-simplify-2 [=>]31.0

    \[ 2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos \left(0.005555555555555556 \cdot \color{blue}{\left(\pi \cdot angle\right)}\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]

    rational.json-simplify-31 [=>]30.9

    \[ 2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos \color{blue}{\left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right)} \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]
  6. Final simplification30.9

    \[\leadsto 2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]

Alternatives

Alternative 1
Error31.0
Cost39488
\[2 \cdot \left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]
Alternative 2
Error30.9
Cost39488
\[2 \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(\cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left({b}^{2} - {a}^{2}\right)\right)\right) \]
Alternative 3
Error32.1
Cost33092
\[\begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-281}:\\ \;\;\;\;\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-2 \cdot {a}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot {b}^{2}\right)\right) \cdot 1\\ \end{array} \]
Alternative 4
Error32.2
Cost32964
\[\begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq -2 \cdot 10^{-281}:\\ \;\;\;\;\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(-2 \cdot {a}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot {b}^{2}\right)\\ \end{array} \]
Alternative 5
Error31.9
Cost26368
\[\sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \]
Alternative 6
Error36.7
Cost20040
\[\begin{array}{l} t_0 := 2 \cdot \left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot {b}^{2}\right)\\ \mathbf{if}\;b \leq -3.2 \cdot 10^{-37}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-62}:\\ \;\;\;\;{a}^{2} \cdot \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 7
Error37.4
Cost13512
\[\begin{array}{l} t_0 := 0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{if}\;b \leq -4.5 \cdot 10^{-37}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 4.7 \cdot 10^{-62}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left({a}^{2} \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Error37.4
Cost13512
\[\begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{-36}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-62}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left({a}^{2} \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(0.011111111111111112 \cdot \left(\pi \cdot {b}^{2}\right)\right)\\ \end{array} \]
Alternative 9
Error37.4
Cost13512
\[\begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{-37}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 9.3 \cdot 10^{-63}:\\ \;\;\;\;angle \cdot \left(-0.011111111111111112 \cdot \left({a}^{2} \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 10
Error37.5
Cost13512
\[\begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{-38}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-62}:\\ \;\;\;\;angle \cdot \left({a}^{2} \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 11
Error37.5
Cost13512
\[\begin{array}{l} \mathbf{if}\;b \leq -7.6 \cdot 10^{-39}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 5.8 \cdot 10^{-62}:\\ \;\;\;\;\left(angle \cdot \left({a}^{2} \cdot \pi\right)\right) \cdot -0.011111111111111112\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 12
Error37.4
Cost13512
\[\begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{-37}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 6.3 \cdot 10^{-62}:\\ \;\;\;\;{a}^{2} \cdot \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 13
Error37.4
Cost13512
\[\begin{array}{l} \mathbf{if}\;b \leq -8 \cdot 10^{-36}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right)\\ \mathbf{elif}\;b \leq 4.1 \cdot 10^{-62}:\\ \;\;\;\;{a}^{2} \cdot \left(angle \cdot \left(\pi \cdot -0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;{b}^{2} \cdot \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 14
Error43.2
Cost13248
\[0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot {b}^{2}\right)\right) \]

Error

Reproduce?

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