Average Error: 30.8 → 20.7
Time: 29.7s
Precision: binary64
Cost: 13568
\[\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) \]
\[\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{\pi \cdot angle}{90}\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
 (* (+ b a) (* (- b a) (sin (/ (* PI angle) 90.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 (b + a) * ((b - a) * sin(((((double) M_PI) * angle) / 90.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 (b + a) * ((b - a) * Math.sin(((Math.PI * angle) / 90.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 (b + a) * ((b - a) * math.sin(((math.pi * angle) / 90.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(Float64(b + a) * Float64(Float64(b - a) * sin(Float64(Float64(pi * angle) / 90.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 = (b + a) * ((b - a) * sin(((pi * angle) / 90.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[(N[(b + a), $MachinePrecision] * N[(N[(b - a), $MachinePrecision] * N[Sin[N[(N[(Pi * angle), $MachinePrecision] / 90.0), $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)
\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\frac{\pi \cdot angle}{90}\right)\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.8

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

    \[\leadsto \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(angle \cdot 0.005555555555555556\right) \cdot \left(\pi + \pi\right)\right)} \]
    Proof
  3. Applied egg-rr20.7

    \[\leadsto \color{blue}{\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot 0.011111111111111112\right) \cdot \pi\right)\right)} \]
  4. Applied egg-rr21.3

    \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\color{blue}{{\left(\sqrt[3]{angle \cdot 0.011111111111111112}\right)}^{3}} \cdot \pi\right)\right) \]
  5. Applied egg-rr20.7

    \[\leadsto \left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \color{blue}{\left(\frac{\pi \cdot angle}{\frac{1}{0.011111111111111112}}\right)}\right) \]
  6. Simplified20.7

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

Alternatives

Alternative 1
Error24.0
Cost14096
\[\begin{array}{l} t_0 := \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\\ t_1 := \sin \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\\ \mathbf{if}\;b \leq -2.5 \cdot 10^{+118}:\\ \;\;\;\;\left(b + a\right) \cdot \left(t_1 \cdot b\right)\\ \mathbf{elif}\;b \leq -7.6 \cdot 10^{-109}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 8.8 \cdot 10^{-97}:\\ \;\;\;\;\left(b + a\right) \cdot \left(t_1 \cdot \left(-a\right)\right)\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{+120}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot b\right)\\ \end{array} \]
Alternative 2
Error24.5
Cost14096
\[\begin{array}{l} t_0 := \left(\left(b + a\right) \cdot \left(b - a\right)\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\\ t_1 := \sin \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right)\\ \mathbf{if}\;b \leq -2.6 \cdot 10^{+115}:\\ \;\;\;\;\left(b + a\right) \cdot \left(t_1 \cdot b\right)\\ \mathbf{elif}\;b \leq -3.9 \cdot 10^{-107}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-97}:\\ \;\;\;\;\left(b + a\right) \cdot \left(t_1 \cdot \left(-a\right)\right)\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{+37}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\sin \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot b\right)\\ \end{array} \]
Alternative 3
Error30.6
Cost13768
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot b\right)\\ \mathbf{if}\;b \leq -1.2 \cdot 10^{-113}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-123}:\\ \;\;\;\;\left(-a \cdot a\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error27.3
Cost13768
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot \left(\left(-a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\ \mathbf{if}\;a \leq -6.2 \cdot 10^{-19}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 1.3 \cdot 10^{+26}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error27.3
Cost13768
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot \left(\sin \left(angle \cdot \left(0.011111111111111112 \cdot \pi\right)\right) \cdot \left(-a\right)\right)\\ \mathbf{if}\;a \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{+25}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error30.6
Cost13704
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\\ t_1 := \left(b + a\right) \cdot \left(t_0 \cdot b\right)\\ \mathbf{if}\;b \leq -1.9 \cdot 10^{-115}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-123}:\\ \;\;\;\;t_0 \cdot \left(-a \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 7
Error35.5
Cost13640
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\\ t_1 := t_0 \cdot \left(-a \cdot a\right)\\ \mathbf{if}\;a \leq -3.2 \cdot 10^{-19}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{+33}:\\ \;\;\;\;t_0 \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 8
Error35.5
Cost13640
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\\ t_1 := -a \cdot a\\ \mathbf{if}\;a \leq -1.35 \cdot 10^{-19}:\\ \;\;\;\;\sin \left(\left(angle \cdot 0.011111111111111112\right) \cdot \pi\right) \cdot t_1\\ \mathbf{elif}\;a \leq 2.35 \cdot 10^{+33}:\\ \;\;\;\;t_0 \cdot \left(b \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot t_1\\ \end{array} \]
Alternative 9
Error20.6
Cost13568
\[\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\right) \]
Alternative 10
Error20.7
Cost13568
\[\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(angle \cdot 0.011111111111111112\right) \cdot \pi\right)\right) \]
Alternative 11
Error20.6
Cost13568
\[\left(b + a\right) \cdot \left(\left(b - a\right) \cdot \sin \left(\left(\pi \cdot angle\right) \cdot 0.011111111111111112\right)\right) \]
Alternative 12
Error41.5
Cost13312
\[\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b \cdot b\right) \]
Alternative 13
Error48.1
Cost7300
\[\begin{array}{l} \mathbf{if}\;angle \leq -29000:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot {\left(\frac{-1}{angle}\right)}^{3}\right)\\ \mathbf{elif}\;angle \leq 4 \cdot 10^{+16}:\\ \;\;\;\;\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b + a\right) \cdot \left(\left(b - a\right) \cdot 0\right)\\ \end{array} \]
Alternative 14
Error48.2
Cost840
\[\begin{array}{l} t_0 := \left(b + a\right) \cdot \left(\left(b - a\right) \cdot 0\right)\\ \mathbf{if}\;angle \leq -7.5 \cdot 10^{+90}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;angle \leq 3.9 \cdot 10^{+16}:\\ \;\;\;\;\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 15
Error51.1
Cost576
\[\left(angle \cdot \left(b - a\right)\right) \cdot \left(a + b\right) \]
Alternative 16
Error52.2
Cost320
\[\left(angle \cdot b\right) \cdot b \]

Error

Reproduce

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