?

Average Error: 31.2 → 31.3
Time: 25.0s
Precision: binary64
Cost: 65728

?

\[\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(\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) + \cos \left(\pi \cdot \left(angle \cdot 0.016666666666666666\right)\right)\right) - \cos \left(angle \cdot \left(\pi \cdot -0.016666666666666666\right)\right)\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\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
  (*
   (-
    (+
     (cos (* PI (* angle 0.005555555555555556)))
     (cos (* PI (* angle 0.016666666666666666))))
    (cos (* angle (* PI -0.016666666666666666))))
   (* (- (pow b 2.0) (pow a 2.0)) (sin (* PI (/ angle 180.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) {
	return 2.0 * (((cos((((double) M_PI) * (angle * 0.005555555555555556))) + cos((((double) M_PI) * (angle * 0.016666666666666666)))) - cos((angle * (((double) M_PI) * -0.016666666666666666)))) * ((pow(b, 2.0) - pow(a, 2.0)) * sin((((double) M_PI) * (angle / 180.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) {
	return 2.0 * (((Math.cos((Math.PI * (angle * 0.005555555555555556))) + Math.cos((Math.PI * (angle * 0.016666666666666666)))) - Math.cos((angle * (Math.PI * -0.016666666666666666)))) * ((Math.pow(b, 2.0) - Math.pow(a, 2.0)) * Math.sin((Math.PI * (angle / 180.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):
	return 2.0 * (((math.cos((math.pi * (angle * 0.005555555555555556))) + math.cos((math.pi * (angle * 0.016666666666666666)))) - math.cos((angle * (math.pi * -0.016666666666666666)))) * ((math.pow(b, 2.0) - math.pow(a, 2.0)) * math.sin((math.pi * (angle / 180.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)
	return Float64(2.0 * Float64(Float64(Float64(cos(Float64(pi * Float64(angle * 0.005555555555555556))) + cos(Float64(pi * Float64(angle * 0.016666666666666666)))) - cos(Float64(angle * Float64(pi * -0.016666666666666666)))) * Float64(Float64((b ^ 2.0) - (a ^ 2.0)) * sin(Float64(pi * Float64(angle / 180.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)
	tmp = 2.0 * (((cos((pi * (angle * 0.005555555555555556))) + cos((pi * (angle * 0.016666666666666666)))) - cos((angle * (pi * -0.016666666666666666)))) * (((b ^ 2.0) - (a ^ 2.0)) * sin((pi * (angle / 180.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_] := N[(2.0 * N[(N[(N[(N[Cos[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[Cos[N[(Pi * N[(angle * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Cos[N[(angle * N[(Pi * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $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)
2 \cdot \left(\left(\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) + \cos \left(\pi \cdot \left(angle \cdot 0.016666666666666666\right)\right)\right) - \cos \left(angle \cdot \left(\pi \cdot -0.016666666666666666\right)\right)\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 31.2

    \[\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. Simplified31.2

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

    [Start]31.2

    \[ \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_best-simplify-2 [=>]31.2

    \[ \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_best-simplify-2 [=>]31.2

    \[ \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_best-simplify-46 [=>]31.2

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

    rational_best-simplify-46 [=>]31.2

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

    rational_best-simplify-2 [=>]31.2

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

    \[\leadsto 2 \cdot \left(\color{blue}{\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \cos \left(\pi \cdot \left(angle \cdot -0.011111111111111112\right)\right) - \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \sin \left(\pi \cdot \left(angle \cdot -0.011111111111111112\right)\right)\right)} \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
  4. Simplified31.3

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

    [Start]31.2

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

    trig-simplify-14 [=>]31.2

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

    rational_best-simplify-46 [=>]31.3

    \[ 2 \cdot \left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right) + \color{blue}{angle \cdot \left(\pi \cdot -0.011111111111111112\right)}\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
  5. Applied egg-rr31.3

    \[\leadsto 2 \cdot \left(\color{blue}{\left(\left(\cos \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) + \cos \left(\pi \cdot \left(angle \cdot 0.016666666666666666\right)\right)\right) - \cos \left(angle \cdot \left(\pi \cdot -0.016666666666666666\right)\right)\right)} \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)\right) \]
  6. Final simplification31.3

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

Alternatives

Alternative 1
Error33.2
Cost39684
\[\begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{-285}:\\ \;\;\;\;2 \cdot \left(1 \cdot \left(-1 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(\left(\pi \cdot 0.005555555555555556\right) \cdot \left(angle \cdot {b}^{2}\right)\right)\right)\\ \end{array} \]
Alternative 2
Error33.2
Cost39684
\[\begin{array}{l} \mathbf{if}\;{b}^{2} - {a}^{2} \leq 2 \cdot 10^{-285}:\\ \;\;\;\;2 \cdot \left(1 \cdot \left(-1 \cdot \left({a}^{2} \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left({b}^{2} \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\right)\\ \end{array} \]
Alternative 3
Error31.2
Cost39552
\[2 \cdot \left(\cos \left(\pi \cdot \frac{angle}{180}\right) \cdot \left(-\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot \left({a}^{2} - {b}^{2}\right)\right)\right) \]
Alternative 4
Error31.3
Cost39488
\[2 \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right) \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \cos \left(-0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)\right) \]
Alternative 5
Error31.2
Cost26496
\[2 \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \left(0.5 \cdot \sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\right) \]
Alternative 6
Error34.1
Cost19968
\[2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left(\left({b}^{2} - {a}^{2}\right) \cdot \pi\right)\right)\right) \]
Alternative 7
Error34.0
Cost19968
\[2 \cdot \left(angle \cdot \left(\left({a}^{2} - {b}^{2}\right) \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right) \]
Alternative 8
Error38.0
Cost13640
\[\begin{array}{l} t_0 := 2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\\ \mathbf{if}\;b \leq -2.4 \cdot 10^{-13}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 5.05 \cdot 10^{+20}:\\ \;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 9
Error38.0
Cost13640
\[\begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{-11}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{+20}:\\ \;\;\;\;-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
Alternative 10
Error38.0
Cost13640
\[\begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \left({b}^{2} \cdot \pi\right)\right)\right)\\ \mathbf{elif}\;b \leq 5.05 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left({a}^{2} \cdot \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
Alternative 11
Error37.9
Cost13640
\[\begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left({b}^{2} \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\ \mathbf{elif}\;b \leq 5.05 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left({a}^{2} \cdot \left(angle \cdot \left(\pi \cdot -0.005555555555555556\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(angle \cdot \left(\pi \cdot \left({b}^{2} \cdot 0.005555555555555556\right)\right)\right)\\ \end{array} \]
Alternative 12
Error43.3
Cost13248
\[-0.011111111111111112 \cdot \left(angle \cdot \left({a}^{2} \cdot \pi\right)\right) \]
Alternative 13
Error43.3
Cost13248
\[-0.011111111111111112 \cdot \left({a}^{2} \cdot \left(angle \cdot \pi\right)\right) \]

Error

Reproduce?

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