?

Average Accuracy: 51.5% → 67.2%
Time: 19.8s
Precision: binary64
Cost: 13824

?

\[\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 \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot 0.5\right)\right)\right) \]
(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
 (*
  2.0
  (* (+ b a) (* (- b a) (* (sin (* PI (* angle 0.011111111111111112))) 0.5)))))
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) {
	return 2.0 * ((b + a) * ((b - a) * (sin((((double) M_PI) * (angle * 0.011111111111111112))) * 0.5)));
}
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) {
	return 2.0 * ((b + a) * ((b - a) * (Math.sin((Math.PI * (angle * 0.011111111111111112))) * 0.5)));
}
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):
	return 2.0 * ((b + a) * ((b - a) * (math.sin((math.pi * (angle * 0.011111111111111112))) * 0.5)))
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)
	return Float64(2.0 * Float64(Float64(b + a) * Float64(Float64(b - a) * Float64(sin(Float64(pi * Float64(angle * 0.011111111111111112))) * 0.5))))
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)
	tmp = 2.0 * ((b + a) * ((b - a) * (sin((pi * (angle * 0.011111111111111112))) * 0.5)));
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_] := N[(2.0 * N[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[(N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $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)
2 \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot 0.5\right)\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 51.5%

    \[\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. Simplified51.6%

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

    [Start]51.5

    \[ \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) \]

    associate-*l* [=>]51.5

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

    associate-*l* [=>]51.6

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

    unpow2 [=>]51.6

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

    unpow2 [=>]51.6

    \[ 2 \cdot \left(\left(b \cdot b - \color{blue}{a \cdot a}\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
  3. Applied egg-rr51.5%

    \[\leadsto 2 \cdot \color{blue}{\frac{b \cdot b - a \cdot a}{\frac{2}{\sin 0 + \sin \left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)}}} \]
  4. Applied egg-rr67.2%

    \[\leadsto 2 \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot 0.5\right)\right)\right)} \]
  5. Final simplification67.2%

    \[\leadsto 2 \cdot \left(\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \left(\sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right) \cdot 0.5\right)\right)\right) \]

Alternatives

Alternative 1
Accuracy65.2%
Cost13960
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00041:\\ \;\;\;\;2 \cdot \left(\left(b \cdot b\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\ \mathbf{elif}\;angle \leq 1.75:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.5 \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy65.2%
Cost13833
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00036 \lor \neg \left(angle \leq 1.75\right):\\ \;\;\;\;2 \cdot \left(0.5 \cdot \left(\left(b \cdot b\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\right)\\ \end{array} \]
Alternative 3
Accuracy64.2%
Cost13832
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00041:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{elif}\;angle \leq 0.042:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(-0.5 \cdot \left(a \cdot \left(a \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\right)\\ \end{array} \]
Alternative 4
Accuracy65.2%
Cost13832
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00036:\\ \;\;\;\;2 \cdot \left(\left(b \cdot b\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right)\\ \mathbf{elif}\;angle \leq 1.75:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(0.5 \cdot \left(\left(b \cdot b\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\ \end{array} \]
Alternative 5
Accuracy54.8%
Cost7560
\[\begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{+146}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{+135}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 6
Accuracy54.8%
Cost7560
\[\begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{+134}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(\left(\pi \cdot angle\right) \cdot \left(b \cdot b - a \cdot a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 7
Accuracy61.3%
Cost7428
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00041:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\left(b - a\right) \cdot \pi\right)\right)\right)\right)\\ \end{array} \]
Alternative 8
Accuracy61.3%
Cost7428
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00041:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(b + a\right) \cdot \left(0.005555555555555556 \cdot \left(\pi \cdot \left(\left(b - a\right) \cdot angle\right)\right)\right)\right)\\ \end{array} \]
Alternative 9
Accuracy40.0%
Cost7305
\[\begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+67} \lor \neg \left(b \leq 3.1 \cdot 10^{+94}\right):\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right)\\ \end{array} \]
Alternative 10
Accuracy40.0%
Cost7305
\[\begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{+63} \lor \neg \left(b \leq 6.7 \cdot 10^{+105}\right):\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \]
Alternative 11
Accuracy40.1%
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq -1.75 \cdot 10^{+68}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+134}:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 0.005555555555555556\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 12
Accuracy49.1%
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq -1.75 \cdot 10^{-89}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{elif}\;b \leq 2.25 \cdot 10^{-77}:\\ \;\;\;\;2 \cdot \left(-0.005555555555555556 \cdot \left(angle \cdot \left(\pi \cdot \left(a \cdot a\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 13
Accuracy49.2%
Cost7304
\[\begin{array}{l} \mathbf{if}\;b \leq -3.2 \cdot 10^{-88}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(b \cdot \left(\pi \cdot \left(b \cdot angle\right)\right)\right)\right)\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-77}:\\ \;\;\;\;2 \cdot \left(\left(\pi \cdot \left(angle \cdot \left(a \cdot a\right)\right)\right) \cdot -0.005555555555555556\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(b \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 14
Accuracy32.2%
Cost6912
\[angle \cdot \left(0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \pi\right)\right)\right) \]
Alternative 15
Accuracy32.2%
Cost6912
\[\pi \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot b\right)\right)\right) \]

Error

Reproduce?

herbie shell --seed 2023122 
(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)))))